summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/tests/ui-toml/array_size_threshold/array_size_threshold.rs (renamed from tests/ui-toml/array_size_threshold/array_size_threshold.rs)0
-rw-r--r--src/tools/clippy/tests/ui-toml/array_size_threshold/array_size_threshold.stderr (renamed from tests/ui-toml/array_size_threshold/array_size_threshold.stderr)0
-rw-r--r--src/tools/clippy/tests/ui-toml/array_size_threshold/clippy.toml (renamed from tests/ui-toml/array_size_threshold/clippy.toml)0
-rw-r--r--tests/assembly/asm/global_asm.rs4
-rw-r--r--tests/assembly/asm/m68k-types.rs83
-rw-r--r--tests/assembly/is_aligned.rs1
-rw-r--r--tests/assembly/static-relocation-model.rs1
-rw-r--r--tests/assembly/strict_provenance.rs1
-rw-r--r--tests/assembly/x86_64-floating-point-clamp.rs1
-rw-r--r--tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs2
-rw-r--r--tests/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs17
-rw-r--r--tests/assembly/x86_64-no-jump-tables.rs1
-rw-r--r--tests/codegen-units/polymorphization/auxiliary/poly-dep.rs4
-rw-r--r--tests/codegen-units/polymorphization/poly-foreign.rs11
-rw-r--r--tests/codegen/abi-main-signature-16bit-c-int.rs1
-rw-r--r--tests/codegen/adjustments.rs2
-rw-r--r--tests/codegen/array-map.rs6
-rw-r--r--tests/codegen/comparison-operators-2-tuple.rs121
-rw-r--r--tests/codegen/consts.rs2
-rw-r--r--tests/codegen/debug-limited.rs27
-rw-r--r--tests/codegen/debug-line-directives-only.rs27
-rw-r--r--tests/codegen/debug-line-tables-only.rs27
-rw-r--r--tests/codegen/enum-match.rs7
-rw-r--r--tests/codegen/fewer-names.rs4
-rw-r--r--tests/codegen/global_asm.rs27
-rw-r--r--tests/codegen/global_asm_include.rs27
-rw-r--r--tests/codegen/global_asm_x2.rs27
-rw-r--r--tests/codegen/inherit_overflow.rs2
-rw-r--r--tests/codegen/inline-function-args-debug-info.rs20
-rw-r--r--tests/codegen/intrinsics/transmute-x64.rs35
-rw-r--r--tests/codegen/intrinsics/transmute.rs431
-rw-r--r--tests/codegen/issues/auxiliary/static_dllimport_aux.rs (renamed from tests/codegen/auxiliary/static_dllimport_aux.rs)0
-rw-r--r--tests/codegen/issues/issue-101048.rs13
-rw-r--r--tests/codegen/issues/issue-101082.rs17
-rw-r--r--tests/codegen/issues/issue-101814.rs20
-rw-r--r--tests/codegen/issues/issue-103132.rs16
-rw-r--r--tests/codegen/issues/issue-103285-ptr-addr-overflow-check.rs (renamed from tests/codegen/issue-103285-ptr-addr-overflow-check.rs)0
-rw-r--r--tests/codegen/issues/issue-103327.rs18
-rw-r--r--tests/codegen/issues/issue-103840.rs (renamed from tests/codegen/issue-103840.rs)0
-rw-r--r--tests/codegen/issues/issue-105386-ub-in-debuginfo.rs (renamed from tests/codegen/issue-105386-ub-in-debuginfo.rs)0
-rw-r--r--tests/codegen/issues/issue-106369.rs15
-rw-r--r--tests/codegen/issues/issue-13018.rs (renamed from tests/codegen/issue-13018.rs)0
-rw-r--r--tests/codegen/issues/issue-15953.rs (renamed from tests/codegen/issue-15953.rs)0
-rw-r--r--tests/codegen/issues/issue-27130.rs (renamed from tests/codegen/issue-27130.rs)0
-rw-r--r--tests/codegen/issues/issue-32031.rs (renamed from tests/codegen/issue-32031.rs)0
-rw-r--r--tests/codegen/issues/issue-32364.rs (renamed from tests/codegen/issue-32364.rs)0
-rw-r--r--tests/codegen/issues/issue-34634.rs (renamed from tests/codegen/issue-34634.rs)0
-rw-r--r--tests/codegen/issues/issue-34947-pow-i32.rs (renamed from tests/codegen/issue-34947-pow-i32.rs)0
-rw-r--r--tests/codegen/issues/issue-37945.rs (renamed from tests/codegen/issue-37945.rs)7
-rw-r--r--tests/codegen/issues/issue-44056-macos-tls-align.rs (renamed from tests/codegen/issue-44056-macos-tls-align.rs)0
-rw-r--r--tests/codegen/issues/issue-45222.rs (renamed from tests/codegen/issue-45222.rs)0
-rw-r--r--tests/codegen/issues/issue-45466.rs (renamed from tests/codegen/issue-45466.rs)0
-rw-r--r--tests/codegen/issues/issue-45964-bounds-check-slice-pos.rs (renamed from tests/codegen/issue-45964-bounds-check-slice-pos.rs)0
-rw-r--r--tests/codegen/issues/issue-47278.rs (renamed from tests/codegen/issue-47278.rs)0
-rw-r--r--tests/codegen/issues/issue-47442.rs (renamed from tests/codegen/issue-47442.rs)0
-rw-r--r--tests/codegen/issues/issue-56267-2.rs (renamed from tests/codegen/issue-56267-2.rs)0
-rw-r--r--tests/codegen/issues/issue-56267.rs (renamed from tests/codegen/issue-56267.rs)0
-rw-r--r--tests/codegen/issues/issue-56927.rs (renamed from tests/codegen/issue-56927.rs)0
-rw-r--r--tests/codegen/issues/issue-58881.rs (renamed from tests/codegen/issue-58881.rs)0
-rw-r--r--tests/codegen/issues/issue-59352.rs (renamed from tests/codegen/issue-59352.rs)0
-rw-r--r--tests/codegen/issues/issue-69101-bounds-check.rs (renamed from tests/codegen/issue-69101-bounds-check.rs)0
-rw-r--r--tests/codegen/issues/issue-73031.rs (renamed from tests/codegen/issue-73031.rs)0
-rw-r--r--tests/codegen/issues/issue-73258.rs38
-rw-r--r--tests/codegen/issues/issue-73338-effecient-cmp.rs (renamed from tests/codegen/issue-73338-effecient-cmp.rs)0
-rw-r--r--tests/codegen/issues/issue-73396-bounds-check-after-position.rs (renamed from tests/codegen/issue-73396-bounds-check-after-position.rs)0
-rw-r--r--tests/codegen/issues/issue-73827-bounds-check-index-in-subexpr.rs (renamed from tests/codegen/issue-73827-bounds-check-index-in-subexpr.rs)0
-rw-r--r--tests/codegen/issues/issue-75525-bounds-checks.rs (renamed from tests/codegen/issue-75525-bounds-checks.rs)0
-rw-r--r--tests/codegen/issues/issue-75546.rs (renamed from tests/codegen/issue-75546.rs)0
-rw-r--r--tests/codegen/issues/issue-75659.rs (renamed from tests/codegen/issue-75659.rs)0
-rw-r--r--tests/codegen/issues/issue-75978.rs19
-rw-r--r--tests/codegen/issues/issue-77812.rs (renamed from tests/codegen/issue-77812.rs)0
-rw-r--r--tests/codegen/issues/issue-81408-dllimport-thinlto-windows.rs (renamed from tests/codegen/issue-81408-dllimport-thinlto-windows.rs)0
-rw-r--r--tests/codegen/issues/issue-84268.rs (renamed from tests/codegen/issue-84268.rs)0
-rw-r--r--tests/codegen/issues/issue-85872-multiple-reverse.rs (renamed from tests/codegen/issue-85872-multiple-reverse.rs)0
-rw-r--r--tests/codegen/issues/issue-86106.rs (renamed from tests/codegen/issue-86106.rs)0
-rw-r--r--tests/codegen/issues/issue-96274.rs (renamed from tests/codegen/issue-96274.rs)0
-rw-r--r--tests/codegen/issues/issue-96497-slice-size-nowrap.rs (renamed from tests/codegen/issue-96497-slice-size-nowrap.rs)0
-rw-r--r--tests/codegen/issues/issue-98156-const-arg-temp-lifetime.rs (renamed from tests/codegen/issue-98156-const-arg-temp-lifetime.rs)0
-rw-r--r--tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs (renamed from tests/codegen/issue-98294-get-mut-copy-from-slice-opt.rs)0
-rw-r--r--tests/codegen/issues/issue-99960.rs15
-rw-r--r--tests/codegen/mem-replace-big-type.rs36
-rw-r--r--tests/codegen/mem-replace-direct-memcpy.rs21
-rw-r--r--tests/codegen/optimize-attr-1.rs3
-rw-r--r--tests/codegen/option-as-slice.rs18
-rw-r--r--tests/codegen/ptr-read-metadata.rs96
-rw-r--r--tests/codegen/remap_path_prefix/main.rs2
-rw-r--r--tests/codegen/repr-transparent-aggregates-2.rs1
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs51
-rw-r--r--tests/codegen/simd-wide-sum.rs2
-rw-r--r--tests/codegen/slice-indexing.rs35
-rw-r--r--tests/codegen/transmute-scalar.rs65
-rw-r--r--tests/codegen/var-names.rs4
-rw-r--r--tests/codegen/vec-as-ptr.rs19
-rw-r--r--tests/codegen/vec-in-place.rs42
-rw-r--r--tests/codegen/vec-shrink-panik.rs23
-rw-r--r--tests/codegen/virtual-function-elimination.rs5
-rw-r--r--tests/debuginfo/function-names.rs4
-rw-r--r--tests/debuginfo/type-names.rs1
-rw-r--r--tests/incremental/auxiliary/circular-dependencies-aux.rs10
-rw-r--r--tests/incremental/circular-dependencies.rs37
-rw-r--r--tests/incremental/hashes/let_expressions.rs4
-rw-r--r--tests/incremental/issue-108481-feed-eval-always.rs16
-rw-r--r--tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir60
-rw-r--r--tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir2
-rw-r--r--tests/mir-opt/array_index_is_temporary.rs1
-rw-r--r--tests/mir-opt/asm_unwind_panic_abort.main.AbortUnwindingCalls.after.mir6
-rw-r--r--tests/mir-opt/basic_assignment.main.ElaborateDrops.diff89
-rw-r--r--tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir32
-rw-r--r--tests/mir-opt/basic_assignment.rs2
-rw-r--r--tests/mir-opt/box_expr.main.ElaborateDrops.before.mir64
-rw-r--r--tests/mir-opt/box_expr.rs9
-rw-r--r--tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir54
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir16
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir15
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.rs71
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir10
-rw-r--r--tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir10
-rw-r--r--tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir10
-rw-r--r--tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir10
-rw-r--r--tests/mir-opt/building/custom/as_cast.rs43
-rw-r--r--tests/mir-opt/building/custom/composite_return.rs21
-rw-r--r--tests/mir-opt/building/custom/composite_return.tuple.built.after.mir11
-rw-r--r--tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir10
-rw-r--r--tests/mir-opt/building/custom/references.rs11
-rw-r--r--tests/mir-opt/building/custom/terminators.drop_first.built.after.mir5
-rw-r--r--tests/mir-opt/building/custom/terminators.rs3
-rw-r--r--tests/mir-opt/building/enum_cast.droppy.built.after.mir2
-rw-r--r--tests/mir-opt/building/issue_101867.main.built.after.mir4
-rw-r--r--tests/mir-opt/building/issue_49232.main.built.after.mir2
-rw-r--r--tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir1
-rw-r--r--tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir1
-rw-r--r--tests/mir-opt/building/match_false_edges.main.built.after.mir1
-rw-r--r--tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir8
-rw-r--r--tests/mir-opt/building/shifts.rs20
-rw-r--r--tests/mir-opt/building/shifts.shift_signed.built.after.mir147
-rw-r--r--tests/mir-opt/building/shifts.shift_unsigned.built.after.mir135
-rw-r--r--tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir103
-rw-r--r--tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir103
-rw-r--r--tests/mir-opt/building/uniform_array_move_out.rs16
-rw-r--r--tests/mir-opt/combine_array_len.rs1
-rw-r--r--tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff2
-rw-r--r--tests/mir-opt/combine_transmutes.adt_transmutes.InstCombine.diff158
-rw-r--r--tests/mir-opt/combine_transmutes.identity_transmutes.InstCombine.diff43
-rw-r--r--tests/mir-opt/combine_transmutes.integer_transmutes.InstCombine.diff24
-rw-r--r--tests/mir-opt/combine_transmutes.rs65
-rw-r--r--tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir6
-rw-r--r--tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff6
-rw-r--r--tests/mir-opt/const_prop/aggregate.main.ConstProp.diff2
-rw-r--r--tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir2
-rw-r--r--tests/mir-opt/const_prop/aggregate.rs1
-rw-r--r--tests/mir-opt/const_prop/array_index.rs1
-rw-r--r--tests/mir-opt/const_prop/bad_op_div_by_zero.rs1
-rw-r--r--tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff8
-rw-r--r--tests/mir-opt/const_prop/bad_op_mod_by_zero.rs1
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff2
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff2
-rw-r--r--tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs1
-rw-r--r--tests/mir-opt/const_prop/boxes.main.ConstProp.diff64
-rw-r--r--tests/mir-opt/const_prop/boxes.rs8
-rw-r--r--tests/mir-opt/const_prop/checked_add.rs1
-rw-r--r--tests/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff4
-rw-r--r--tests/mir-opt/const_prop/const_prop_fails_gracefully.rs1
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff1
-rw-r--r--tests/mir-opt/const_prop/control_flow_simplification.rs1
-rw-r--r--tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff2
-rw-r--r--tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff2
-rw-r--r--tests/mir-opt/const_prop/indirect.rs1
-rw-r--r--tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.diff2
-rw-r--r--tests/mir-opt/const_prop/inherit_overflow.rs1
-rw-r--r--tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff14
-rw-r--r--tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff76
-rw-r--r--tests/mir-opt/const_prop/invalid_constant.rs1
-rw-r--r--tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff9
-rw-r--r--tests/mir-opt/const_prop/issue_66971.rs1
-rw-r--r--tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff4
-rw-r--r--tests/mir-opt/const_prop/issue_67019.rs1
-rw-r--r--tests/mir-opt/const_prop/large_array_index.rs1
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff2
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs1
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff2
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs1
-rw-r--r--tests/mir-opt/const_prop/optimizes_into_variable.rs1
-rw-r--r--tests/mir-opt/const_prop/repeat.rs1
-rw-r--r--tests/mir-opt/const_prop/return_place.rs1
-rw-r--r--tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff4
-rw-r--r--tests/mir-opt/const_prop/scalar_literal_propagation.rs1
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff2
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff2
-rw-r--r--tests/mir-opt/const_prop/slice_len.rs1
-rw-r--r--tests/mir-opt/const_prop/switch_int.main.ConstProp.diff4
-rw-r--r--tests/mir-opt/const_prop/switch_int.main.SimplifyConstCondition-after-const-prop.diff4
-rw-r--r--tests/mir-opt/const_prop/switch_int.rs1
-rw-r--r--tests/mir-opt/const_prop/transmute.from_char.ConstProp.diff15
-rw-r--r--tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.diff14
-rw-r--r--tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.diff14
-rw-r--r--tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.diff23
-rw-r--r--tests/mir-opt/const_prop/transmute.rs61
-rw-r--r--tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.diff22
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.diff23
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.diff25
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.diff27
-rw-r--r--tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.diff23
-rw-r--r--tests/mir-opt/const_prop/transmute.valid_char.ConstProp.diff15
-rw-r--r--tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff4
-rw-r--r--tests/mir-opt/const_prop/tuple_literal_propagation.rs1
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff4
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.rs1
-rw-r--r--tests/mir-opt/copy-prop/branch.foo.CopyProp.diff6
-rw-r--r--tests/mir-opt/copy-prop/branch.rs1
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.diff2
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.diff2
-rw-r--r--tests/mir-opt/copy-prop/copy_propagation_arg.rs1
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff4
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.rs1
-rw-r--r--tests/mir-opt/copy-prop/cycle.main.CopyProp.diff4
-rw-r--r--tests/mir-opt/copy-prop/cycle.rs1
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir2
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_79191.rs1
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir2
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_better.rs1
-rw-r--r--tests/mir-opt/copy-prop/issue_107511.main.CopyProp.diff6
-rw-r--r--tests/mir-opt/copy-prop/issue_107511.rs1
-rw-r--r--tests/mir-opt/copy-prop/move_arg.f.CopyProp.diff2
-rw-r--r--tests/mir-opt/copy-prop/move_arg.rs1
-rw-r--r--tests/mir-opt/copy-prop/move_projection.f.CopyProp.diff4
-rw-r--r--tests/mir-opt/copy-prop/move_projection.rs1
-rw-r--r--tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.diff56
-rw-r--r--tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.diff52
-rw-r--r--tests/mir-opt/copy-prop/reborrow.remut.CopyProp.diff50
-rw-r--r--tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.diff50
-rw-r--r--tests/mir-opt/copy-prop/reborrow.rs47
-rw-r--r--tests/mir-opt/dataflow-const-prop/checked.rs1
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff2
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.rs1
-rw-r--r--tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff4
-rw-r--r--tests/mir-opt/dataflow-const-prop/ref_without_sb.rs1
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff2
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.rs1
-rw-r--r--tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff2
-rw-r--r--tests/mir-opt/dataflow-const-prop/terminator.rs1
-rw-r--r--tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff2
-rw-r--r--tests/mir-opt/dead-store-elimination/cycle.rs1
-rw-r--r--tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff2
-rw-r--r--tests/mir-opt/deduplicate_blocks.rs1
-rw-r--r--tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir8
-rw-r--r--tests/mir-opt/derefer_inline_test.main.Derefer.diff50
-rw-r--r--tests/mir-opt/derefer_inline_test.rs5
-rw-r--r--tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff6
-rw-r--r--tests/mir-opt/dest-prop/branch.rs1
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff2
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff2
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.rs1
-rw-r--r--tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff4
-rw-r--r--tests/mir-opt/dest-prop/cycle.rs1
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.mir2
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_79191.rs1
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.mir2
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.rs1
-rw-r--r--tests/mir-opt/dest-prop/simple.rs1
-rw-r--r--tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff4
-rw-r--r--tests/mir-opt/dest-prop/union.rs1
-rw-r--r--tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff4
-rw-r--r--tests/mir-opt/dest-prop/unreachable.rs1
-rw-r--r--tests/mir-opt/div_overflow.const_dividend.PreCodegen.after.mir17
-rw-r--r--tests/mir-opt/div_overflow.const_divisor.PreCodegen.after.mir11
-rw-r--r--tests/mir-opt/div_overflow.rs18
-rw-r--r--tests/mir-opt/dont_yeet_assert.generic.InstCombine.diff2
-rw-r--r--tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff12
-rw-r--r--tests/mir-opt/funky_arms.rs1
-rw-r--r--tests/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir4
-rw-r--r--tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir2
-rw-r--r--tests/mir-opt/inline/asm_unwind.main.Inline.diff18
-rw-r--r--tests/mir-opt/inline/cycle.f.Inline.diff2
-rw-r--r--tests/mir-opt/inline/cycle.g.Inline.diff11
-rw-r--r--tests/mir-opt/inline/cycle.main.Inline.diff11
-rw-r--r--tests/mir-opt/inline/dyn_trait.get_query.Inline.diff24
-rw-r--r--tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff2
-rw-r--r--tests/mir-opt/inline/dyn_trait.rs1
-rw-r--r--tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff10
-rw-r--r--tests/mir-opt/inline/exponential_runtime.main.Inline.diff74
-rw-r--r--tests/mir-opt/inline/exponential_runtime.rs1
-rw-r--r--tests/mir-opt/inline/inline_closure.foo.Inline.after.mir2
-rw-r--r--tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir2
-rw-r--r--tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir2
-rw-r--r--tests/mir-opt/inline/inline_cycle.one.Inline.diff12
-rw-r--r--tests/mir-opt/inline/inline_cycle.rs1
-rw-r--r--tests/mir-opt/inline/inline_cycle.two.Inline.diff23
-rw-r--r--tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff17
-rw-r--r--tests/mir-opt/inline/inline_cycle_generic.rs1
-rw-r--r--tests/mir-opt/inline/inline_diverging.g.Inline.diff2
-rw-r--r--tests/mir-opt/inline/inline_diverging.h.Inline.diff40
-rw-r--r--tests/mir-opt/inline/inline_generator.main.Inline.diff2
-rw-r--r--tests/mir-opt/inline/inline_instruction_set.default.Inline.diff10
-rw-r--r--tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff10
-rw-r--r--tests/mir-opt/inline/inline_into_box_place.main.Inline.diff111
-rw-r--r--tests/mir-opt/inline/inline_into_box_place.rs4
-rw-r--r--tests/mir-opt/inline/inline_options.main.Inline.after.mir44
-rw-r--r--tests/mir-opt/inline/inline_options.rs1
-rw-r--r--tests/mir-opt/inline/inline_specialization.main.Inline.diff6
-rw-r--r--tests/mir-opt/inline/inline_specialization.rs1
-rw-r--r--tests/mir-opt/inline/inline_trait_method.rs1
-rw-r--r--tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir2
-rw-r--r--tests/mir-opt/inline/inline_trait_method_2.rs1
-rw-r--r--tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir8
-rw-r--r--tests/mir-opt/inline/issue_106141.outer.Inline.diff38
-rw-r--r--tests/mir-opt/inline/issue_106141.rs1
-rw-r--r--tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir9
-rw-r--r--tests/mir-opt/inline/issue_78442.bar.Inline.diff4
-rw-r--r--tests/mir-opt/inline/issue_78442.bar.RevealAll.diff2
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.rs18
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff144
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir130
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff144
-rw-r--r--tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir130
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.rs11
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff55
-rw-r--r--tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir41
-rw-r--r--tests/mir-opt/instcombine_duplicate_switch_targets.assert_zero.InstCombine.diff21
-rw-r--r--tests/mir-opt/instcombine_duplicate_switch_targets.rs27
-rw-r--r--tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff2
-rw-r--r--tests/mir-opt/intrinsic_asserts.generic.InstCombine.diff18
-rw-r--r--tests/mir-opt/intrinsic_asserts.panics.InstCombine.diff24
-rw-r--r--tests/mir-opt/intrinsic_asserts.removable.InstCombine.diff18
-rw-r--r--tests/mir-opt/issue_101973.inner.ConstProp.diff66
-rw-r--r--tests/mir-opt/issue_101973.rs1
-rw-r--r--tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir25
-rw-r--r--tests/mir-opt/issue_104451_unwindable_intrinsics.rs14
-rw-r--r--tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir2
-rw-r--r--tests/mir-opt/issue_41110.main.ElaborateDrops.diff8
-rw-r--r--tests/mir-opt/issue_41110.test.ElaborateDrops.diff52
-rw-r--r--tests/mir-opt/issue_41888.main.ElaborateDrops.diff91
-rw-r--r--tests/mir-opt/issue_62289.rs7
-rw-r--r--tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir118
-rw-r--r--tests/mir-opt/issue_72181.main.built.after.mir2
-rw-r--r--tests/mir-opt/issue_72181_1.main.built.after.mir4
-rw-r--r--tests/mir-opt/issue_76432.rs1
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff1
-rw-r--r--tests/mir-opt/issue_91633.bar.built.after.mir3
-rw-r--r--tests/mir-opt/issue_91633.foo.built.after.mir2
-rw-r--r--tests/mir-opt/issue_91633.hey.built.after.mir1
-rw-r--r--tests/mir-opt/issue_99325.main.built.after.mir4
-rw-r--r--tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir7
-rw-r--r--tests/mir-opt/issues/issue_59352.rs1
-rw-r--r--tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff48
-rw-r--r--tests/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir2
-rw-r--r--tests/mir-opt/lower_array_len.rs1
-rw-r--r--tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff2
-rw-r--r--tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff4
-rw-r--r--tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff4
-rw-r--r--tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff2
-rw-r--r--tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff2
-rw-r--r--tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.diff54
-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_uninhabited.LowerIntrinsics.diff21
-rw-r--r--tests/mir-opt/lower_intrinsics.rs57
-rw-r--r--tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff2
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff27
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.diff27
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.diff29
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.diff29
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.diff29
-rw-r--r--tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff22
-rw-r--r--tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff2
-rw-r--r--tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff12
-rw-r--r--tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff6
-rw-r--r--tests/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir4
-rw-r--r--tests/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir11
-rw-r--r--tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff2
-rw-r--r--tests/mir-opt/lower_slice_len.rs1
-rw-r--r--tests/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff2
-rw-r--r--tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir2
-rw-r--r--tests/mir-opt/nrvo_simple.rs1
-rw-r--r--tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir18
-rw-r--r--tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff4
-rw-r--r--tests/mir-opt/remove_storage_markers.rs1
-rw-r--r--tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff4
-rw-r--r--tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff4
-rw-r--r--tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff4
-rw-r--r--tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff4
-rw-r--r--tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir5
-rw-r--r--tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff9
-rw-r--r--tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir6
-rw-r--r--tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff8
-rw-r--r--tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff12
-rw-r--r--tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir37
-rw-r--r--tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff4
-rw-r--r--tests/mir-opt/simplify_duplicate_unreachable_blocks.assert_nonzero_nonmax.SimplifyCfg-after-uninhabited-enum-branching.diff25
-rw-r--r--tests/mir-opt/simplify_duplicate_unreachable_blocks.rs30
-rw-r--r--tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff4
-rw-r--r--tests/mir-opt/simplify_if.rs1
-rw-r--r--tests/mir-opt/simplify_locals_fixedpoint.rs1
-rw-r--r--tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.diff4
-rw-r--r--tests/mir-opt/simplify_locals_removes_unused_consts.rs1
-rw-r--r--tests/mir-opt/simplify_match.main.ConstProp.diff2
-rw-r--r--tests/mir-opt/simplify_match.rs1
-rw-r--r--tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir80
-rw-r--r--tests/mir-opt/sroa.constant.ScalarReplacementOfAggregates.diff46
-rw-r--r--tests/mir-opt/sroa.copies.ScalarReplacementOfAggregates.diff91
-rw-r--r--tests/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff44
-rw-r--r--tests/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff43
-rw-r--r--tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff44
-rw-r--r--tests/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff80
-rw-r--r--tests/mir-opt/sroa.ref_copies.ScalarReplacementOfAggregates.diff56
-rw-r--r--tests/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff33
-rw-r--r--tests/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff23
-rw-r--r--tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff214
-rw-r--r--tests/mir-opt/sroa/lifetimes.rs37
-rw-r--r--tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff46
-rw-r--r--tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff91
-rw-r--r--tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff44
-rw-r--r--tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff43
-rw-r--r--tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff44
-rw-r--r--tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff80
-rw-r--r--tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff56
-rw-r--r--tests/mir-opt/sroa/structs.rs (renamed from tests/mir-opt/sroa.rs)18
-rw-r--r--tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff33
-rw-r--r--tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff23
-rw-r--r--tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir20
-rw-r--r--tests/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir12
-rw-r--r--tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff12
-rw-r--r--tests/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir12
-rw-r--r--tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff22
-rw-r--r--tests/mir-opt/unreachable.main.UnreachablePropagation.diff2
-rw-r--r--tests/mir-opt/unreachable.rs1
-rw-r--r--tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff4
-rw-r--r--tests/mir-opt/unreachable_diverging.rs1
-rw-r--r--tests/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir2
-rw-r--r--tests/mir-opt/while_storage.rs1
-rw-r--r--tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir4
-rw-r--r--tests/pretty/ast-stmt-expr-attr.rs1
-rw-r--r--tests/pretty/issue-4264.pp10
-rw-r--r--tests/pretty/stmt_expr_attributes.rs2
-rw-r--r--tests/pretty/tests-are-sorted.pp22
-rw-r--r--tests/pretty/tests-are-sorted.rs3
-rw-r--r--tests/run-make-fulldeps/hotplug_codegen_backend/Makefile2
-rw-r--r--tests/run-make-fulldeps/issue-19371/Makefile2
-rw-r--r--tests/run-make-fulldeps/issue-25581/Makefile5
-rw-r--r--tests/run-make-fulldeps/obtain-borrowck/Makefile2
-rw-r--r--tests/run-make-fulldeps/pretty-expanded/Makefile2
-rw-r--r--tests/run-make/a-b-a-linker-guard/Makefile (renamed from tests/run-make-fulldeps/a-b-a-linker-guard/Makefile)1
-rw-r--r--tests/run-make/a-b-a-linker-guard/a.rs (renamed from tests/run-make-fulldeps/a-b-a-linker-guard/a.rs)0
-rw-r--r--tests/run-make/a-b-a-linker-guard/b.rs (renamed from tests/run-make-fulldeps/a-b-a-linker-guard/b.rs)0
-rw-r--r--tests/run-make/alloc-no-oom-handling/Makefile (renamed from tests/run-make-fulldeps/alloc-no-oom-handling/Makefile)0
-rw-r--r--tests/run-make/alloc-no-rc/Makefile (renamed from tests/run-make-fulldeps/alloc-no-rc/Makefile)0
-rw-r--r--tests/run-make/alloc-no-sync/Makefile (renamed from tests/run-make-fulldeps/alloc-no-sync/Makefile)0
-rw-r--r--tests/run-make/allow-non-lint-warnings-cmdline/Makefile (renamed from tests/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile)1
-rw-r--r--tests/run-make/allow-non-lint-warnings-cmdline/foo.rs (renamed from tests/run-make-fulldeps/allow-non-lint-warnings-cmdline/foo.rs)0
-rw-r--r--tests/run-make/allow-warnings-cmdline-stability/Makefile (renamed from tests/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile)1
-rw-r--r--tests/run-make/allow-warnings-cmdline-stability/bar.rs (renamed from tests/run-make-fulldeps/allow-warnings-cmdline-stability/bar.rs)0
-rw-r--r--tests/run-make/allow-warnings-cmdline-stability/foo.rs (renamed from tests/run-make-fulldeps/allow-warnings-cmdline-stability/foo.rs)0
-rw-r--r--tests/run-make/archive-duplicate-names/Makefile (renamed from tests/run-make-fulldeps/archive-duplicate-names/Makefile)1
-rw-r--r--tests/run-make/archive-duplicate-names/bar.c (renamed from tests/run-make-fulldeps/archive-duplicate-names/bar.c)0
-rw-r--r--tests/run-make/archive-duplicate-names/bar.rs (renamed from tests/run-make-fulldeps/archive-duplicate-names/bar.rs)0
-rw-r--r--tests/run-make/archive-duplicate-names/foo.c (renamed from tests/run-make-fulldeps/archive-duplicate-names/foo.c)0
-rw-r--r--tests/run-make/archive-duplicate-names/foo.rs (renamed from tests/run-make-fulldeps/archive-duplicate-names/foo.rs)0
-rw-r--r--tests/run-make/arguments-non-c-like-enum/Makefile (renamed from tests/run-make-fulldeps/return-non-c-like-enum/Makefile)1
-rw-r--r--tests/run-make/arguments-non-c-like-enum/nonclike.rs (renamed from tests/run-make-fulldeps/arguments-non-c-like-enum/nonclike.rs)0
-rw-r--r--tests/run-make/arguments-non-c-like-enum/test.c (renamed from tests/run-make-fulldeps/arguments-non-c-like-enum/test.c)0
-rw-r--r--tests/run-make/atomic-lock-free/Makefile (renamed from tests/run-make-fulldeps/atomic-lock-free/Makefile)0
-rw-r--r--tests/run-make/atomic-lock-free/atomic_lock_free.rs (renamed from tests/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs)0
-rw-r--r--tests/run-make/bare-outfile/Makefile (renamed from tests/run-make-fulldeps/bare-outfile/Makefile)1
-rw-r--r--tests/run-make/bare-outfile/foo.rs (renamed from tests/run-make-fulldeps/bare-outfile/foo.rs)0
-rw-r--r--tests/run-make/c-dynamic-dylib/Makefile (renamed from tests/run-make-fulldeps/c-dynamic-dylib/Makefile)1
-rw-r--r--tests/run-make/c-dynamic-dylib/bar.rs (renamed from tests/run-make-fulldeps/c-dynamic-dylib/bar.rs)0
-rw-r--r--tests/run-make/c-dynamic-dylib/cfoo.c (renamed from tests/run-make-fulldeps/c-dynamic-dylib/cfoo.c)0
-rw-r--r--tests/run-make/c-dynamic-dylib/foo.rs (renamed from tests/run-make-fulldeps/c-dynamic-dylib/foo.rs)0
-rw-r--r--tests/run-make/c-dynamic-rlib/Makefile (renamed from tests/run-make-fulldeps/c-dynamic-rlib/Makefile)1
-rw-r--r--tests/run-make/c-dynamic-rlib/bar.rs (renamed from tests/run-make-fulldeps/c-dynamic-rlib/bar.rs)0
-rw-r--r--tests/run-make/c-dynamic-rlib/cfoo.c (renamed from tests/run-make-fulldeps/c-dynamic-rlib/cfoo.c)0
-rw-r--r--tests/run-make/c-dynamic-rlib/foo.rs (renamed from tests/run-make-fulldeps/c-dynamic-rlib/foo.rs)0
-rw-r--r--tests/run-make/c-link-to-rust-dylib/Makefile (renamed from tests/run-make-fulldeps/c-link-to-rust-dylib/Makefile)1
-rw-r--r--tests/run-make/c-link-to-rust-dylib/bar.c (renamed from tests/run-make-fulldeps/c-link-to-rust-dylib/bar.c)0
-rw-r--r--tests/run-make/c-link-to-rust-dylib/foo.rs (renamed from tests/run-make-fulldeps/c-link-to-rust-dylib/foo.rs)0
-rw-r--r--tests/run-make/c-link-to-rust-staticlib/Makefile (renamed from tests/run-make-fulldeps/c-link-to-rust-staticlib/Makefile)1
-rw-r--r--tests/run-make/c-link-to-rust-staticlib/bar.c (renamed from tests/run-make-fulldeps/c-link-to-rust-staticlib/bar.c)0
-rw-r--r--tests/run-make/c-link-to-rust-staticlib/foo.rs (renamed from tests/run-make-fulldeps/c-link-to-rust-staticlib/foo.rs)0
-rw-r--r--tests/run-make/c-link-to-rust-va-list-fn/Makefile (renamed from tests/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile)1
-rw-r--r--tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs (renamed from tests/run-make-fulldeps/c-link-to-rust-va-list-fn/checkrust.rs)0
-rw-r--r--tests/run-make/c-link-to-rust-va-list-fn/test.c (renamed from tests/run-make-fulldeps/c-link-to-rust-va-list-fn/test.c)0
-rw-r--r--tests/run-make/c-static-dylib/Makefile (renamed from tests/run-make-fulldeps/c-static-dylib/Makefile)1
-rw-r--r--tests/run-make/c-static-dylib/bar.rs (renamed from tests/run-make-fulldeps/c-static-dylib/bar.rs)0
-rw-r--r--tests/run-make/c-static-dylib/cfoo.c (renamed from tests/run-make-fulldeps/c-static-dylib/cfoo.c)0
-rw-r--r--tests/run-make/c-static-dylib/foo.rs (renamed from tests/run-make-fulldeps/c-static-dylib/foo.rs)0
-rw-r--r--tests/run-make/c-static-rlib/Makefile (renamed from tests/run-make-fulldeps/c-static-rlib/Makefile)1
-rw-r--r--tests/run-make/c-static-rlib/bar.rs (renamed from tests/run-make-fulldeps/c-static-rlib/bar.rs)0
-rw-r--r--tests/run-make/c-static-rlib/cfoo.c (renamed from tests/run-make-fulldeps/c-static-rlib/cfoo.c)0
-rw-r--r--tests/run-make/c-static-rlib/foo.rs (renamed from tests/run-make-fulldeps/c-static-rlib/foo.rs)0
-rw-r--r--tests/run-make/c-unwind-abi-catch-lib-panic/Makefile (renamed from tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile)1
-rw-r--r--tests/run-make/c-unwind-abi-catch-lib-panic/add.c (renamed from tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/add.c)0
-rw-r--r--tests/run-make/c-unwind-abi-catch-lib-panic/main.rs (renamed from tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/main.rs)0
-rw-r--r--tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs (renamed from tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/panic.rs)0
-rw-r--r--tests/run-make/c-unwind-abi-catch-panic/Makefile (renamed from tests/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile)1
-rw-r--r--tests/run-make/c-unwind-abi-catch-panic/add.c (renamed from tests/run-make-fulldeps/c-unwind-abi-catch-panic/add.c)0
-rw-r--r--tests/run-make/c-unwind-abi-catch-panic/main.rs (renamed from tests/run-make-fulldeps/c-unwind-abi-catch-panic/main.rs)0
-rw-r--r--tests/run-make/cat-and-grep-sanity-check/Makefile (renamed from tests/run-make-fulldeps/cat-and-grep-sanity-check/Makefile)0
-rw-r--r--tests/run-make/cdylib-dylib-linkage/Makefile (renamed from tests/run-make-fulldeps/cdylib-dylib-linkage/Makefile)1
-rw-r--r--tests/run-make/cdylib-dylib-linkage/bar.rs (renamed from tests/run-make-fulldeps/cdylib-dylib-linkage/bar.rs)0
-rw-r--r--tests/run-make/cdylib-dylib-linkage/foo.c (renamed from tests/run-make-fulldeps/cdylib-dylib-linkage/foo.c)0
-rw-r--r--tests/run-make/cdylib-dylib-linkage/foo.rs (renamed from tests/run-make-fulldeps/cdylib-dylib-linkage/foo.rs)0
-rw-r--r--tests/run-make/cdylib-fewer-symbols/Makefile (renamed from tests/run-make-fulldeps/cdylib-fewer-symbols/Makefile)1
-rw-r--r--tests/run-make/cdylib-fewer-symbols/foo.rs (renamed from tests/run-make-fulldeps/cdylib-fewer-symbols/foo.rs)0
-rw-r--r--tests/run-make/cdylib/Makefile (renamed from tests/run-make-fulldeps/cdylib/Makefile)1
-rw-r--r--tests/run-make/cdylib/bar.rs (renamed from tests/run-make-fulldeps/cdylib/bar.rs)0
-rw-r--r--tests/run-make/cdylib/foo.c (renamed from tests/run-make-fulldeps/cdylib/foo.c)0
-rw-r--r--tests/run-make/cdylib/foo.rs (renamed from tests/run-make-fulldeps/cdylib/foo.rs)0
-rw-r--r--tests/run-make/codegen-options-parsing/Makefile (renamed from tests/run-make-fulldeps/codegen-options-parsing/Makefile)1
-rw-r--r--tests/run-make/codegen-options-parsing/dummy.rs (renamed from tests/run-make-fulldeps/codegen-options-parsing/dummy.rs)0
-rw-r--r--tests/run-make/compile-stdin/Makefile (renamed from tests/run-make-fulldeps/compile-stdin/Makefile)1
-rw-r--r--tests/run-make/compiler-lookup-paths-2/Makefile (renamed from tests/run-make-fulldeps/compiler-lookup-paths-2/Makefile)0
-rw-r--r--tests/run-make/compiler-lookup-paths-2/a.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths-2/a.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths-2/b.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths-2/b.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths-2/c.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths-2/c.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths/Makefile (renamed from tests/run-make-fulldeps/compiler-lookup-paths/Makefile)3
-rw-r--r--tests/run-make/compiler-lookup-paths/a.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths/a.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths/b.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths/b.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths/c.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths/c.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths/d.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths/d.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths/e.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths/e.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths/e2.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths/e2.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths/f.rs (renamed from tests/run-make-fulldeps/compiler-lookup-paths/f.rs)0
-rw-r--r--tests/run-make/compiler-lookup-paths/native.c (renamed from tests/run-make-fulldeps/compiler-lookup-paths/native.c)0
-rw-r--r--tests/run-make/compiler-rt-works-on-mingw/Makefile (renamed from tests/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile)0
-rw-r--r--tests/run-make/compiler-rt-works-on-mingw/foo.cpp (renamed from tests/run-make-fulldeps/compiler-rt-works-on-mingw/foo.cpp)0
-rw-r--r--tests/run-make/compiler-rt-works-on-mingw/foo.rs (renamed from tests/run-make-fulldeps/compiler-rt-works-on-mingw/foo.rs)0
-rw-r--r--tests/run-make/const_fn_mir/Makefile2
-rw-r--r--tests/run-make/const_fn_mir/dump.mir8
-rw-r--r--tests/run-make/core-no-fp-fmt-parse/Makefile (renamed from tests/run-make-fulldeps/core-no-fp-fmt-parse/Makefile)0
-rw-r--r--tests/run-make/coverage-reports/expected_show_coverage.abort.txt2
-rw-r--r--tests/run-make/coverage-reports/expected_show_coverage.closure.txt4
-rw-r--r--tests/run-make/coverage-reports/expected_show_coverage.continue.txt2
-rw-r--r--tests/run-make/coverage/abort.rs2
-rw-r--r--tests/run-make/coverage/coverage_tools.mk2
-rw-r--r--tests/run-make/crate-data-smoke/Makefile (renamed from tests/run-make-fulldeps/crate-data-smoke/Makefile)0
-rw-r--r--tests/run-make/crate-data-smoke/crate.rs (renamed from tests/run-make-fulldeps/crate-data-smoke/crate.rs)0
-rw-r--r--tests/run-make/crate-data-smoke/lib.rs (renamed from tests/run-make-fulldeps/crate-data-smoke/lib.rs)0
-rw-r--r--tests/run-make/crate-data-smoke/rlib.rs (renamed from tests/run-make-fulldeps/crate-data-smoke/rlib.rs)0
-rw-r--r--tests/run-make/crate-hash-rustc-version/Makefile (renamed from tests/run-make-fulldeps/crate-hash-rustc-version/Makefile)3
-rw-r--r--tests/run-make/crate-hash-rustc-version/a.rs (renamed from tests/run-make-fulldeps/crate-hash-rustc-version/a.rs)0
-rw-r--r--tests/run-make/crate-hash-rustc-version/b.rs (renamed from tests/run-make-fulldeps/crate-hash-rustc-version/b.rs)0
-rw-r--r--tests/run-make/crate-name-priority/Makefile (renamed from tests/run-make-fulldeps/crate-name-priority/Makefile)1
-rw-r--r--tests/run-make/crate-name-priority/foo.rs (renamed from tests/run-make-fulldeps/crate-name-priority/foo.rs)0
-rw-r--r--tests/run-make/crate-name-priority/foo1.rs (renamed from tests/run-make-fulldeps/crate-name-priority/foo1.rs)0
-rw-r--r--tests/run-make/cross-lang-lto-clang/Makefile (renamed from tests/run-make-fulldeps/cross-lang-lto-clang/Makefile)0
-rw-r--r--tests/run-make/cross-lang-lto-clang/clib.c (renamed from tests/run-make-fulldeps/cross-lang-lto-clang/clib.c)0
-rw-r--r--tests/run-make/cross-lang-lto-clang/cmain.c (renamed from tests/run-make-fulldeps/cross-lang-lto-clang/cmain.c)0
-rw-r--r--tests/run-make/cross-lang-lto-clang/main.rs (renamed from tests/run-make-fulldeps/cross-lang-lto-clang/main.rs)0
-rw-r--r--tests/run-make/cross-lang-lto-clang/rustlib.rs (renamed from tests/run-make-fulldeps/cross-lang-lto-clang/rustlib.rs)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest/Makefile (renamed from tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest/clib.c (renamed from tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/clib.c)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest/cmain.c (renamed from tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/cmain.c)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest/main.rs (renamed from tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/main.rs)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest/rustlib.rs (renamed from tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/rustlib.rs)0
-rw-r--r--tests/run-make/cross-lang-lto-upstream-rlibs/Makefile (renamed from tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile)0
-rw-r--r--tests/run-make/cross-lang-lto-upstream-rlibs/staticlib.rs (renamed from tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs)0
-rw-r--r--tests/run-make/cross-lang-lto-upstream-rlibs/upstream.rs (renamed from tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/upstream.rs)0
-rw-r--r--tests/run-make/cross-lang-lto/Makefile (renamed from tests/run-make-fulldeps/cross-lang-lto/Makefile)0
-rw-r--r--tests/run-make/cross-lang-lto/lib.rs (renamed from tests/run-make-fulldeps/cross-lang-lto/lib.rs)0
-rw-r--r--tests/run-make/cross-lang-lto/main.rs (renamed from tests/run-make-fulldeps/cross-lang-lto/main.rs)0
-rw-r--r--tests/run-make/debug-assertions/Makefile (renamed from tests/run-make-fulldeps/debug-assertions/Makefile)1
-rw-r--r--tests/run-make/debug-assertions/debug.rs (renamed from tests/run-make-fulldeps/debug-assertions/debug.rs)0
-rw-r--r--tests/run-make/dep-graph/Makefile2
-rw-r--r--tests/run-make/dep-info-doesnt-run-much/Makefile (renamed from tests/run-make-fulldeps/dep-info-doesnt-run-much/Makefile)0
-rw-r--r--tests/run-make/dep-info-doesnt-run-much/foo.rs (renamed from tests/run-make-fulldeps/dep-info-doesnt-run-much/foo.rs)0
-rw-r--r--tests/run-make/dep-info-spaces/Makefile (renamed from tests/run-make-fulldeps/dep-info-spaces/Makefile)0
-rw-r--r--tests/run-make/dep-info-spaces/Makefile.foo (renamed from tests/run-make-fulldeps/dep-info-spaces/Makefile.foo)0
-rw-r--r--tests/run-make/dep-info-spaces/bar.rs (renamed from tests/run-make-fulldeps/dep-info-spaces/bar.rs)0
-rw-r--r--tests/run-make/dep-info-spaces/foo foo.rs (renamed from tests/run-make-fulldeps/dep-info-spaces/foo foo.rs)0
-rw-r--r--tests/run-make/dep-info-spaces/lib.rs (renamed from tests/run-make-fulldeps/dep-info-spaces/lib.rs)0
-rw-r--r--tests/run-make/dep-info/Makefile (renamed from tests/run-make-fulldeps/dep-info/Makefile)0
-rw-r--r--tests/run-make/dep-info/Makefile.foo (renamed from tests/run-make-fulldeps/dep-info/Makefile.foo)0
-rw-r--r--tests/run-make/dep-info/bar.rs (renamed from tests/run-make-fulldeps/dep-info/bar.rs)0
-rw-r--r--tests/run-make/dep-info/foo.rs (renamed from tests/run-make-fulldeps/dep-info/foo.rs)0
-rw-r--r--tests/run-make/dep-info/lib.rs (renamed from tests/run-make-fulldeps/dep-info/lib.rs)0
-rw-r--r--tests/run-make/dep-info/lib2.rs (renamed from tests/run-make-fulldeps/dep-info/lib2.rs)0
-rw-r--r--tests/run-make/doctests-keep-binaries/Makefile (renamed from tests/run-make-fulldeps/doctests-keep-binaries/Makefile)3
-rw-r--r--tests/run-make/doctests-keep-binaries/t.rs (renamed from tests/run-make-fulldeps/doctests-keep-binaries/t.rs)0
-rw-r--r--tests/run-make/dump-mono-stats/Makefile2
-rw-r--r--tests/run-make/duplicate-output-flavors/Makefile (renamed from tests/run-make-fulldeps/duplicate-output-flavors/Makefile)0
-rw-r--r--tests/run-make/duplicate-output-flavors/foo.rs (renamed from tests/run-make-fulldeps/duplicate-output-flavors/foo.rs)0
-rw-r--r--tests/run-make/dylib-chain/Makefile (renamed from tests/run-make-fulldeps/dylib-chain/Makefile)1
-rw-r--r--tests/run-make/dylib-chain/m1.rs (renamed from tests/run-make-fulldeps/dylib-chain/m1.rs)0
-rw-r--r--tests/run-make/dylib-chain/m2.rs (renamed from tests/run-make-fulldeps/dylib-chain/m2.rs)0
-rw-r--r--tests/run-make/dylib-chain/m3.rs (renamed from tests/run-make-fulldeps/dylib-chain/m3.rs)0
-rw-r--r--tests/run-make/dylib-chain/m4.rs (renamed from tests/run-make-fulldeps/dylib-chain/m4.rs)0
-rw-r--r--tests/run-make/emit-named-files/Makefile2
-rw-r--r--tests/run-make/emit-path-unhashed/Makefile2
-rw-r--r--tests/run-make/emit-shared-files/Makefile2
-rw-r--r--tests/run-make/emit-stack-sizes/Makefile (renamed from tests/run-make-fulldeps/emit-stack-sizes/Makefile)0
-rw-r--r--tests/run-make/emit-stack-sizes/foo.rs (renamed from tests/run-make-fulldeps/emit-stack-sizes/foo.rs)0
-rw-r--r--tests/run-make/emit/Makefile (renamed from tests/run-make-fulldeps/emit/Makefile)1
-rw-r--r--tests/run-make/emit/test-24876.rs (renamed from tests/run-make-fulldeps/emit/test-24876.rs)0
-rw-r--r--tests/run-make/emit/test-26235.rs (renamed from tests/run-make-fulldeps/emit/test-26235.rs)0
-rw-r--r--tests/run-make/env-dep-info/Makefile2
-rw-r--r--tests/run-make/error-found-staticlib-instead-crate/Makefile (renamed from tests/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile)0
-rw-r--r--tests/run-make/error-found-staticlib-instead-crate/bar.rs (renamed from tests/run-make-fulldeps/error-found-staticlib-instead-crate/bar.rs)0
-rw-r--r--tests/run-make/error-found-staticlib-instead-crate/foo.rs (renamed from tests/run-make-fulldeps/error-found-staticlib-instead-crate/foo.rs)0
-rw-r--r--tests/run-make/error-writing-dependencies/Makefile (renamed from tests/run-make-fulldeps/error-writing-dependencies/Makefile)0
-rw-r--r--tests/run-make/error-writing-dependencies/foo.rs (renamed from tests/run-make-fulldeps/error-writing-dependencies/foo.rs)0
-rw-r--r--tests/run-make/exit-code/Makefile (renamed from tests/run-make-fulldeps/exit-code/Makefile)1
-rw-r--r--tests/run-make/exit-code/compile-error.rs (renamed from tests/run-make-fulldeps/exit-code/compile-error.rs)0
-rw-r--r--tests/run-make/exit-code/lint-failure.rs (renamed from tests/run-make-fulldeps/exit-code/lint-failure.rs)0
-rw-r--r--tests/run-make/exit-code/success.rs (renamed from tests/run-make-fulldeps/exit-code/success.rs)0
-rw-r--r--tests/run-make/export-executable-symbols/Makefile2
-rw-r--r--tests/run-make/extern-diff-internal-name/Makefile (renamed from tests/run-make-fulldeps/extern-diff-internal-name/Makefile)1
-rw-r--r--tests/run-make/extern-diff-internal-name/lib.rs (renamed from tests/run-make-fulldeps/extern-diff-internal-name/lib.rs)0
-rw-r--r--tests/run-make/extern-diff-internal-name/test.rs (renamed from tests/run-make-fulldeps/extern-diff-internal-name/test.rs)0
-rw-r--r--tests/run-make/extern-flag-disambiguates/Makefile (renamed from tests/run-make-fulldeps/extern-flag-disambiguates/Makefile)1
-rw-r--r--tests/run-make/extern-flag-disambiguates/a.rs (renamed from tests/run-make-fulldeps/extern-flag-disambiguates/a.rs)0
-rw-r--r--tests/run-make/extern-flag-disambiguates/b.rs (renamed from tests/run-make-fulldeps/extern-flag-disambiguates/b.rs)0
-rw-r--r--tests/run-make/extern-flag-disambiguates/c.rs (renamed from tests/run-make-fulldeps/extern-flag-disambiguates/c.rs)0
-rw-r--r--tests/run-make/extern-flag-disambiguates/d.rs (renamed from tests/run-make-fulldeps/extern-flag-disambiguates/d.rs)0
-rw-r--r--tests/run-make/extern-flag-fun/Makefile (renamed from tests/run-make-fulldeps/extern-flag-fun/Makefile)1
-rw-r--r--tests/run-make/extern-flag-fun/bar-alt.rs (renamed from tests/run-make-fulldeps/extern-flag-fun/bar-alt.rs)0
-rw-r--r--tests/run-make/extern-flag-fun/bar.rs (renamed from tests/run-make-fulldeps/extern-flag-fun/bar.rs)0
-rw-r--r--tests/run-make/extern-flag-fun/foo.rs (renamed from tests/run-make-fulldeps/extern-flag-fun/foo.rs)0
-rw-r--r--tests/run-make/extern-flag-fun/gated_unstable.rs (renamed from tests/run-make-fulldeps/extern-flag-fun/gated_unstable.rs)0
-rw-r--r--tests/run-make/extern-flag-fun/rustc.rs (renamed from tests/run-make-fulldeps/extern-flag-fun/rustc.rs)0
-rw-r--r--tests/run-make/extern-flag-pathless/Makefile (renamed from tests/run-make-fulldeps/extern-flag-pathless/Makefile)1
-rw-r--r--tests/run-make/extern-flag-pathless/bar-dynamic.rs (renamed from tests/run-make-fulldeps/extern-flag-pathless/bar-dynamic.rs)0
-rw-r--r--tests/run-make/extern-flag-pathless/bar-static.rs (renamed from tests/run-make-fulldeps/extern-flag-pathless/bar-static.rs)0
-rw-r--r--tests/run-make/extern-flag-pathless/foo.rs (renamed from tests/run-make-fulldeps/extern-flag-pathless/foo.rs)0
-rw-r--r--tests/run-make/extern-flag-rename-transitive/Makefile (renamed from tests/run-make-fulldeps/extern-flag-rename-transitive/Makefile)0
-rw-r--r--tests/run-make/extern-flag-rename-transitive/bar.rs (renamed from tests/run-make-fulldeps/extern-flag-rename-transitive/bar.rs)0
-rw-r--r--tests/run-make/extern-flag-rename-transitive/baz.rs (renamed from tests/run-make-fulldeps/extern-flag-rename-transitive/baz.rs)0
-rw-r--r--tests/run-make/extern-flag-rename-transitive/foo.rs (renamed from tests/run-make-fulldeps/extern-flag-rename-transitive/foo.rs)0
-rw-r--r--tests/run-make/extern-fn-generic/Makefile (renamed from tests/run-make-fulldeps/extern-fn-generic/Makefile)1
-rw-r--r--tests/run-make/extern-fn-generic/test.c (renamed from tests/run-make-fulldeps/extern-fn-generic/test.c)0
-rw-r--r--tests/run-make/extern-fn-generic/test.rs (renamed from tests/run-make-fulldeps/extern-fn-generic/test.rs)0
-rw-r--r--tests/run-make/extern-fn-generic/testcrate.rs (renamed from tests/run-make-fulldeps/extern-fn-generic/testcrate.rs)0
-rw-r--r--tests/run-make/extern-fn-mangle/Makefile (renamed from tests/run-make-fulldeps/extern-fn-mangle/Makefile)1
-rw-r--r--tests/run-make/extern-fn-mangle/test.c (renamed from tests/run-make-fulldeps/extern-fn-mangle/test.c)0
-rw-r--r--tests/run-make/extern-fn-mangle/test.rs (renamed from tests/run-make-fulldeps/extern-fn-mangle/test.rs)0
-rw-r--r--tests/run-make/extern-fn-reachable/Makefile (renamed from tests/run-make-fulldeps/extern-fn-reachable/Makefile)1
-rw-r--r--tests/run-make/extern-fn-reachable/dylib.rs (renamed from tests/run-make-fulldeps/extern-fn-reachable/dylib.rs)0
-rw-r--r--tests/run-make/extern-fn-struct-passing-abi/Makefile (renamed from tests/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile)1
-rw-r--r--tests/run-make/extern-fn-struct-passing-abi/test.c (renamed from tests/run-make-fulldeps/extern-fn-struct-passing-abi/test.c)0
-rw-r--r--tests/run-make/extern-fn-struct-passing-abi/test.rs (renamed from tests/run-make-fulldeps/extern-fn-struct-passing-abi/test.rs)0
-rw-r--r--tests/run-make/extern-fn-with-extern-types/Makefile (renamed from tests/run-make-fulldeps/extern-fn-with-extern-types/Makefile)1
-rw-r--r--tests/run-make/extern-fn-with-extern-types/ctest.c (renamed from tests/run-make-fulldeps/extern-fn-with-extern-types/ctest.c)0
-rw-r--r--tests/run-make/extern-fn-with-extern-types/test.rs (renamed from tests/run-make-fulldeps/extern-fn-with-extern-types/test.rs)0
-rw-r--r--tests/run-make/extern-fn-with-packed-struct/Makefile (renamed from tests/run-make-fulldeps/extern-fn-with-packed-struct/Makefile)1
-rw-r--r--tests/run-make/extern-fn-with-packed-struct/test.c (renamed from tests/run-make-fulldeps/extern-fn-with-packed-struct/test.c)0
-rw-r--r--tests/run-make/extern-fn-with-packed-struct/test.rs (renamed from tests/run-make-fulldeps/extern-fn-with-packed-struct/test.rs)0
-rw-r--r--tests/run-make/extern-fn-with-union/Makefile (renamed from tests/run-make-fulldeps/extern-fn-with-union/Makefile)1
-rw-r--r--tests/run-make/extern-fn-with-union/ctest.c (renamed from tests/run-make-fulldeps/extern-fn-with-union/ctest.c)0
-rw-r--r--tests/run-make/extern-fn-with-union/test.rs (renamed from tests/run-make-fulldeps/extern-fn-with-union/test.rs)0
-rw-r--r--tests/run-make/extern-fn-with-union/testcrate.rs (renamed from tests/run-make-fulldeps/extern-fn-with-union/testcrate.rs)0
-rw-r--r--tests/run-make/extern-multiple-copies/Makefile (renamed from tests/run-make-fulldeps/extern-multiple-copies/Makefile)1
-rw-r--r--tests/run-make/extern-multiple-copies/bar.rs (renamed from tests/run-make-fulldeps/extern-multiple-copies/bar.rs)0
-rw-r--r--tests/run-make/extern-multiple-copies/foo1.rs (renamed from tests/run-make-fulldeps/extern-multiple-copies/foo1.rs)0
-rw-r--r--tests/run-make/extern-multiple-copies/foo2.rs (renamed from tests/run-make-fulldeps/extern-multiple-copies/foo2.rs)0
-rw-r--r--tests/run-make/extern-multiple-copies2/Makefile (renamed from tests/run-make-fulldeps/extern-multiple-copies2/Makefile)1
-rw-r--r--tests/run-make/extern-multiple-copies2/bar.rs (renamed from tests/run-make-fulldeps/extern-multiple-copies2/bar.rs)0
-rw-r--r--tests/run-make/extern-multiple-copies2/foo1.rs (renamed from tests/run-make-fulldeps/extern-multiple-copies2/foo1.rs)0
-rw-r--r--tests/run-make/extern-multiple-copies2/foo2.rs (renamed from tests/run-make-fulldeps/extern-multiple-copies2/foo2.rs)0
-rw-r--r--tests/run-make/extern-overrides-distribution/Makefile (renamed from tests/run-make-fulldeps/extern-overrides-distribution/Makefile)1
-rw-r--r--tests/run-make/extern-overrides-distribution/libc.rs (renamed from tests/run-make-fulldeps/extern-overrides-distribution/libc.rs)0
-rw-r--r--tests/run-make/extern-overrides-distribution/main.rs (renamed from tests/run-make-fulldeps/extern-overrides-distribution/main.rs)0
-rw-r--r--tests/run-make/extra-filename-with-temp-outputs/Makefile (renamed from tests/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile)1
-rw-r--r--tests/run-make/extra-filename-with-temp-outputs/foo.rs (renamed from tests/run-make-fulldeps/extra-filename-with-temp-outputs/foo.rs)0
-rw-r--r--tests/run-make/fmt-write-bloat/Makefile6
-rw-r--r--tests/run-make/foreign-double-unwind/Makefile (renamed from tests/run-make-fulldeps/foreign-double-unwind/Makefile)1
-rw-r--r--tests/run-make/foreign-double-unwind/foo.cpp (renamed from tests/run-make-fulldeps/foreign-double-unwind/foo.cpp)0
-rw-r--r--tests/run-make/foreign-double-unwind/foo.rs (renamed from tests/run-make-fulldeps/foreign-double-unwind/foo.rs)0
-rw-r--r--tests/run-make/foreign-exceptions/Makefile (renamed from tests/run-make-fulldeps/foreign-exceptions/Makefile)1
-rw-r--r--tests/run-make/foreign-exceptions/foo.cpp (renamed from tests/run-make-fulldeps/foreign-exceptions/foo.cpp)0
-rw-r--r--tests/run-make/foreign-exceptions/foo.rs (renamed from tests/run-make-fulldeps/foreign-exceptions/foo.rs)0
-rw-r--r--tests/run-make/foreign-rust-exceptions/Makefile (renamed from tests/run-make-fulldeps/foreign-rust-exceptions/Makefile)1
-rw-r--r--tests/run-make/foreign-rust-exceptions/bar.rs (renamed from tests/run-make-fulldeps/foreign-rust-exceptions/bar.rs)0
-rw-r--r--tests/run-make/foreign-rust-exceptions/foo.rs (renamed from tests/run-make-fulldeps/foreign-rust-exceptions/foo.rs)0
-rw-r--r--tests/run-make/fpic/Makefile (renamed from tests/run-make-fulldeps/fpic/Makefile)1
-rw-r--r--tests/run-make/fpic/hello.rs (renamed from tests/run-make-fulldeps/fpic/hello.rs)0
-rw-r--r--tests/run-make/glibc-staticlib-args/Makefile (renamed from tests/run-make-fulldeps/glibc-staticlib-args/Makefile)1
-rw-r--r--tests/run-make/glibc-staticlib-args/library.rs (renamed from tests/run-make-fulldeps/glibc-staticlib-args/library.rs)0
-rw-r--r--tests/run-make/glibc-staticlib-args/program.c (renamed from tests/run-make-fulldeps/glibc-staticlib-args/program.c)0
-rw-r--r--tests/run-make/hir-tree/Makefile (renamed from tests/run-make-fulldeps/hir-tree/Makefile)0
-rw-r--r--tests/run-make/hir-tree/input.rs (renamed from tests/run-make-fulldeps/hir-tree/input.rs)0
-rw-r--r--tests/run-make/include_bytes_deps/Makefile (renamed from tests/run-make-fulldeps/include_bytes_deps/Makefile)0
-rw-r--r--tests/run-make/include_bytes_deps/input.bin (renamed from tests/run-make-fulldeps/include_bytes_deps/input.bin)0
-rw-r--r--tests/run-make/include_bytes_deps/input.md (renamed from tests/run-make-fulldeps/include_bytes_deps/input.md)0
-rw-r--r--tests/run-make/include_bytes_deps/input.txt (renamed from tests/run-make-fulldeps/include_bytes_deps/input.txt)0
-rw-r--r--tests/run-make/include_bytes_deps/main.rs (renamed from tests/run-make-fulldeps/include_bytes_deps/main.rs)0
-rw-r--r--tests/run-make/incr-add-rust-src-component/Makefile (renamed from tests/run-make-fulldeps/incr-add-rust-src-component/Makefile)1
-rw-r--r--tests/run-make/incr-add-rust-src-component/main.rs (renamed from tests/run-make-fulldeps/incr-add-rust-src-component/main.rs)0
-rw-r--r--tests/run-make/incr-foreign-head-span/Makefile2
-rw-r--r--tests/run-make/incr-prev-body-beyond-eof/Makefile2
-rw-r--r--tests/run-make/incremental-session-fail/Makefile2
-rw-r--r--tests/run-make/inline-always-many-cgu/Makefile (renamed from tests/run-make-fulldeps/inline-always-many-cgu/Makefile)0
-rw-r--r--tests/run-make/inline-always-many-cgu/foo.rs (renamed from tests/run-make-fulldeps/inline-always-many-cgu/foo.rs)0
-rw-r--r--tests/run-make/interdependent-c-libraries/Makefile (renamed from tests/run-make-fulldeps/interdependent-c-libraries/Makefile)1
-rw-r--r--tests/run-make/interdependent-c-libraries/bar.c (renamed from tests/run-make-fulldeps/interdependent-c-libraries/bar.c)0
-rw-r--r--tests/run-make/interdependent-c-libraries/bar.rs (renamed from tests/run-make-fulldeps/interdependent-c-libraries/bar.rs)0
-rw-r--r--tests/run-make/interdependent-c-libraries/foo.c (renamed from tests/run-make-fulldeps/interdependent-c-libraries/foo.c)0
-rw-r--r--tests/run-make/interdependent-c-libraries/foo.rs (renamed from tests/run-make-fulldeps/interdependent-c-libraries/foo.rs)0
-rw-r--r--tests/run-make/interdependent-c-libraries/main.rs (renamed from tests/run-make-fulldeps/interdependent-c-libraries/main.rs)0
-rw-r--r--tests/run-make/intrinsic-unreachable/Makefile (renamed from tests/run-make-fulldeps/intrinsic-unreachable/Makefile)0
-rw-r--r--tests/run-make/intrinsic-unreachable/exit-ret.rs (renamed from tests/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs)0
-rw-r--r--tests/run-make/intrinsic-unreachable/exit-unreachable.rs (renamed from tests/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs)0
-rw-r--r--tests/run-make/invalid-library/Makefile (renamed from tests/run-make-fulldeps/invalid-library/Makefile)0
-rw-r--r--tests/run-make/invalid-library/foo.rs (renamed from tests/run-make-fulldeps/invalid-library/foo.rs)0
-rw-r--r--tests/run-make/invalid-so/Makefile2
-rw-r--r--tests/run-make/invalid-staticlib/Makefile (renamed from tests/run-make-fulldeps/invalid-staticlib/Makefile)0
-rw-r--r--tests/run-make/issue-10971-temps-dir/Makefile2
-rw-r--r--tests/run-make/issue-109934-lto-debuginfo/Makefile12
-rw-r--r--tests/run-make/issue-109934-lto-debuginfo/lib.rs9
-rw-r--r--tests/run-make/issue-11908/Makefile (renamed from tests/run-make-fulldeps/issue-11908/Makefile)1
-rw-r--r--tests/run-make/issue-11908/bar.rs (renamed from tests/run-make-fulldeps/issue-11908/bar.rs)0
-rw-r--r--tests/run-make/issue-11908/foo.rs (renamed from tests/run-make-fulldeps/issue-11908/foo.rs)0
-rw-r--r--tests/run-make/issue-14500/Makefile (renamed from tests/run-make-fulldeps/issue-14500/Makefile)2
-rw-r--r--tests/run-make/issue-14500/bar.rs (renamed from tests/run-make-fulldeps/issue-14500/bar.rs)0
-rw-r--r--tests/run-make/issue-14500/foo.c (renamed from tests/run-make-fulldeps/issue-14500/foo.c)0
-rw-r--r--tests/run-make/issue-14500/foo.rs (renamed from tests/run-make-fulldeps/issue-14500/foo.rs)0
-rw-r--r--tests/run-make/issue-14698/Makefile (renamed from tests/run-make-fulldeps/issue-14698/Makefile)0
-rw-r--r--tests/run-make/issue-14698/foo.rs (renamed from tests/run-make-fulldeps/issue-14698/foo.rs)0
-rw-r--r--tests/run-make/issue-15460/Makefile (renamed from tests/run-make-fulldeps/issue-15460/Makefile)1
-rw-r--r--tests/run-make/issue-15460/bar.rs (renamed from tests/run-make-fulldeps/issue-15460/bar.rs)0
-rw-r--r--tests/run-make/issue-15460/foo.c (renamed from tests/run-make-fulldeps/issue-15460/foo.c)0
-rw-r--r--tests/run-make/issue-15460/foo.rs (renamed from tests/run-make-fulldeps/issue-15460/foo.rs)0
-rw-r--r--tests/run-make/issue-18943/Makefile (renamed from tests/run-make-fulldeps/issue-18943/Makefile)0
-rw-r--r--tests/run-make/issue-18943/foo.rs (renamed from tests/run-make-fulldeps/issue-18943/foo.rs)0
-rw-r--r--tests/run-make/issue-20626/Makefile (renamed from tests/run-make-fulldeps/issue-20626/Makefile)1
-rw-r--r--tests/run-make/issue-20626/foo.rs (renamed from tests/run-make-fulldeps/issue-20626/foo.rs)0
-rw-r--r--tests/run-make/issue-22131/Makefile (renamed from tests/run-make-fulldeps/issue-22131/Makefile)1
-rw-r--r--tests/run-make/issue-22131/foo.rs (renamed from tests/run-make-fulldeps/issue-22131/foo.rs)0
-rw-r--r--tests/run-make/issue-24445/Makefile (renamed from tests/run-make-fulldeps/issue-24445/Makefile)1
-rw-r--r--tests/run-make/issue-24445/foo.c (renamed from tests/run-make-fulldeps/issue-24445/foo.c)0
-rw-r--r--tests/run-make/issue-24445/foo.rs (renamed from tests/run-make-fulldeps/issue-24445/foo.rs)0
-rw-r--r--tests/run-make/issue-25581/Makefile6
-rw-r--r--tests/run-make/issue-25581/test.c (renamed from tests/run-make-fulldeps/issue-25581/test.c)0
-rw-r--r--tests/run-make/issue-25581/test.rs (renamed from tests/run-make-fulldeps/issue-25581/test.rs)0
-rw-r--r--tests/run-make/issue-26006/Makefile (renamed from tests/run-make-fulldeps/issue-26006/Makefile)1
-rw-r--r--tests/run-make/issue-26006/in/libc/lib.rs (renamed from tests/run-make-fulldeps/issue-26006/in/libc/lib.rs)0
-rw-r--r--tests/run-make/issue-26006/in/time/lib.rs (renamed from tests/run-make-fulldeps/issue-26006/in/time/lib.rs)0
-rw-r--r--tests/run-make/issue-26092/Makefile (renamed from tests/run-make-fulldeps/issue-26092/Makefile)0
-rw-r--r--tests/run-make/issue-26092/blank.rs (renamed from tests/run-make-fulldeps/issue-26092/blank.rs)0
-rw-r--r--tests/run-make/issue-28595/Makefile (renamed from tests/run-make-fulldeps/issue-28595/Makefile)1
-rw-r--r--tests/run-make/issue-28595/a.c (renamed from tests/run-make-fulldeps/issue-28595/a.c)0
-rw-r--r--tests/run-make/issue-28595/a.rs (renamed from tests/run-make-fulldeps/issue-28595/a.rs)0
-rw-r--r--tests/run-make/issue-28595/b.c (renamed from tests/run-make-fulldeps/issue-28595/b.c)0
-rw-r--r--tests/run-make/issue-28595/b.rs (renamed from tests/run-make-fulldeps/issue-28595/b.rs)0
-rw-r--r--tests/run-make/issue-28766/Makefile (renamed from tests/run-make-fulldeps/issue-28766/Makefile)0
-rw-r--r--tests/run-make/issue-28766/foo.rs (renamed from tests/run-make-fulldeps/issue-28766/foo.rs)0
-rw-r--r--tests/run-make/issue-28766/main.rs (renamed from tests/run-make-fulldeps/issue-28766/main.rs)0
-rw-r--r--tests/run-make/issue-30063/Makefile (renamed from tests/run-make-fulldeps/issue-30063/Makefile)1
-rw-r--r--tests/run-make/issue-30063/foo.rs (renamed from tests/run-make-fulldeps/issue-30063/foo.rs)0
-rw-r--r--tests/run-make/issue-33329/Makefile (renamed from tests/run-make-fulldeps/issue-33329/Makefile)0
-rw-r--r--tests/run-make/issue-33329/main.rs (renamed from tests/run-make-fulldeps/issue-33329/main.rs)0
-rw-r--r--tests/run-make/issue-35164/Makefile (renamed from tests/run-make-fulldeps/issue-35164/Makefile)0
-rw-r--r--tests/run-make/issue-35164/main.rs (renamed from tests/run-make-fulldeps/issue-35164/main.rs)0
-rw-r--r--tests/run-make/issue-35164/submodule/mod.rs (renamed from tests/run-make-fulldeps/issue-35164/submodule/mod.rs)0
-rw-r--r--tests/run-make/issue-36710/Makefile4
-rw-r--r--tests/run-make/issue-37839/Makefile (renamed from tests/run-make-fulldeps/issue-37839/Makefile)1
-rw-r--r--tests/run-make/issue-37839/a.rs (renamed from tests/run-make-fulldeps/issue-37839/a.rs)0
-rw-r--r--tests/run-make/issue-37839/b.rs (renamed from tests/run-make-fulldeps/issue-37839/b.rs)0
-rw-r--r--tests/run-make/issue-37839/c.rs (renamed from tests/run-make-fulldeps/issue-37839/c.rs)0
-rw-r--r--tests/run-make/issue-37893/Makefile (renamed from tests/run-make-fulldeps/issue-37893/Makefile)1
-rw-r--r--tests/run-make/issue-37893/a.rs (renamed from tests/run-make-fulldeps/issue-37893/a.rs)0
-rw-r--r--tests/run-make/issue-37893/b.rs (renamed from tests/run-make-fulldeps/issue-37893/b.rs)0
-rw-r--r--tests/run-make/issue-37893/c.rs (renamed from tests/run-make-fulldeps/issue-37893/c.rs)0
-rw-r--r--tests/run-make/issue-38237/Makefile (renamed from tests/run-make-fulldeps/issue-38237/Makefile)1
-rw-r--r--tests/run-make/issue-38237/bar.rs (renamed from tests/run-make-fulldeps/issue-38237/bar.rs)0
-rw-r--r--tests/run-make/issue-38237/baz.rs (renamed from tests/run-make-fulldeps/issue-38237/baz.rs)0
-rw-r--r--tests/run-make/issue-38237/foo.rs (renamed from tests/run-make-fulldeps/issue-38237/foo.rs)0
-rw-r--r--tests/run-make/issue-40535/Makefile (renamed from tests/run-make-fulldeps/issue-40535/Makefile)0
-rw-r--r--tests/run-make/issue-40535/bar.rs (renamed from tests/run-make-fulldeps/issue-40535/bar.rs)0
-rw-r--r--tests/run-make/issue-40535/baz.rs (renamed from tests/run-make-fulldeps/issue-40535/baz.rs)0
-rw-r--r--tests/run-make/issue-40535/foo.rs (renamed from tests/run-make-fulldeps/issue-40535/foo.rs)0
-rw-r--r--tests/run-make/issue-46239/Makefile (renamed from tests/run-make-fulldeps/issue-46239/Makefile)1
-rw-r--r--tests/run-make/issue-46239/main.rs (renamed from tests/run-make-fulldeps/issue-46239/main.rs)0
-rw-r--r--tests/run-make/issue-47384/Makefile2
-rw-r--r--tests/run-make/issue-47551/Makefile (renamed from tests/run-make-fulldeps/issue-47551/Makefile)0
-rw-r--r--tests/run-make/issue-47551/eh_frame-terminator.rs (renamed from tests/run-make-fulldeps/issue-47551/eh_frame-terminator.rs)0
-rw-r--r--tests/run-make/issue-51671/Makefile (renamed from tests/run-make-fulldeps/issue-51671/Makefile)0
-rw-r--r--tests/run-make/issue-51671/app.rs (renamed from tests/run-make-fulldeps/issue-51671/app.rs)0
-rw-r--r--tests/run-make/issue-53964/Makefile (renamed from tests/run-make-fulldeps/issue-53964/Makefile)0
-rw-r--r--tests/run-make/issue-53964/app.rs (renamed from tests/run-make-fulldeps/issue-53964/app.rs)0
-rw-r--r--tests/run-make/issue-53964/panic.rs (renamed from tests/run-make-fulldeps/issue-53964/panic.rs)0
-rw-r--r--tests/run-make/issue-64153/Makefile (renamed from tests/run-make-fulldeps/issue-64153/Makefile)0
-rw-r--r--tests/run-make/issue-64153/downstream.rs (renamed from tests/run-make-fulldeps/issue-64153/downstream.rs)0
-rw-r--r--tests/run-make/issue-64153/upstream.rs (renamed from tests/run-make-fulldeps/issue-64153/upstream.rs)0
-rw-r--r--tests/run-make/issue-68794-textrel-on-minimal-lib/Makefile (renamed from tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile)1
-rw-r--r--tests/run-make/issue-68794-textrel-on-minimal-lib/bar.c (renamed from tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/bar.c)0
-rw-r--r--tests/run-make/issue-68794-textrel-on-minimal-lib/foo.rs (renamed from tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/foo.rs)0
-rw-r--r--tests/run-make/issue-69368/Makefile (renamed from tests/run-make-fulldeps/issue-69368/Makefile)1
-rw-r--r--tests/run-make/issue-69368/a.rs (renamed from tests/run-make-fulldeps/issue-69368/a.rs)0
-rw-r--r--tests/run-make/issue-69368/b.rs (renamed from tests/run-make-fulldeps/issue-69368/b.rs)0
-rw-r--r--tests/run-make/issue-69368/c.rs (renamed from tests/run-make-fulldeps/issue-69368/c.rs)0
-rw-r--r--tests/run-make/issue-71519/Makefile2
-rw-r--r--tests/run-make/issue-7349/Makefile (renamed from tests/run-make-fulldeps/issue-7349/Makefile)0
-rw-r--r--tests/run-make/issue-7349/foo.rs (renamed from tests/run-make-fulldeps/issue-7349/foo.rs)0
-rw-r--r--tests/run-make/issue-83045/Makefile (renamed from tests/run-make-fulldeps/issue-83045/Makefile)4
-rw-r--r--tests/run-make/issue-83045/a.rs (renamed from tests/run-make-fulldeps/issue-83045/a.rs)0
-rw-r--r--tests/run-make/issue-83045/b.rs (renamed from tests/run-make-fulldeps/issue-83045/b.rs)0
-rw-r--r--tests/run-make/issue-83045/c.rs (renamed from tests/run-make-fulldeps/issue-83045/c.rs)0
-rw-r--r--tests/run-make/issue-83112-incr-test-moved-file/Makefile2
-rw-r--r--tests/run-make/issue-84395-lto-embed-bitcode/Makefile (renamed from tests/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile)2
-rw-r--r--tests/run-make/issue-84395-lto-embed-bitcode/test.rs (renamed from tests/run-make-fulldeps/issue-84395-lto-embed-bitcode/test.rs)0
-rw-r--r--tests/run-make/issue-85019-moved-src-dir/Makefile2
-rw-r--r--tests/run-make/issue-85401-static-mir/Makefile2
-rw-r--r--tests/run-make/issue-85441/Makefile2
-rw-r--r--tests/run-make/issue-88756-default-output/Makefile2
-rw-r--r--tests/run-make/issue-96498/Makefile2
-rw-r--r--tests/run-make/issue-97463-abi-param-passing/Makefile (renamed from tests/run-make-fulldeps/issue-97463-abi-param-passing/Makefile)3
-rw-r--r--tests/run-make/issue-97463-abi-param-passing/bad.c (renamed from tests/run-make-fulldeps/issue-97463-abi-param-passing/bad.c)0
-rw-r--r--tests/run-make/issue-97463-abi-param-passing/param_passing.rs (renamed from tests/run-make-fulldeps/issue-97463-abi-param-passing/param_passing.rs)0
-rw-r--r--tests/run-make/issue64319/Makefile (renamed from tests/run-make-fulldeps/issue64319/Makefile)3
-rw-r--r--tests/run-make/issue64319/bar.rs (renamed from tests/run-make-fulldeps/issue64319/bar.rs)0
-rw-r--r--tests/run-make/issue64319/foo.rs (renamed from tests/run-make-fulldeps/issue64319/foo.rs)0
-rw-r--r--tests/run-make/jobserver-error/Makefile9
-rw-r--r--tests/run-make/jobserver-error/jobserver.stderr4
-rw-r--r--tests/run-make/libs-through-symlinks/Makefile (renamed from tests/run-make-fulldeps/libs-through-symlinks/Makefile)1
-rw-r--r--tests/run-make/libs-through-symlinks/bar.rs (renamed from tests/run-make-fulldeps/libs-through-symlinks/bar.rs)0
-rw-r--r--tests/run-make/libs-through-symlinks/foo.rs (renamed from tests/run-make-fulldeps/libs-through-symlinks/foo.rs)0
-rw-r--r--tests/run-make/libtest-json/Makefile (renamed from tests/run-make-fulldeps/libtest-json/Makefile)1
-rw-r--r--tests/run-make/libtest-json/f.rs (renamed from tests/run-make-fulldeps/libtest-json/f.rs)0
-rw-r--r--tests/run-make/libtest-json/output-default.json (renamed from tests/run-make-fulldeps/libtest-json/output-default.json)0
-rw-r--r--tests/run-make/libtest-json/output-stdout-success.json (renamed from tests/run-make-fulldeps/libtest-json/output-stdout-success.json)0
-rwxr-xr-xtests/run-make/libtest-json/validate_json.py (renamed from tests/run-make-fulldeps/libtest-json/validate_json.py)0
-rw-r--r--tests/run-make/libtest-thread-limit/Makefile2
-rw-r--r--tests/run-make/libtest-thread-limit/test.rs2
-rw-r--r--tests/run-make/link-arg/Makefile (renamed from tests/run-make-fulldeps/link-arg/Makefile)0
-rw-r--r--tests/run-make/link-arg/empty.rs (renamed from tests/run-make-fulldeps/link-arg/empty.rs)0
-rw-r--r--tests/run-make/link-args-order/Makefile (renamed from tests/run-make-fulldeps/link-args-order/Makefile)0
-rw-r--r--tests/run-make/link-args-order/empty.rs (renamed from tests/run-make-fulldeps/link-args-order/empty.rs)0
-rw-r--r--tests/run-make/link-cfg/Makefile (renamed from tests/run-make-fulldeps/link-cfg/Makefile)1
-rw-r--r--tests/run-make/link-cfg/dep-with-staticlib.rs (renamed from tests/run-make-fulldeps/link-cfg/dep-with-staticlib.rs)0
-rw-r--r--tests/run-make/link-cfg/dep.rs (renamed from tests/run-make-fulldeps/link-cfg/dep.rs)0
-rw-r--r--tests/run-make/link-cfg/no-deps.rs (renamed from tests/run-make-fulldeps/link-cfg/no-deps.rs)0
-rw-r--r--tests/run-make/link-cfg/return1.c (renamed from tests/run-make-fulldeps/link-cfg/return1.c)0
-rw-r--r--tests/run-make/link-cfg/return2.c (renamed from tests/run-make-fulldeps/link-cfg/return2.c)0
-rw-r--r--tests/run-make/link-cfg/return3.c (renamed from tests/run-make-fulldeps/link-cfg/return3.c)0
-rw-r--r--tests/run-make/link-cfg/with-deps.rs (renamed from tests/run-make-fulldeps/link-cfg/with-deps.rs)0
-rw-r--r--tests/run-make/link-cfg/with-staticlib-deps.rs (renamed from tests/run-make-fulldeps/link-cfg/with-staticlib-deps.rs)0
-rw-r--r--tests/run-make/link-dedup/Makefile (renamed from tests/run-make-fulldeps/link-dedup/Makefile)0
-rw-r--r--tests/run-make/link-dedup/depa.rs (renamed from tests/run-make-fulldeps/link-dedup/depa.rs)0
-rw-r--r--tests/run-make/link-dedup/depb.rs (renamed from tests/run-make-fulldeps/link-dedup/depb.rs)0
-rw-r--r--tests/run-make/link-dedup/depc.rs (renamed from tests/run-make-fulldeps/link-dedup/depc.rs)0
-rw-r--r--tests/run-make/link-dedup/empty.rs (renamed from tests/run-make-fulldeps/link-dedup/empty.rs)0
-rw-r--r--tests/run-make/link-path-order/Makefile (renamed from tests/run-make-fulldeps/link-path-order/Makefile)1
-rw-r--r--tests/run-make/link-path-order/correct.c (renamed from tests/run-make-fulldeps/link-path-order/correct.c)0
-rw-r--r--tests/run-make/link-path-order/main.rs (renamed from tests/run-make-fulldeps/link-path-order/main.rs)0
-rw-r--r--tests/run-make/link-path-order/wrong.c (renamed from tests/run-make-fulldeps/link-path-order/wrong.c)0
-rw-r--r--tests/run-make/linkage-attr-on-static/Makefile (renamed from tests/run-make-fulldeps/linkage-attr-on-static/Makefile)1
-rw-r--r--tests/run-make/linkage-attr-on-static/bar.rs (renamed from tests/run-make-fulldeps/linkage-attr-on-static/bar.rs)0
-rw-r--r--tests/run-make/linkage-attr-on-static/foo.c (renamed from tests/run-make-fulldeps/linkage-attr-on-static/foo.c)0
-rw-r--r--tests/run-make/llvm-outputs/Makefile2
-rw-r--r--tests/run-make/long-linker-command-lines-cmd-exe/Makefile (renamed from tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile)1
-rw-r--r--tests/run-make/long-linker-command-lines-cmd-exe/foo.bat (renamed from tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/foo.bat)0
-rw-r--r--tests/run-make/long-linker-command-lines-cmd-exe/foo.rs (renamed from tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/foo.rs)0
-rw-r--r--tests/run-make/long-linker-command-lines/Makefile (renamed from tests/run-make-fulldeps/long-linker-command-lines/Makefile)1
-rw-r--r--tests/run-make/long-linker-command-lines/foo.rs (renamed from tests/run-make-fulldeps/long-linker-command-lines/foo.rs)0
-rw-r--r--tests/run-make/longjmp-across-rust/Makefile (renamed from tests/run-make-fulldeps/longjmp-across-rust/Makefile)1
-rw-r--r--tests/run-make/longjmp-across-rust/foo.c (renamed from tests/run-make-fulldeps/longjmp-across-rust/foo.c)0
-rw-r--r--tests/run-make/longjmp-across-rust/main.rs (renamed from tests/run-make-fulldeps/longjmp-across-rust/main.rs)0
-rw-r--r--tests/run-make/ls-metadata/Makefile (renamed from tests/run-make-fulldeps/ls-metadata/Makefile)1
-rw-r--r--tests/run-make/ls-metadata/foo.rs (renamed from tests/run-make-fulldeps/ls-metadata/foo.rs)0
-rw-r--r--tests/run-make/lto-dylib-dep/Makefile (renamed from tests/run-make-fulldeps/lto-dylib-dep/Makefile)1
-rw-r--r--tests/run-make/lto-dylib-dep/a_dylib.rs (renamed from tests/run-make-fulldeps/lto-dylib-dep/a_dylib.rs)0
-rw-r--r--tests/run-make/lto-dylib-dep/main.rs (renamed from tests/run-make-fulldeps/lto-dylib-dep/main.rs)0
-rw-r--r--tests/run-make/lto-empty/Makefile (renamed from tests/run-make-fulldeps/lto-empty/Makefile)1
-rw-r--r--tests/run-make/lto-empty/lib.rs (renamed from tests/run-make-fulldeps/lto-empty/lib.rs)0
-rw-r--r--tests/run-make/lto-no-link-whole-rlib/Makefile (renamed from tests/run-make-fulldeps/lto-no-link-whole-rlib/Makefile)1
-rw-r--r--tests/run-make/lto-no-link-whole-rlib/bar.c (renamed from tests/run-make-fulldeps/lto-no-link-whole-rlib/bar.c)0
-rw-r--r--tests/run-make/lto-no-link-whole-rlib/foo.c (renamed from tests/run-make-fulldeps/lto-no-link-whole-rlib/foo.c)0
-rw-r--r--tests/run-make/lto-no-link-whole-rlib/lib1.rs (renamed from tests/run-make-fulldeps/lto-no-link-whole-rlib/lib1.rs)0
-rw-r--r--tests/run-make/lto-no-link-whole-rlib/lib2.rs (renamed from tests/run-make-fulldeps/lto-no-link-whole-rlib/lib2.rs)0
-rw-r--r--tests/run-make/lto-no-link-whole-rlib/main.rs (renamed from tests/run-make-fulldeps/lto-no-link-whole-rlib/main.rs)0
-rw-r--r--tests/run-make/lto-readonly-lib/Makefile (renamed from tests/run-make-fulldeps/lto-readonly-lib/Makefile)1
-rw-r--r--tests/run-make/lto-readonly-lib/lib.rs (renamed from tests/run-make-fulldeps/lto-readonly-lib/lib.rs)0
-rw-r--r--tests/run-make/lto-readonly-lib/main.rs (renamed from tests/run-make-fulldeps/lto-readonly-lib/main.rs)0
-rw-r--r--tests/run-make/lto-smoke-c/Makefile (renamed from tests/run-make-fulldeps/lto-smoke-c/Makefile)1
-rw-r--r--tests/run-make/lto-smoke-c/bar.c (renamed from tests/run-make-fulldeps/lto-smoke-c/bar.c)0
-rw-r--r--tests/run-make/lto-smoke-c/foo.rs (renamed from tests/run-make-fulldeps/lto-smoke-c/foo.rs)0
-rw-r--r--tests/run-make/lto-smoke/Makefile (renamed from tests/run-make-fulldeps/lto-smoke/Makefile)1
-rw-r--r--tests/run-make/lto-smoke/lib.rs (renamed from tests/run-make-fulldeps/lto-smoke/lib.rs)0
-rw-r--r--tests/run-make/lto-smoke/main.rs (renamed from tests/run-make-fulldeps/lto-smoke/main.rs)0
-rw-r--r--tests/run-make/macos-deployment-target/Makefile2
-rw-r--r--tests/run-make/macos-fat-archive/Makefile2
-rw-r--r--tests/run-make/manual-crate-name/Makefile (renamed from tests/run-make-fulldeps/manual-crate-name/Makefile)0
-rw-r--r--tests/run-make/manual-crate-name/bar.rs (renamed from tests/run-make-fulldeps/manual-crate-name/bar.rs)0
-rw-r--r--tests/run-make/manual-link/Makefile (renamed from tests/run-make-fulldeps/manual-link/Makefile)1
-rw-r--r--tests/run-make/manual-link/bar.c (renamed from tests/run-make-fulldeps/manual-link/bar.c)0
-rw-r--r--tests/run-make/manual-link/foo.c (renamed from tests/run-make-fulldeps/manual-link/foo.c)0
-rw-r--r--tests/run-make/manual-link/foo.rs (renamed from tests/run-make-fulldeps/manual-link/foo.rs)0
-rw-r--r--tests/run-make/manual-link/main.rs (renamed from tests/run-make-fulldeps/manual-link/main.rs)0
-rw-r--r--tests/run-make/many-crates-but-no-match/Makefile (renamed from tests/run-make-fulldeps/many-crates-but-no-match/Makefile)0
-rw-r--r--tests/run-make/many-crates-but-no-match/crateA1.rs (renamed from tests/run-make-fulldeps/many-crates-but-no-match/crateA1.rs)0
-rw-r--r--tests/run-make/many-crates-but-no-match/crateA2.rs (renamed from tests/run-make-fulldeps/many-crates-but-no-match/crateA2.rs)0
-rw-r--r--tests/run-make/many-crates-but-no-match/crateA3.rs (renamed from tests/run-make-fulldeps/many-crates-but-no-match/crateA3.rs)0
-rw-r--r--tests/run-make/many-crates-but-no-match/crateB.rs (renamed from tests/run-make-fulldeps/many-crates-but-no-match/crateB.rs)0
-rw-r--r--tests/run-make/many-crates-but-no-match/crateC.rs (renamed from tests/run-make-fulldeps/many-crates-but-no-match/crateC.rs)0
-rw-r--r--tests/run-make/metadata-flag-frobs-symbols/Makefile (renamed from tests/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile)1
-rw-r--r--tests/run-make/metadata-flag-frobs-symbols/bar.rs (renamed from tests/run-make-fulldeps/metadata-flag-frobs-symbols/bar.rs)0
-rw-r--r--tests/run-make/metadata-flag-frobs-symbols/foo.rs (renamed from tests/run-make-fulldeps/metadata-flag-frobs-symbols/foo.rs)0
-rw-r--r--tests/run-make/min-global-align/Makefile (renamed from tests/run-make-fulldeps/min-global-align/Makefile)0
-rw-r--r--tests/run-make/min-global-align/min_global_align.rs (renamed from tests/run-make-fulldeps/min-global-align/min_global_align.rs)0
-rw-r--r--tests/run-make/mingw-export-call-convention/Makefile (renamed from tests/run-make-fulldeps/mingw-export-call-convention/Makefile)0
-rw-r--r--tests/run-make/mingw-export-call-convention/foo.rs (renamed from tests/run-make-fulldeps/mingw-export-call-convention/foo.rs)0
-rw-r--r--tests/run-make/mismatching-target-triples/Makefile (renamed from tests/run-make-fulldeps/mismatching-target-triples/Makefile)0
-rw-r--r--tests/run-make/mismatching-target-triples/bar.rs (renamed from tests/run-make-fulldeps/mismatching-target-triples/bar.rs)0
-rw-r--r--tests/run-make/mismatching-target-triples/foo.rs (renamed from tests/run-make-fulldeps/mismatching-target-triples/foo.rs)0
-rw-r--r--tests/run-make/missing-crate-dependency/Makefile (renamed from tests/run-make-fulldeps/missing-crate-dependency/Makefile)0
-rw-r--r--tests/run-make/missing-crate-dependency/crateA.rs (renamed from tests/run-make-fulldeps/missing-crate-dependency/crateA.rs)0
-rw-r--r--tests/run-make/missing-crate-dependency/crateB.rs (renamed from tests/run-make-fulldeps/missing-crate-dependency/crateB.rs)0
-rw-r--r--tests/run-make/missing-crate-dependency/crateC.rs (renamed from tests/run-make-fulldeps/missing-crate-dependency/crateC.rs)0
-rw-r--r--tests/run-make/mixing-deps/Makefile (renamed from tests/run-make-fulldeps/mixing-deps/Makefile)1
-rw-r--r--tests/run-make/mixing-deps/both.rs (renamed from tests/run-make-fulldeps/mixing-deps/both.rs)0
-rw-r--r--tests/run-make/mixing-deps/dylib.rs (renamed from tests/run-make-fulldeps/mixing-deps/dylib.rs)0
-rw-r--r--tests/run-make/mixing-deps/prog.rs (renamed from tests/run-make-fulldeps/mixing-deps/prog.rs)0
-rw-r--r--tests/run-make/mixing-formats/Makefile (renamed from tests/run-make-fulldeps/mixing-formats/Makefile)1
-rw-r--r--tests/run-make/mixing-formats/bar1.rs (renamed from tests/run-make-fulldeps/mixing-formats/bar1.rs)0
-rw-r--r--tests/run-make/mixing-formats/bar2.rs (renamed from tests/run-make-fulldeps/mixing-formats/bar2.rs)0
-rw-r--r--tests/run-make/mixing-formats/baz.rs (renamed from tests/run-make-fulldeps/mixing-formats/baz.rs)0
-rw-r--r--tests/run-make/mixing-formats/baz2.rs (renamed from tests/run-make-fulldeps/mixing-formats/baz2.rs)0
-rw-r--r--tests/run-make/mixing-formats/foo.rs (renamed from tests/run-make-fulldeps/mixing-formats/foo.rs)0
-rw-r--r--tests/run-make/mixing-libs/Makefile (renamed from tests/run-make-fulldeps/mixing-libs/Makefile)1
-rw-r--r--tests/run-make/mixing-libs/dylib.rs (renamed from tests/run-make-fulldeps/mixing-libs/dylib.rs)0
-rw-r--r--tests/run-make/mixing-libs/prog.rs (renamed from tests/run-make-fulldeps/mixing-libs/prog.rs)0
-rw-r--r--tests/run-make/mixing-libs/rlib.rs (renamed from tests/run-make-fulldeps/mixing-libs/rlib.rs)0
-rw-r--r--tests/run-make/msvc-opt-minsize/Makefile (renamed from tests/run-make-fulldeps/msvc-opt-minsize/Makefile)1
-rw-r--r--tests/run-make/msvc-opt-minsize/foo.rs (renamed from tests/run-make-fulldeps/msvc-opt-minsize/foo.rs)0
-rw-r--r--tests/run-make/multiple-emits/Makefile (renamed from tests/run-make-fulldeps/multiple-emits/Makefile)0
-rw-r--r--tests/run-make/multiple-emits/foo.rs (renamed from tests/run-make-fulldeps/multiple-emits/foo.rs)0
-rw-r--r--tests/run-make/native-link-modifier-bundle/Makefile2
-rw-r--r--tests/run-make/native-link-modifier-verbatim-linker/Makefile2
-rw-r--r--tests/run-make/native-link-modifier-verbatim-rustc/Makefile2
-rw-r--r--tests/run-make/native-link-modifier-whole-archive/Makefile2
-rw-r--r--tests/run-make/no-builtins-lto/Makefile (renamed from tests/run-make-fulldeps/no-builtins-lto/Makefile)0
-rw-r--r--tests/run-make/no-builtins-lto/main.rs (renamed from tests/run-make-fulldeps/no-builtins-lto/main.rs)0
-rw-r--r--tests/run-make/no-builtins-lto/no_builtins.rs (renamed from tests/run-make-fulldeps/no-builtins-lto/no_builtins.rs)0
-rw-r--r--tests/run-make/no-duplicate-libs/Makefile (renamed from tests/run-make-fulldeps/no-duplicate-libs/Makefile)1
-rw-r--r--tests/run-make/no-duplicate-libs/bar.c (renamed from tests/run-make-fulldeps/no-duplicate-libs/bar.c)0
-rw-r--r--tests/run-make/no-duplicate-libs/foo.c (renamed from tests/run-make-fulldeps/no-duplicate-libs/foo.c)0
-rw-r--r--tests/run-make/no-duplicate-libs/main.rs (renamed from tests/run-make-fulldeps/no-duplicate-libs/main.rs)0
-rw-r--r--tests/run-make/no-input-file/Makefile2
-rw-r--r--tests/run-make/no-intermediate-extras/Makefile (renamed from tests/run-make-fulldeps/no-intermediate-extras/Makefile)1
-rw-r--r--tests/run-make/no-intermediate-extras/foo.rs (renamed from tests/run-make-fulldeps/no-intermediate-extras/foo.rs)0
-rw-r--r--tests/run-make/obey-crate-type-flag/Makefile (renamed from tests/run-make-fulldeps/obey-crate-type-flag/Makefile)1
-rw-r--r--tests/run-make/obey-crate-type-flag/test.rs (renamed from tests/run-make-fulldeps/obey-crate-type-flag/test.rs)0
-rw-r--r--tests/run-make/output-filename-conflicts-with-directory/Makefile (renamed from tests/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile)0
-rw-r--r--tests/run-make/output-filename-conflicts-with-directory/foo.rs (renamed from tests/run-make-fulldeps/output-filename-conflicts-with-directory/foo.rs)0
-rw-r--r--tests/run-make/output-filename-overwrites-input/Makefile (renamed from tests/run-make-fulldeps/output-filename-overwrites-input/Makefile)1
-rw-r--r--tests/run-make/output-filename-overwrites-input/bar.rs (renamed from tests/run-make-fulldeps/output-filename-overwrites-input/bar.rs)0
-rw-r--r--tests/run-make/output-filename-overwrites-input/foo.rs (renamed from tests/run-make-fulldeps/output-filename-overwrites-input/foo.rs)0
-rw-r--r--tests/run-make/output-type-permutations/Makefile (renamed from tests/run-make-fulldeps/output-type-permutations/Makefile)1
-rw-r--r--tests/run-make/output-type-permutations/foo.rs (renamed from tests/run-make-fulldeps/output-type-permutations/foo.rs)0
-rw-r--r--tests/run-make/output-with-hyphens/Makefile (renamed from tests/run-make-fulldeps/output-with-hyphens/Makefile)1
-rw-r--r--tests/run-make/output-with-hyphens/foo-bar.rs (renamed from tests/run-make-fulldeps/output-with-hyphens/foo-bar.rs)0
-rw-r--r--tests/run-make/override-aliased-flags/Makefile (renamed from tests/run-make-fulldeps/override-aliased-flags/Makefile)1
-rw-r--r--tests/run-make/override-aliased-flags/main.rs (renamed from tests/run-make-fulldeps/override-aliased-flags/main.rs)0
-rw-r--r--tests/run-make/overwrite-input/Makefile2
-rw-r--r--tests/run-make/panic-impl-transitive/Makefile (renamed from tests/run-make-fulldeps/panic-impl-transitive/Makefile)2
-rw-r--r--tests/run-make/panic-impl-transitive/panic-impl-consumer.rs (renamed from tests/run-make-fulldeps/panic-impl-transitive/panic-impl-consumer.rs)0
-rw-r--r--tests/run-make/panic-impl-transitive/panic-impl-provider.rs (renamed from tests/run-make-fulldeps/panic-impl-transitive/panic-impl-provider.rs)0
-rw-r--r--tests/run-make/pass-linker-flags-from-dep/Makefile2
-rw-r--r--tests/run-make/pass-linker-flags/Makefile2
-rw-r--r--tests/run-make/pass-non-c-like-enum-to-c/Makefile (renamed from tests/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile)1
-rw-r--r--tests/run-make/pass-non-c-like-enum-to-c/nonclike.rs (renamed from tests/run-make-fulldeps/pass-non-c-like-enum-to-c/nonclike.rs)0
-rw-r--r--tests/run-make/pass-non-c-like-enum-to-c/test.c (renamed from tests/run-make-fulldeps/pass-non-c-like-enum-to-c/test.c)0
-rw-r--r--tests/run-make/pgo-branch-weights/Makefile (renamed from tests/run-make-fulldeps/pgo-branch-weights/Makefile)0
-rw-r--r--tests/run-make/pgo-branch-weights/filecheck-patterns.txt (renamed from tests/run-make-fulldeps/pgo-branch-weights/filecheck-patterns.txt)0
-rw-r--r--tests/run-make/pgo-branch-weights/interesting.rs (renamed from tests/run-make-fulldeps/pgo-branch-weights/interesting.rs)0
-rw-r--r--tests/run-make/pgo-branch-weights/main.rs (renamed from tests/run-make-fulldeps/pgo-branch-weights/main.rs)0
-rw-r--r--tests/run-make/pgo-branch-weights/opaque.rs (renamed from tests/run-make-fulldeps/pgo-branch-weights/opaque.rs)0
-rw-r--r--tests/run-make/pgo-gen-lto/Makefile (renamed from tests/run-make-fulldeps/pgo-gen-lto/Makefile)0
-rw-r--r--tests/run-make/pgo-gen-lto/test.rs (renamed from tests/run-make-fulldeps/pgo-gen-lto/test.rs)0
-rw-r--r--tests/run-make/pgo-gen-no-imp-symbols/Makefile (renamed from tests/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile)0
-rw-r--r--tests/run-make/pgo-gen-no-imp-symbols/test.rs (renamed from tests/run-make-fulldeps/pgo-gen-no-imp-symbols/test.rs)0
-rw-r--r--tests/run-make/pgo-gen/Makefile (renamed from tests/run-make-fulldeps/pgo-gen/Makefile)0
-rw-r--r--tests/run-make/pgo-gen/test.rs (renamed from tests/run-make-fulldeps/pgo-gen/test.rs)0
-rw-r--r--tests/run-make/pgo-indirect-call-promotion/Makefile (renamed from tests/run-make-fulldeps/pgo-indirect-call-promotion/Makefile)0
-rw-r--r--tests/run-make/pgo-indirect-call-promotion/filecheck-patterns.txt (renamed from tests/run-make-fulldeps/pgo-indirect-call-promotion/filecheck-patterns.txt)0
-rw-r--r--tests/run-make/pgo-indirect-call-promotion/interesting.rs (renamed from tests/run-make-fulldeps/pgo-indirect-call-promotion/interesting.rs)0
-rw-r--r--tests/run-make/pgo-indirect-call-promotion/main.rs (renamed from tests/run-make-fulldeps/pgo-indirect-call-promotion/main.rs)0
-rw-r--r--tests/run-make/pgo-indirect-call-promotion/opaque.rs (renamed from tests/run-make-fulldeps/pgo-indirect-call-promotion/opaque.rs)0
-rw-r--r--tests/run-make/pgo-use/Makefile (renamed from tests/run-make-fulldeps/pgo-use/Makefile)0
-rw-r--r--tests/run-make/pgo-use/filecheck-patterns.txt (renamed from tests/run-make-fulldeps/pgo-use/filecheck-patterns.txt)0
-rw-r--r--tests/run-make/pgo-use/main.rs (renamed from tests/run-make-fulldeps/pgo-use/main.rs)0
-rw-r--r--tests/run-make/pointer-auth-link-with-c/Makefile (renamed from tests/run-make-fulldeps/pointer-auth-link-with-c/Makefile)0
-rw-r--r--tests/run-make/pointer-auth-link-with-c/test.c (renamed from tests/run-make-fulldeps/pointer-auth-link-with-c/test.c)0
-rw-r--r--tests/run-make/pointer-auth-link-with-c/test.rs (renamed from tests/run-make-fulldeps/pointer-auth-link-with-c/test.rs)0
-rw-r--r--tests/run-make/prefer-dylib/Makefile (renamed from tests/run-make-fulldeps/prefer-dylib/Makefile)1
-rw-r--r--tests/run-make/prefer-dylib/bar.rs (renamed from tests/run-make-fulldeps/prefer-dylib/bar.rs)0
-rw-r--r--tests/run-make/prefer-dylib/foo.rs (renamed from tests/run-make-fulldeps/prefer-dylib/foo.rs)0
-rw-r--r--tests/run-make/prefer-rlib/Makefile (renamed from tests/run-make-fulldeps/prefer-rlib/Makefile)1
-rw-r--r--tests/run-make/prefer-rlib/bar.rs (renamed from tests/run-make-fulldeps/prefer-rlib/bar.rs)0
-rw-r--r--tests/run-make/prefer-rlib/foo.rs (renamed from tests/run-make-fulldeps/prefer-rlib/foo.rs)0
-rw-r--r--tests/run-make/pretty-print-to-file/Makefile (renamed from tests/run-make-fulldeps/pretty-print-to-file/Makefile)0
-rw-r--r--tests/run-make/pretty-print-to-file/input.pp (renamed from tests/run-make-fulldeps/pretty-print-to-file/input.pp)0
-rw-r--r--tests/run-make/pretty-print-to-file/input.rs (renamed from tests/run-make-fulldeps/pretty-print-to-file/input.rs)0
-rw-r--r--tests/run-make/print-calling-conventions/Makefile (renamed from tests/run-make-fulldeps/print-calling-conventions/Makefile)2
-rw-r--r--tests/run-make/print-cfg/Makefile (renamed from tests/run-make-fulldeps/print-cfg/Makefile)0
-rw-r--r--tests/run-make/print-target-list/Makefile (renamed from tests/run-make-fulldeps/print-target-list/Makefile)0
-rw-r--r--tests/run-make/profile/Makefile (renamed from tests/run-make-fulldeps/profile/Makefile)0
-rw-r--r--tests/run-make/profile/test.rs (renamed from tests/run-make-fulldeps/profile/test.rs)0
-rw-r--r--tests/run-make/prune-link-args/Makefile (renamed from tests/run-make-fulldeps/prune-link-args/Makefile)1
-rw-r--r--tests/run-make/prune-link-args/empty.rs (renamed from tests/run-make-fulldeps/prune-link-args/empty.rs)0
-rw-r--r--tests/run-make/raw-dylib-alt-calling-convention/Makefile2
-rw-r--r--tests/run-make/raw-dylib-c/Makefile2
-rw-r--r--tests/run-make/raw-dylib-cross-compilation/Makefile22
-rw-r--r--tests/run-make/raw-dylib-cross-compilation/lib.rs20
-rw-r--r--tests/run-make/raw-dylib-import-name-type/Makefile2
-rw-r--r--tests/run-make/raw-dylib-inline-cross-dylib/Makefile2
-rw-r--r--tests/run-make/raw-dylib-link-ordinal/Makefile2
-rw-r--r--tests/run-make/raw-dylib-stdcall-ordinal/Makefile2
-rw-r--r--tests/run-make/redundant-libs/Makefile (renamed from tests/run-make-fulldeps/redundant-libs/Makefile)1
-rw-r--r--tests/run-make/redundant-libs/bar.c (renamed from tests/run-make-fulldeps/redundant-libs/bar.c)0
-rw-r--r--tests/run-make/redundant-libs/baz.c (renamed from tests/run-make-fulldeps/redundant-libs/baz.c)0
-rw-r--r--tests/run-make/redundant-libs/foo.c (renamed from tests/run-make-fulldeps/redundant-libs/foo.c)0
-rw-r--r--tests/run-make/redundant-libs/main.rs (renamed from tests/run-make-fulldeps/redundant-libs/main.rs)0
-rw-r--r--tests/run-make/relocation-model/Makefile (renamed from tests/run-make-fulldeps/relocation-model/Makefile)1
-rw-r--r--tests/run-make/relocation-model/foo.rs (renamed from tests/run-make-fulldeps/relocation-model/foo.rs)0
-rw-r--r--tests/run-make/relro-levels/Makefile (renamed from tests/run-make-fulldeps/relro-levels/Makefile)1
-rw-r--r--tests/run-make/relro-levels/hello.rs (renamed from tests/run-make-fulldeps/relro-levels/hello.rs)0
-rw-r--r--tests/run-make/remap-path-prefix-dwarf/Makefile2
-rw-r--r--tests/run-make/remap-path-prefix/Makefile (renamed from tests/run-make-fulldeps/remap-path-prefix/Makefile)0
-rw-r--r--tests/run-make/remap-path-prefix/auxiliary/lib.rs (renamed from tests/run-make-fulldeps/remap-path-prefix/auxiliary/lib.rs)0
-rw-r--r--tests/run-make/repr128-dwarf/Makefile2
-rw-r--r--tests/run-make/reproducible-build-2/Makefile (renamed from tests/run-make-fulldeps/reproducible-build-2/Makefile)1
-rw-r--r--tests/run-make/reproducible-build-2/linker.rs (renamed from tests/run-make-fulldeps/reproducible-build-2/linker.rs)0
-rw-r--r--tests/run-make/reproducible-build-2/reproducible-build-aux.rs (renamed from tests/run-make-fulldeps/reproducible-build-2/reproducible-build-aux.rs)0
-rw-r--r--tests/run-make/reproducible-build-2/reproducible-build.rs (renamed from tests/run-make-fulldeps/reproducible-build-2/reproducible-build.rs)0
-rw-r--r--tests/run-make/reproducible-build/Makefile (renamed from tests/run-make-fulldeps/reproducible-build/Makefile)1
-rw-r--r--tests/run-make/reproducible-build/linker.rs (renamed from tests/run-make-fulldeps/reproducible-build/linker.rs)0
-rw-r--r--tests/run-make/reproducible-build/reproducible-build-aux.rs (renamed from tests/run-make-fulldeps/reproducible-build/reproducible-build-aux.rs)0
-rw-r--r--tests/run-make/reproducible-build/reproducible-build.rs (renamed from tests/run-make-fulldeps/reproducible-build/reproducible-build.rs)0
-rw-r--r--tests/run-make/resolve-rename/Makefile (renamed from tests/run-make-fulldeps/resolve-rename/Makefile)0
-rw-r--r--tests/run-make/resolve-rename/bar.rs (renamed from tests/run-make-fulldeps/resolve-rename/bar.rs)0
-rw-r--r--tests/run-make/resolve-rename/baz.rs (renamed from tests/run-make-fulldeps/resolve-rename/baz.rs)0
-rw-r--r--tests/run-make/resolve-rename/foo.rs (renamed from tests/run-make-fulldeps/resolve-rename/foo.rs)0
-rw-r--r--tests/run-make/return-non-c-like-enum-from-c/Makefile (renamed from tests/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile)1
-rw-r--r--tests/run-make/return-non-c-like-enum-from-c/nonclike.rs (renamed from tests/run-make-fulldeps/return-non-c-like-enum-from-c/nonclike.rs)0
-rw-r--r--tests/run-make/return-non-c-like-enum-from-c/test.c (renamed from tests/run-make-fulldeps/return-non-c-like-enum-from-c/test.c)0
-rw-r--r--tests/run-make/return-non-c-like-enum/Makefile (renamed from tests/run-make-fulldeps/arguments-non-c-like-enum/Makefile)1
-rw-r--r--tests/run-make/return-non-c-like-enum/nonclike.rs (renamed from tests/run-make-fulldeps/return-non-c-like-enum/nonclike.rs)0
-rw-r--r--tests/run-make/return-non-c-like-enum/test.c (renamed from tests/run-make-fulldeps/return-non-c-like-enum/test.c)0
-rw-r--r--tests/run-make/rlib-chain/Makefile (renamed from tests/run-make-fulldeps/rlib-chain/Makefile)1
-rw-r--r--tests/run-make/rlib-chain/m1.rs (renamed from tests/run-make-fulldeps/rlib-chain/m1.rs)0
-rw-r--r--tests/run-make/rlib-chain/m2.rs (renamed from tests/run-make-fulldeps/rlib-chain/m2.rs)0
-rw-r--r--tests/run-make/rlib-chain/m3.rs (renamed from tests/run-make-fulldeps/rlib-chain/m3.rs)0
-rw-r--r--tests/run-make/rlib-chain/m4.rs (renamed from tests/run-make-fulldeps/rlib-chain/m4.rs)0
-rw-r--r--tests/run-make/rlib-format-packed-bundled-libs-2/Makefile2
-rw-r--r--tests/run-make/rlib-format-packed-bundled-libs-3/Makefile2
-rw-r--r--tests/run-make/rlib-format-packed-bundled-libs/Makefile2
-rw-r--r--tests/run-make/rustc-macro-dep-files/Makefile2
-rw-r--r--tests/run-make/rustdoc-determinism/Makefile (renamed from tests/run-make-fulldeps/rustdoc-determinism/Makefile)0
-rw-r--r--tests/run-make/rustdoc-determinism/bar.rs (renamed from tests/run-make-fulldeps/rustdoc-determinism/bar.rs)0
-rw-r--r--tests/run-make/rustdoc-determinism/foo.rs (renamed from tests/run-make-fulldeps/rustdoc-determinism/foo.rs)0
-rw-r--r--tests/run-make/rustdoc-error-lines/Makefile (renamed from tests/run-make-fulldeps/rustdoc-error-lines/Makefile)0
-rw-r--r--tests/run-make/rustdoc-error-lines/input.rs (renamed from tests/run-make-fulldeps/rustdoc-error-lines/input.rs)0
-rw-r--r--tests/run-make/rustdoc-io-error/Makefile (renamed from tests/run-make-fulldeps/rustdoc-io-error/Makefile)0
-rw-r--r--tests/run-make/rustdoc-io-error/foo.rs (renamed from tests/run-make-fulldeps/rustdoc-io-error/foo.rs)0
-rw-r--r--tests/run-make/rustdoc-map-file/Makefile (renamed from tests/run-make-fulldeps/rustdoc-map-file/Makefile)0
-rw-r--r--tests/run-make/rustdoc-map-file/expected.json (renamed from tests/run-make-fulldeps/rustdoc-map-file/expected.json)0
-rw-r--r--tests/run-make/rustdoc-map-file/foo.rs (renamed from tests/run-make-fulldeps/rustdoc-map-file/foo.rs)0
-rwxr-xr-xtests/run-make/rustdoc-map-file/validate_json.py (renamed from tests/run-make-fulldeps/rustdoc-map-file/validate_json.py)0
-rw-r--r--tests/run-make/rustdoc-output-path/Makefile (renamed from tests/run-make-fulldeps/rustdoc-output-path/Makefile)0
-rw-r--r--tests/run-make/rustdoc-output-path/foo.rs (renamed from tests/run-make-fulldeps/rustdoc-output-path/foo.rs)0
-rw-r--r--tests/run-make/rustdoc-scrape-examples-macros/Makefile (renamed from tests/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile)3
-rw-r--r--tests/run-make/rustdoc-scrape-examples-macros/examples/ex.rs (renamed from tests/run-make-fulldeps/rustdoc-scrape-examples-macros/examples/ex.rs)0
-rw-r--r--tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs (renamed from tests/run-make-fulldeps/rustdoc-scrape-examples-macros/src/lib.rs)0
-rw-r--r--tests/run-make/rustdoc-scrape-examples-macros/src/proc.rs (renamed from tests/run-make-fulldeps/rustdoc-scrape-examples-macros/src/proc.rs)0
-rw-r--r--tests/run-make/rustdoc-scrape-examples-multiple/scrape.mk2
-rw-r--r--tests/run-make/rustdoc-shared-flags/Makefile18
-rw-r--r--tests/run-make/rustdoc-target-spec-json-path/Makefile (renamed from tests/run-make-fulldeps/rustdoc-target-spec-json-path/Makefile)0
-rw-r--r--tests/run-make/rustdoc-target-spec-json-path/dummy_core.rs (renamed from tests/run-make-fulldeps/rustdoc-target-spec-json-path/dummy_core.rs)0
-rw-r--r--tests/run-make/rustdoc-target-spec-json-path/my_crate.rs (renamed from tests/run-make-fulldeps/rustdoc-target-spec-json-path/my_crate.rs)0
-rw-r--r--tests/run-make/rustdoc-target-spec-json-path/target.json (renamed from tests/run-make-fulldeps/rustdoc-target-spec-json-path/target.json)0
-rw-r--r--tests/run-make/rustdoc-themes/Makefile (renamed from tests/run-make-fulldeps/rustdoc-themes/Makefile)0
-rw-r--r--tests/run-make/rustdoc-themes/foo.rs (renamed from tests/run-make-fulldeps/rustdoc-themes/foo.rs)2
-rw-r--r--tests/run-make/rustdoc-verify-output-files/Makefile20
-rw-r--r--tests/run-make/rustdoc-with-out-dir-option/Makefile2
-rw-r--r--tests/run-make/rustdoc-with-output-option/Makefile2
-rw-r--r--tests/run-make/rustdoc-with-short-out-dir-option/Makefile2
-rw-r--r--tests/run-make/sanitizer-cdylib-link/Makefile (renamed from tests/run-make-fulldeps/sanitizer-cdylib-link/Makefile)0
-rw-r--r--tests/run-make/sanitizer-cdylib-link/library.rs (renamed from tests/run-make-fulldeps/sanitizer-cdylib-link/library.rs)0
-rw-r--r--tests/run-make/sanitizer-cdylib-link/program.rs (renamed from tests/run-make-fulldeps/sanitizer-cdylib-link/program.rs)0
-rw-r--r--tests/run-make/sanitizer-dylib-link/Makefile (renamed from tests/run-make-fulldeps/sanitizer-dylib-link/Makefile)0
-rw-r--r--tests/run-make/sanitizer-dylib-link/library.rs (renamed from tests/run-make-fulldeps/sanitizer-dylib-link/library.rs)0
-rw-r--r--tests/run-make/sanitizer-dylib-link/program.rs (renamed from tests/run-make-fulldeps/sanitizer-dylib-link/program.rs)0
-rw-r--r--tests/run-make/sanitizer-staticlib-link/Makefile (renamed from tests/run-make-fulldeps/sanitizer-staticlib-link/Makefile)0
-rw-r--r--tests/run-make/sanitizer-staticlib-link/library.rs (renamed from tests/run-make-fulldeps/sanitizer-staticlib-link/library.rs)0
-rw-r--r--tests/run-make/sanitizer-staticlib-link/program.c (renamed from tests/run-make-fulldeps/sanitizer-staticlib-link/program.c)0
-rw-r--r--tests/run-make/sanitizer-staticlib-link/program.rs (renamed from tests/run-make-fulldeps/sanitizer-staticlib-link/program.rs)0
-rw-r--r--tests/run-make/separate-link-fail/Makefile (renamed from tests/run-make-fulldeps/separate-link-fail/Makefile)0
-rw-r--r--tests/run-make/separate-link/Makefile (renamed from tests/run-make-fulldeps/separate-link/Makefile)1
-rw-r--r--tests/run-make/sepcomp-cci-copies/Makefile (renamed from tests/run-make-fulldeps/sepcomp-cci-copies/Makefile)0
-rw-r--r--tests/run-make/sepcomp-cci-copies/cci_lib.rs (renamed from tests/run-make-fulldeps/sepcomp-cci-copies/cci_lib.rs)0
-rw-r--r--tests/run-make/sepcomp-cci-copies/foo.rs (renamed from tests/run-make-fulldeps/sepcomp-cci-copies/foo.rs)0
-rw-r--r--tests/run-make/sepcomp-inlining/Makefile (renamed from tests/run-make-fulldeps/sepcomp-inlining/Makefile)0
-rw-r--r--tests/run-make/sepcomp-inlining/foo.rs (renamed from tests/run-make-fulldeps/sepcomp-inlining/foo.rs)0
-rw-r--r--tests/run-make/sepcomp-separate/Makefile (renamed from tests/run-make-fulldeps/sepcomp-separate/Makefile)0
-rw-r--r--tests/run-make/sepcomp-separate/foo.rs (renamed from tests/run-make-fulldeps/sepcomp-separate/foo.rs)0
-rw-r--r--tests/run-make/share-generics-dylib/Makefile (renamed from tests/run-make-fulldeps/share-generics-dylib/Makefile)3
-rw-r--r--tests/run-make/share-generics-dylib/instance_provider_a.rs (renamed from tests/run-make-fulldeps/share-generics-dylib/instance_provider_a.rs)0
-rw-r--r--tests/run-make/share-generics-dylib/instance_provider_b.rs (renamed from tests/run-make-fulldeps/share-generics-dylib/instance_provider_b.rs)0
-rw-r--r--tests/run-make/share-generics-dylib/instance_user_a_rlib.rs (renamed from tests/run-make-fulldeps/share-generics-dylib/instance_user_a_rlib.rs)0
-rw-r--r--tests/run-make/share-generics-dylib/instance_user_b_rlib.rs (renamed from tests/run-make-fulldeps/share-generics-dylib/instance_user_b_rlib.rs)0
-rw-r--r--tests/run-make/share-generics-dylib/instance_user_dylib.rs (renamed from tests/run-make-fulldeps/share-generics-dylib/instance_user_dylib.rs)0
-rw-r--r--tests/run-make/share-generics-dylib/linked_leaf.rs (renamed from tests/run-make-fulldeps/share-generics-dylib/linked_leaf.rs)0
-rw-r--r--tests/run-make/simd-ffi/Makefile (renamed from tests/run-make-fulldeps/simd-ffi/Makefile)0
-rw-r--r--tests/run-make/simd-ffi/simd.rs (renamed from tests/run-make-fulldeps/simd-ffi/simd.rs)0
-rw-r--r--tests/run-make/simple-dylib/Makefile (renamed from tests/run-make-fulldeps/simple-dylib/Makefile)1
-rw-r--r--tests/run-make/simple-dylib/bar.rs (renamed from tests/run-make-fulldeps/simple-dylib/bar.rs)0
-rw-r--r--tests/run-make/simple-dylib/foo.rs (renamed from tests/run-make-fulldeps/simple-dylib/foo.rs)0
-rw-r--r--tests/run-make/simple-rlib/Makefile (renamed from tests/run-make-fulldeps/simple-rlib/Makefile)1
-rw-r--r--tests/run-make/simple-rlib/bar.rs (renamed from tests/run-make-fulldeps/simple-rlib/bar.rs)0
-rw-r--r--tests/run-make/simple-rlib/foo.rs (renamed from tests/run-make-fulldeps/simple-rlib/foo.rs)0
-rw-r--r--tests/run-make/split-debuginfo/Makefile (renamed from tests/run-make-fulldeps/split-debuginfo/Makefile)1
-rw-r--r--tests/run-make/split-debuginfo/bar.rs (renamed from tests/run-make-fulldeps/split-debuginfo/bar.rs)0
-rw-r--r--tests/run-make/split-debuginfo/baz.rs (renamed from tests/run-make-fulldeps/split-debuginfo/baz.rs)0
-rw-r--r--tests/run-make/split-debuginfo/foo.rs (renamed from tests/run-make-fulldeps/split-debuginfo/foo.rs)0
-rw-r--r--tests/run-make/split-debuginfo/main.rs (renamed from tests/run-make-fulldeps/split-debuginfo/main.rs)0
-rw-r--r--tests/run-make/stable-symbol-names/Makefile (renamed from tests/run-make-fulldeps/stable-symbol-names/Makefile)0
-rw-r--r--tests/run-make/stable-symbol-names/stable-symbol-names1.rs (renamed from tests/run-make-fulldeps/stable-symbol-names/stable-symbol-names1.rs)0
-rw-r--r--tests/run-make/stable-symbol-names/stable-symbol-names2.rs (renamed from tests/run-make-fulldeps/stable-symbol-names/stable-symbol-names2.rs)0
-rw-r--r--tests/run-make/static-dylib-by-default/Makefile (renamed from tests/run-make-fulldeps/static-dylib-by-default/Makefile)1
-rw-r--r--tests/run-make/static-dylib-by-default/bar.rs (renamed from tests/run-make-fulldeps/static-dylib-by-default/bar.rs)0
-rw-r--r--tests/run-make/static-dylib-by-default/foo.rs (renamed from tests/run-make-fulldeps/static-dylib-by-default/foo.rs)0
-rw-r--r--tests/run-make/static-dylib-by-default/main.c (renamed from tests/run-make-fulldeps/static-dylib-by-default/main.c)0
-rw-r--r--tests/run-make/static-extern-type/Makefile (renamed from tests/run-make-fulldeps/static-extern-type/Makefile)1
-rw-r--r--tests/run-make/static-extern-type/define-foo.c (renamed from tests/run-make-fulldeps/static-extern-type/define-foo.c)0
-rw-r--r--tests/run-make/static-extern-type/use-foo.rs (renamed from tests/run-make-fulldeps/static-extern-type/use-foo.rs)0
-rw-r--r--tests/run-make/static-pie/Makefile4
-rw-r--r--tests/run-make/static-unwinding/Makefile (renamed from tests/run-make-fulldeps/static-unwinding/Makefile)1
-rw-r--r--tests/run-make/static-unwinding/lib.rs (renamed from tests/run-make-fulldeps/static-unwinding/lib.rs)0
-rw-r--r--tests/run-make/static-unwinding/main.rs (renamed from tests/run-make-fulldeps/static-unwinding/main.rs)0
-rw-r--r--tests/run-make/staticlib-blank-lib/Makefile (renamed from tests/run-make-fulldeps/staticlib-blank-lib/Makefile)0
-rw-r--r--tests/run-make/staticlib-blank-lib/foo.rs (renamed from tests/run-make-fulldeps/staticlib-blank-lib/foo.rs)0
-rw-r--r--tests/run-make/std-core-cycle/Makefile (renamed from tests/run-make-fulldeps/std-core-cycle/Makefile)1
-rw-r--r--tests/run-make/std-core-cycle/bar.rs (renamed from tests/run-make-fulldeps/std-core-cycle/bar.rs)0
-rw-r--r--tests/run-make/std-core-cycle/foo.rs (renamed from tests/run-make-fulldeps/std-core-cycle/foo.rs)0
-rw-r--r--tests/run-make/stdin-non-utf8/Makefile (renamed from tests/run-make-fulldeps/stdin-non-utf8/Makefile)0
-rw-r--r--tests/run-make/stdin-non-utf8/non-utf8 (renamed from tests/run-make-fulldeps/stdin-non-utf8/non-utf8)0
-rw-r--r--tests/run-make/suspicious-library/Makefile (renamed from tests/run-make-fulldeps/suspicious-library/Makefile)1
-rw-r--r--tests/run-make/suspicious-library/bar.rs (renamed from tests/run-make-fulldeps/suspicious-library/bar.rs)0
-rw-r--r--tests/run-make/suspicious-library/foo.rs (renamed from tests/run-make-fulldeps/suspicious-library/foo.rs)0
-rw-r--r--tests/run-make/symbol-visibility/Makefile (renamed from tests/run-make-fulldeps/symbol-visibility/Makefile)1
-rw-r--r--tests/run-make/symbol-visibility/a_cdylib.rs (renamed from tests/run-make-fulldeps/symbol-visibility/a_cdylib.rs)0
-rw-r--r--tests/run-make/symbol-visibility/a_proc_macro.rs (renamed from tests/run-make-fulldeps/symbol-visibility/a_proc_macro.rs)0
-rw-r--r--tests/run-make/symbol-visibility/a_rust_dylib.rs (renamed from tests/run-make-fulldeps/symbol-visibility/a_rust_dylib.rs)0
-rw-r--r--tests/run-make/symbol-visibility/an_executable.rs (renamed from tests/run-make-fulldeps/symbol-visibility/an_executable.rs)0
-rw-r--r--tests/run-make/symbol-visibility/an_rlib.rs (renamed from tests/run-make-fulldeps/symbol-visibility/an_rlib.rs)0
-rw-r--r--tests/run-make/symbols-include-type-name/Makefile (renamed from tests/run-make-fulldeps/symbols-include-type-name/Makefile)0
-rw-r--r--tests/run-make/symbols-include-type-name/lib.rs (renamed from tests/run-make-fulldeps/symbols-include-type-name/lib.rs)0
-rw-r--r--tests/run-make/symlinked-extern/Makefile (renamed from tests/run-make-fulldeps/symlinked-extern/Makefile)1
-rw-r--r--tests/run-make/symlinked-extern/bar.rs (renamed from tests/run-make-fulldeps/symlinked-extern/bar.rs)0
-rw-r--r--tests/run-make/symlinked-extern/baz.rs (renamed from tests/run-make-fulldeps/symlinked-extern/baz.rs)0
-rw-r--r--tests/run-make/symlinked-extern/foo.rs (renamed from tests/run-make-fulldeps/symlinked-extern/foo.rs)0
-rw-r--r--tests/run-make/symlinked-libraries/Makefile (renamed from tests/run-make-fulldeps/symlinked-libraries/Makefile)1
-rw-r--r--tests/run-make/symlinked-libraries/bar.rs (renamed from tests/run-make-fulldeps/symlinked-libraries/bar.rs)0
-rw-r--r--tests/run-make/symlinked-libraries/foo.rs (renamed from tests/run-make-fulldeps/symlinked-libraries/foo.rs)0
-rw-r--r--tests/run-make/symlinked-rlib/Makefile (renamed from tests/run-make-fulldeps/symlinked-rlib/Makefile)1
-rw-r--r--tests/run-make/symlinked-rlib/bar.rs (renamed from tests/run-make-fulldeps/symlinked-rlib/bar.rs)0
-rw-r--r--tests/run-make/symlinked-rlib/foo.rs (renamed from tests/run-make-fulldeps/symlinked-rlib/foo.rs)0
-rw-r--r--tests/run-make/sysroot-crates-are-unstable/Makefile (renamed from tests/run-make-fulldeps/sysroot-crates-are-unstable/Makefile)0
-rw-r--r--tests/run-make/sysroot-crates-are-unstable/test.py (renamed from tests/run-make-fulldeps/sysroot-crates-are-unstable/test.py)1
-rw-r--r--tests/run-make/target-cpu-native/Makefile (renamed from tests/run-make-fulldeps/target-cpu-native/Makefile)0
-rw-r--r--tests/run-make/target-cpu-native/foo.rs (renamed from tests/run-make-fulldeps/target-cpu-native/foo.rs)0
-rw-r--r--tests/run-make/target-specs/Makefile (renamed from tests/run-make-fulldeps/target-specs/Makefile)0
-rw-r--r--tests/run-make/target-specs/definitely-not-builtin-target.json (renamed from tests/run-make-fulldeps/target-specs/definitely-not-builtin-target.json)0
-rw-r--r--tests/run-make/target-specs/foo.rs (renamed from tests/run-make-fulldeps/target-specs/foo.rs)0
-rw-r--r--tests/run-make/target-specs/mismatching-data-layout.json (renamed from tests/run-make-fulldeps/target-specs/mismatching-data-layout.json)0
-rw-r--r--tests/run-make/target-specs/my-awesome-platform.json (renamed from tests/run-make-fulldeps/target-specs/my-awesome-platform.json)0
-rw-r--r--tests/run-make/target-specs/my-incomplete-platform.json (renamed from tests/run-make-fulldeps/target-specs/my-incomplete-platform.json)0
-rw-r--r--tests/run-make/target-specs/my-invalid-platform.json (renamed from tests/run-make-fulldeps/target-specs/my-invalid-platform.json)0
-rw-r--r--tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json (renamed from tests/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json)0
-rw-r--r--tests/run-make/target-without-atomic-cas/Makefile (renamed from tests/run-make-fulldeps/target-without-atomic-cas/Makefile)0
-rw-r--r--tests/run-make/test-benches/Makefile2
-rw-r--r--tests/run-make/test-harness/Makefile (renamed from tests/run-make-fulldeps/test-harness/Makefile)1
-rw-r--r--tests/run-make/test-harness/test-ignore-cfg.rs (renamed from tests/run-make-fulldeps/test-harness/test-ignore-cfg.rs)0
-rw-r--r--tests/run-make/thumb-none-cortex-m/Makefile2
-rw-r--r--tests/run-make/thumb-none-qemu/Makefile2
-rw-r--r--tests/run-make/tools.mk (renamed from tests/run-make-fulldeps/tools.mk)4
-rw-r--r--tests/run-make/track-path-dep-info/Makefile2
-rw-r--r--tests/run-make/track-pgo-dep-info/Makefile2
-rw-r--r--tests/run-make/translation/Makefile18
-rw-r--r--tests/run-make/type-mismatch-same-crate-name/Makefile (renamed from tests/run-make-fulldeps/type-mismatch-same-crate-name/Makefile)0
-rw-r--r--tests/run-make/type-mismatch-same-crate-name/crateA.rs (renamed from tests/run-make-fulldeps/type-mismatch-same-crate-name/crateA.rs)0
-rw-r--r--tests/run-make/type-mismatch-same-crate-name/crateB.rs (renamed from tests/run-make-fulldeps/type-mismatch-same-crate-name/crateB.rs)0
-rw-r--r--tests/run-make/type-mismatch-same-crate-name/crateC.rs (renamed from tests/run-make-fulldeps/type-mismatch-same-crate-name/crateC.rs)0
-rw-r--r--tests/run-make/unstable-flag-required/Makefile2
-rw-r--r--tests/run-make/use-extern-for-plugins/Makefile (renamed from tests/run-make-fulldeps/use-extern-for-plugins/Makefile)2
-rw-r--r--tests/run-make/use-extern-for-plugins/bar.rs (renamed from tests/run-make-fulldeps/use-extern-for-plugins/bar.rs)0
-rw-r--r--tests/run-make/use-extern-for-plugins/baz.rs (renamed from tests/run-make-fulldeps/use-extern-for-plugins/baz.rs)0
-rw-r--r--tests/run-make/use-extern-for-plugins/foo.rs (renamed from tests/run-make-fulldeps/use-extern-for-plugins/foo.rs)0
-rw-r--r--tests/run-make/use-suggestions-rust-2018/Makefile (renamed from tests/run-make-fulldeps/use-suggestions-rust-2018/Makefile)0
-rw-r--r--tests/run-make/use-suggestions-rust-2018/ep-nested-lib.rs (renamed from tests/run-make-fulldeps/use-suggestions-rust-2018/ep-nested-lib.rs)0
-rw-r--r--tests/run-make/use-suggestions-rust-2018/use-suggestions.rs (renamed from tests/run-make-fulldeps/use-suggestions-rust-2018/use-suggestions.rs)0
-rw-r--r--tests/run-make/used-cdylib-macos/Makefile (renamed from tests/run-make-fulldeps/used-cdylib-macos/Makefile)0
-rw-r--r--tests/run-make/used-cdylib-macos/dylib_used.rs (renamed from tests/run-make-fulldeps/used-cdylib-macos/dylib_used.rs)0
-rw-r--r--tests/run-make/used/Makefile (renamed from tests/run-make-fulldeps/used/Makefile)0
-rw-r--r--tests/run-make/used/used.rs (renamed from tests/run-make-fulldeps/used/used.rs)0
-rw-r--r--tests/run-make/valid-print-requests/Makefile2
-rw-r--r--tests/run-make/valid-print-requests/valid-print-requests.stderr2
-rw-r--r--tests/run-make/version/Makefile (renamed from tests/run-make-fulldeps/version/Makefile)0
-rw-r--r--tests/run-make/volatile-intrinsics/Makefile (renamed from tests/run-make-fulldeps/volatile-intrinsics/Makefile)1
-rw-r--r--tests/run-make/volatile-intrinsics/main.rs (renamed from tests/run-make-fulldeps/volatile-intrinsics/main.rs)0
-rw-r--r--tests/run-make/wasm-abi/Makefile2
-rw-r--r--tests/run-make/wasm-custom-section/Makefile2
-rw-r--r--tests/run-make/wasm-custom-sections-opt/Makefile2
-rw-r--r--tests/run-make/wasm-export-all-symbols/Makefile2
-rw-r--r--tests/run-make/wasm-import-module/Makefile2
-rw-r--r--tests/run-make/wasm-panic-small/Makefile2
-rw-r--r--tests/run-make/wasm-spurious-import/Makefile2
-rw-r--r--tests/run-make/wasm-stringify-ints-small/Makefile2
-rw-r--r--tests/run-make/wasm-symbols-different-module/Makefile2
-rw-r--r--tests/run-make/wasm-symbols-not-exported/Makefile2
-rw-r--r--tests/run-make/wasm-symbols-not-imported/Makefile2
-rw-r--r--tests/run-make/weird-output-filenames/Makefile (renamed from tests/run-make-fulldeps/weird-output-filenames/Makefile)0
-rw-r--r--tests/run-make/weird-output-filenames/foo.rs (renamed from tests/run-make-fulldeps/weird-output-filenames/foo.rs)0
-rw-r--r--tests/run-make/windows-binary-no-external-deps/Makefile (renamed from tests/run-make-fulldeps/windows-binary-no-external-deps/Makefile)0
-rw-r--r--tests/run-make/windows-binary-no-external-deps/hello.rs (renamed from tests/run-make-fulldeps/windows-binary-no-external-deps/hello.rs)0
-rw-r--r--tests/run-make/windows-spawn/Makefile (renamed from tests/run-make-fulldeps/windows-spawn/Makefile)0
-rw-r--r--tests/run-make/windows-spawn/hello.rs (renamed from tests/run-make-fulldeps/windows-spawn/hello.rs)0
-rw-r--r--tests/run-make/windows-spawn/spawn.rs (renamed from tests/run-make-fulldeps/windows-spawn/spawn.rs)0
-rw-r--r--tests/run-make/windows-subsystem/Makefile (renamed from tests/run-make-fulldeps/windows-subsystem/Makefile)1
-rw-r--r--tests/run-make/windows-subsystem/console.rs (renamed from tests/run-make-fulldeps/windows-subsystem/console.rs)0
-rw-r--r--tests/run-make/windows-subsystem/windows.rs (renamed from tests/run-make-fulldeps/windows-subsystem/windows.rs)0
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile2
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_asm.checks5
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c_asm.checks2
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx_asm.checks2
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_asm.checks2
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_asm.checks2
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_asm.checks2
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks22
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks1
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh35
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks2
-rw-r--r--tests/rustdoc-gui/anchor-navigable.goml2
-rw-r--r--tests/rustdoc-gui/anchors.goml8
-rw-r--r--tests/rustdoc-gui/auto-hide-trait-implementations.goml13
-rw-r--r--tests/rustdoc-gui/basic-code.goml2
-rw-r--r--tests/rustdoc-gui/check-code-blocks-margin.goml2
-rw-r--r--tests/rustdoc-gui/check-stab-in-docblock.goml4
-rw-r--r--tests/rustdoc-gui/check_info_sign_position.goml4
-rw-r--r--tests/rustdoc-gui/code-blocks-overflow.goml4
-rw-r--r--tests/rustdoc-gui/code-color.goml4
-rw-r--r--tests/rustdoc-gui/code-sidebar-toggle.goml4
-rw-r--r--tests/rustdoc-gui/code-tags.goml12
-rw-r--r--tests/rustdoc-gui/codeblock-sub.goml2
-rw-r--r--tests/rustdoc-gui/codeblock-tooltip.goml4
-rw-r--r--tests/rustdoc-gui/cursor.goml6
-rw-r--r--tests/rustdoc-gui/default-settings.goml2
-rw-r--r--tests/rustdoc-gui/docblock-big-code-mobile.goml4
-rw-r--r--tests/rustdoc-gui/docblock-code-block-line-number.goml4
-rw-r--r--tests/rustdoc-gui/docblock-details.goml4
-rw-r--r--tests/rustdoc-gui/docblock-table-overflow.goml4
-rw-r--r--tests/rustdoc-gui/docblock-table.goml4
-rw-r--r--tests/rustdoc-gui/duplicate-macro-reexport.goml2
-rw-r--r--tests/rustdoc-gui/enum-variants.goml2
-rw-r--r--tests/rustdoc-gui/escape-key.goml2
-rw-r--r--tests/rustdoc-gui/extend-css.goml5
-rw-r--r--tests/rustdoc-gui/font-weight.goml8
-rw-r--r--tests/rustdoc-gui/go-to-collapsed-elem.goml40
-rw-r--r--tests/rustdoc-gui/hash-item-expansion.goml2
-rw-r--r--tests/rustdoc-gui/headers-color.goml12
-rw-r--r--tests/rustdoc-gui/headings.goml16
-rw-r--r--tests/rustdoc-gui/help-page.goml16
-rw-r--r--tests/rustdoc-gui/highlight-colors.goml4
-rw-r--r--tests/rustdoc-gui/huge-collection-of-constants.goml2
-rw-r--r--tests/rustdoc-gui/huge-logo.goml16
-rw-r--r--tests/rustdoc-gui/impl-default-expansion.goml2
-rw-r--r--tests/rustdoc-gui/impl-doc.goml2
-rw-r--r--tests/rustdoc-gui/implementors.goml10
-rw-r--r--tests/rustdoc-gui/item-decl-colors.goml6
-rw-r--r--tests/rustdoc-gui/item-info-alignment.goml6
-rw-r--r--tests/rustdoc-gui/item-info-overflow.goml6
-rw-r--r--tests/rustdoc-gui/item-info.goml6
-rw-r--r--tests/rustdoc-gui/item-summary-table.goml2
-rw-r--r--tests/rustdoc-gui/javascript-disabled.goml2
-rw-r--r--tests/rustdoc-gui/jump-to-def-background.goml4
-rw-r--r--tests/rustdoc-gui/label-next-to-symbol.goml6
-rw-r--r--tests/rustdoc-gui/links-color.goml4
-rw-r--r--tests/rustdoc-gui/list_code_block.goml4
-rw-r--r--tests/rustdoc-gui/method-margins.goml2
-rw-r--r--tests/rustdoc-gui/mobile.goml12
-rw-r--r--tests/rustdoc-gui/module-items-font.goml2
-rw-r--r--tests/rustdoc-gui/no-docblock.goml4
-rw-r--r--tests/rustdoc-gui/notable-trait.goml18
-rw-r--r--tests/rustdoc-gui/overflow-tooltip-information.goml2
-rw-r--r--tests/rustdoc-gui/pocket-menu.goml10
-rw-r--r--tests/rustdoc-gui/run-on-hover.goml4
-rw-r--r--tests/rustdoc-gui/rust-logo.goml14
-rw-r--r--tests/rustdoc-gui/scrape-examples-button-focus.goml12
-rw-r--r--tests/rustdoc-gui/scrape-examples-color.goml8
-rw-r--r--tests/rustdoc-gui/scrape-examples-fonts.goml2
-rw-r--r--tests/rustdoc-gui/scrape-examples-layout.goml4
-rw-r--r--tests/rustdoc-gui/scrape-examples-toggle.goml4
-rw-r--r--tests/rustdoc-gui/search-error.goml4
-rw-r--r--tests/rustdoc-gui/search-filter.goml10
-rw-r--r--tests/rustdoc-gui/search-form-elements.goml8
-rw-r--r--tests/rustdoc-gui/search-input-mobile.goml6
-rw-r--r--tests/rustdoc-gui/search-keyboard.goml2
-rw-r--r--tests/rustdoc-gui/search-no-result.goml4
-rw-r--r--tests/rustdoc-gui/search-reexport.goml4
-rw-r--r--tests/rustdoc-gui/search-result-color.goml12
-rw-r--r--tests/rustdoc-gui/search-result-description.goml2
-rw-r--r--tests/rustdoc-gui/search-result-display.goml12
-rw-r--r--tests/rustdoc-gui/search-result-go-to-first.goml6
-rw-r--r--tests/rustdoc-gui/search-result-keyword.goml2
-rw-r--r--tests/rustdoc-gui/search-tab-change-title-fn-sig.goml10
-rw-r--r--tests/rustdoc-gui/search-tab.goml4
-rw-r--r--tests/rustdoc-gui/setting-auto-hide-content-large-items.goml51
-rw-r--r--tests/rustdoc-gui/setting-auto-hide-item-methods-docs.goml48
-rw-r--r--tests/rustdoc-gui/setting-auto-hide-trait-implementations.goml47
-rw-r--r--tests/rustdoc-gui/setting-go-to-only-result.goml63
-rw-r--r--tests/rustdoc-gui/settings.goml87
-rw-r--r--tests/rustdoc-gui/shortcuts.goml2
-rw-r--r--tests/rustdoc-gui/sidebar-links-color.goml4
-rw-r--r--tests/rustdoc-gui/sidebar-macro-reexport.goml2
-rw-r--r--tests/rustdoc-gui/sidebar-mobile-scroll.goml43
-rw-r--r--tests/rustdoc-gui/sidebar-mobile.goml6
-rw-r--r--tests/rustdoc-gui/sidebar-source-code-display.goml24
-rw-r--r--tests/rustdoc-gui/sidebar-source-code.goml12
-rw-r--r--tests/rustdoc-gui/sidebar.goml32
-rw-r--r--tests/rustdoc-gui/source-anchor-scroll.goml4
-rw-r--r--tests/rustdoc-gui/source-code-page-code-scroll.goml8
-rw-r--r--tests/rustdoc-gui/source-code-page.goml19
-rw-r--r--tests/rustdoc-gui/src-font-size.goml2
-rw-r--r--tests/rustdoc-gui/src/extend_css/Cargo.lock7
-rw-r--r--tests/rustdoc-gui/src/extend_css/Cargo.toml7
-rw-r--r--tests/rustdoc-gui/src/extend_css/extra.css3
-rw-r--r--tests/rustdoc-gui/src/extend_css/lib.rs1
-rw-r--r--tests/rustdoc-gui/stab-badge.goml8
-rw-r--r--tests/rustdoc-gui/struct-fields.goml2
-rw-r--r--tests/rustdoc-gui/target.goml4
-rw-r--r--tests/rustdoc-gui/theme-change.goml8
-rw-r--r--tests/rustdoc-gui/theme-defaults.goml24
-rw-r--r--tests/rustdoc-gui/theme-in-history.goml6
-rw-r--r--tests/rustdoc-gui/toggle-click-deadspace.goml2
-rw-r--r--tests/rustdoc-gui/toggle-docs-mobile.goml6
-rw-r--r--tests/rustdoc-gui/toggle-docs.goml6
-rw-r--r--tests/rustdoc-gui/toggle-implementors.goml2
-rw-r--r--tests/rustdoc-gui/toggled-open-implementations.goml2
-rw-r--r--tests/rustdoc-gui/trait-sidebar-item-order.goml2
-rw-r--r--tests/rustdoc-gui/type-declation-overflow.goml30
-rw-r--r--tests/rustdoc-gui/unsafe-fn.goml4
-rw-r--r--tests/rustdoc-gui/where-whitespace.goml6
-rw-r--r--tests/rustdoc-js-std/option-type-signatures.js18
-rw-r--r--tests/rustdoc-js-std/parser-errors.js58
-rw-r--r--tests/rustdoc-js-std/parser-filter.js96
-rw-r--r--tests/rustdoc-js-std/parser-generics.js130
-rw-r--r--tests/rustdoc-js-std/parser-ident.js10
-rw-r--r--tests/rustdoc-js-std/parser-literal.js2
-rw-r--r--tests/rustdoc-js-std/parser-paths.js10
-rw-r--r--tests/rustdoc-js-std/parser-quote.js9
-rw-r--r--tests/rustdoc-js-std/parser-returned.js11
-rw-r--r--tests/rustdoc-js-std/parser-separators.js18
-rw-r--r--tests/rustdoc-js-std/parser-weird-queries.js17
-rw-r--r--tests/rustdoc-js-std/println-typo.js12
-rw-r--r--tests/rustdoc-js/generics-impl.js13
-rw-r--r--tests/rustdoc-js/generics-nested.js33
-rw-r--r--tests/rustdoc-js/generics-nested.rs19
-rw-r--r--tests/rustdoc-js/generics.js16
-rw-r--r--tests/rustdoc-js/primitive.js10
-rw-r--r--tests/rustdoc-js/search-bag-semantics.js20
-rw-r--r--tests/rustdoc-js/search-bag-semantics.rs4
-rw-r--r--tests/rustdoc-js/where-clause.js30
-rw-r--r--tests/rustdoc-js/where-clause.rs30
-rw-r--r--tests/rustdoc-json/fns/extern_c_variadic.rs9
-rw-r--r--tests/rustdoc-json/impls/local_for_local_primitive.rs4
-rw-r--r--tests/rustdoc-json/non_lifetime_binders.rs24
-rw-r--r--tests/rustdoc-json/primitives/local_primitive.rs2
-rw-r--r--tests/rustdoc-json/primitives/primitive_impls.rs2
-rw-r--r--tests/rustdoc-json/primitives/primitive_overloading.rs4
-rw-r--r--tests/rustdoc-json/primitives/use_primitive.rs4
-rw-r--r--tests/rustdoc-ui/c-help.rs6
-rw-r--r--tests/rustdoc-ui/c-help.stdout51
-rw-r--r--tests/rustdoc-ui/const_arg_in_type_position.rs6
-rw-r--r--tests/rustdoc-ui/const_arg_in_type_position.stderr9
-rw-r--r--tests/rustdoc-ui/coverage/exotic.rs3
-rw-r--r--tests/rustdoc-ui/crate-reference-in-block-module.rs5
-rw-r--r--tests/rustdoc-ui/crate-reference-in-block-module.stderr0
-rw-r--r--tests/rustdoc-ui/intra-doc/ambiguity.rs2
-rw-r--r--tests/rustdoc-ui/intra-doc/ambiguity.stderr54
-rw-r--r--tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-doc.rs1
-rw-r--r--tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-enum.rs3
-rw-r--r--tests/rustdoc-ui/intra-doc/errors.rs4
-rw-r--r--tests/rustdoc-ui/intra-doc/errors.stderr4
-rw-r--r--tests/rustdoc-ui/intra-doc/import-inline-merge-module.rs10
-rw-r--r--tests/rustdoc-ui/intra-doc/inline-external-enum.rs8
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-10.rs22
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-2.rs17
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-2.stderr37
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-3.rs16
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-3.stderr37
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-4.rs21
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-4.stderr22
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-5.rs8
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-5.stderr22
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-6.rs8
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-6.stderr22
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-7.rs12
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-7.stderr22
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-8.rs12
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-8.stderr22
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items-9.rs11
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items.rs35
-rw-r--r--tests/rustdoc-ui/intra-doc/issue-108653-associated-items.stderr67
-rw-r--r--tests/rustdoc-ui/intra-doc/non-path-primitives.stderr8
-rw-r--r--tests/rustdoc-ui/intra-doc/prim-conflict.rs10
-rw-r--r--tests/rustdoc-ui/intra-doc/prim-conflict.stderr12
-rw-r--r--tests/rustdoc-ui/intra-doc/reachable-non-exported.rs13
-rw-r--r--tests/rustdoc-ui/invalid_associated_const.rs10
-rw-r--r--tests/rustdoc-ui/invalid_associated_const.stderr9
-rw-r--r--tests/rustdoc-ui/invalid_const_in_lifetime_position.rs6
-rw-r--r--tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr33
-rw-r--r--tests/rustdoc-ui/invalid_infered_static_and_const.rs2
-rw-r--r--tests/rustdoc-ui/invalid_infered_static_and_const.stderr15
-rw-r--r--tests/rustdoc-ui/issue-105742.rs37
-rw-r--r--tests/rustdoc-ui/issue-105742.stderr331
-rw-r--r--tests/rustdoc-ui/issue-106226.stderr8
-rw-r--r--tests/rustdoc-ui/issue-109282-import-inline-merge.rs14
-rw-r--r--tests/rustdoc-ui/issue-79465.rs1
-rw-r--r--tests/rustdoc-ui/issue-79465.stderr8
-rw-r--r--tests/rustdoc-ui/issue-96287.rs1
-rw-r--r--tests/rustdoc-ui/issue-96287.stderr8
-rw-r--r--tests/rustdoc-ui/mismatched_arg_count.rs8
-rw-r--r--tests/rustdoc-ui/mismatched_arg_count.stderr17
-rw-r--r--tests/rustdoc-ui/run-directory.rs4
-rw-r--r--tests/rustdoc-ui/z-help.rs6
-rw-r--r--tests/rustdoc-ui/z-help.stdout218
-rw-r--r--tests/rustdoc/anonymous-reexport.rs8
-rw-r--r--tests/rustdoc/auto-impl-primitive.rs4
-rw-r--r--tests/rustdoc/auxiliary/issue-15318.rs3
-rw-r--r--tests/rustdoc/auxiliary/issue-73061.rs2
-rw-r--r--tests/rustdoc/auxiliary/primitive-doc.rs3
-rw-r--r--tests/rustdoc/check-source-code-urls-to-def.rs4
-rw-r--r--tests/rustdoc/compiler-derive-proc-macro.rs15
-rw-r--r--tests/rustdoc/deprecated.rs4
-rw-r--r--tests/rustdoc/footnote-in-summary.rs17
-rw-r--r--tests/rustdoc/generic-associated-types/issue-109488.rs18
-rw-r--r--tests/rustdoc/intra-doc/auxiliary/my-core.rs2
-rw-r--r--tests/rustdoc/intra-doc/no-doc-primitive.rs2
-rw-r--r--tests/rustdoc/intra-doc/prim-methods-local.rs2
-rw-r--r--tests/rustdoc/intra-doc/prim-methods.rs2
-rw-r--r--tests/rustdoc/intra-doc/prim-self.rs2
-rw-r--r--tests/rustdoc/issue-108679-reexport-of-reexport.rs29
-rw-r--r--tests/rustdoc/issue-108925.rs10
-rw-r--r--tests/rustdoc/issue-108931-anonymous-reexport.rs21
-rw-r--r--tests/rustdoc/issue-109258-missing-private-inlining.rs27
-rw-r--r--tests/rustdoc/issue-109695-crate-doc-hidden.rs8
-rw-r--r--tests/rustdoc/issue-15318-2.rs2
-rw-r--r--tests/rustdoc/issue-15318-3.rs4
-rw-r--r--tests/rustdoc/issue-23511.rs2
-rw-r--r--tests/rustdoc/issue-25001.rs4
-rw-r--r--tests/rustdoc/macro_pub_in_module.rs12
-rw-r--r--tests/rustdoc/non_lifetime_binders.rs9
-rw-r--r--tests/rustdoc/normalize-assoc-item.rs4
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs (renamed from tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs)4
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs (renamed from tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs)4
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait-slice.bare_fn_matches.html (renamed from tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait-slice.rs (renamed from tests/rustdoc/doc-notable_trait-slice.rs)6
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait.bare-fn.html (renamed from tests/rustdoc/doc-notable_trait.bare-fn.html)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait.rs (renamed from tests/rustdoc/doc-notable_trait.rs)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait.some-struct-new.html (renamed from tests/rustdoc/doc-notable_trait.some-struct-new.html)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait.wrap-me.html (renamed from tests/rustdoc/doc-notable_trait.wrap-me.html)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs (renamed from tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs)0
-rw-r--r--tests/rustdoc/notable-trait/notable-trait-generics.rs35
-rw-r--r--tests/rustdoc/notable-trait/spotlight-from-dependency.odd.html (renamed from tests/rustdoc/spotlight-from-dependency.odd.html)0
-rw-r--r--tests/rustdoc/notable-trait/spotlight-from-dependency.rs (renamed from tests/rustdoc/spotlight-from-dependency.rs)0
-rw-r--r--tests/rustdoc/primitive-reference.rs4
-rw-r--r--tests/rustdoc/primitive-slice-auto-trait.rs4
-rw-r--r--tests/rustdoc/primitive-tuple-auto-trait.rs4
-rw-r--r--tests/rustdoc/primitive-unit-auto-trait.rs4
-rw-r--r--tests/rustdoc/primitive/primitive-generic-impl.rs4
-rw-r--r--tests/rustdoc/primitive/primitive.rs (renamed from tests/rustdoc/primitive.rs)6
-rw-r--r--tests/rustdoc/sidebar-all-page.rs4
-rw-r--r--tests/rustdoc/tab_title.rs3
-rw-r--r--tests/rustdoc/titles.rs4
-rw-r--r--tests/rustdoc/type-layout.rs8
-rw-r--r--tests/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs80
-rw-r--r--tests/ui-fulldeps/auxiliary/lint-for-crate.rs12
-rw-r--r--tests/ui-fulldeps/extern-mod-syntax.rs11
-rw-r--r--tests/ui-fulldeps/fluent-messages/invalid-escape.ftl1
-rw-r--r--tests/ui-fulldeps/fluent-messages/test.rs11
-rw-r--r--tests/ui-fulldeps/fluent-messages/test.stderr34
-rw-r--r--tests/ui-fulldeps/pprust-expr-roundtrip.rs43
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs57
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr315
-rw-r--r--tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs43
-rw-r--r--tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr288
-rw-r--r--tests/ui-fulldeps/stable-mir/crate-info.rs129
-rw-r--r--tests/ui/abi/stack-probes-lto.rs1
-rw-r--r--tests/ui/argument-suggestions/issue-109425.fixed20
-rw-r--r--tests/ui/argument-suggestions/issue-109425.rs20
-rw-r--r--tests/ui/argument-suggestions/issue-109425.stderr98
-rw-r--r--tests/ui/argument-suggestions/issue-109831.rs9
-rw-r--r--tests/ui/argument-suggestions/issue-109831.stderr51
-rw-r--r--tests/ui/array-slice-vec/repeat_empty_ok.stderr6
-rw-r--r--tests/ui/asm/aarch64/parse-error.rs23
-rw-r--r--tests/ui/asm/aarch64/parse-error.stderr169
-rw-r--r--tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr5
-rw-r--r--tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr5
-rw-r--r--tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr5
-rw-r--r--tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr5
-rw-r--r--tests/ui/asm/x86_64/issue-89875.rs4
-rw-r--r--tests/ui/asm/x86_64/parse-error.rs23
-rw-r--r--tests/ui/asm/x86_64/parse-error.stderr173
-rw-r--r--tests/ui/associated-consts/associated-const-dead-code.stderr2
-rw-r--r--tests/ui/associated-consts/defaults-not-assumed-fail.stderr8
-rw-r--r--tests/ui/associated-consts/issue-93775.rs2
-rw-r--r--tests/ui/associated-inherent-types/issue-109299-1.rs12
-rw-r--r--tests/ui/associated-inherent-types/issue-109299-1.stderr15
-rw-r--r--tests/ui/associated-inherent-types/issue-109299.rs12
-rw-r--r--tests/ui/associated-inherent-types/issue-109299.stderr11
-rw-r--r--tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr2
-rw-r--r--tests/ui/associated-type-bounds/issue-104916.rs14
-rw-r--r--tests/ui/associated-type-bounds/issue-104916.stderr8
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs22
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr56
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/basic.rs28
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/basic.with.stderr19
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr37
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/equality.rs16
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/equality.stderr25
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/missing.rs14
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/missing.stderr25
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/non-rpitit.rs11
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/non-rpitit.stderr22
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs11
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr12
-rw-r--r--tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout15
-rw-r--r--tests/ui/associated-types/associated-types-in-ambiguous-context.rs2
-rw-r--r--tests/ui/associated-types/associated-types-in-ambiguous-context.stderr21
-rw-r--r--tests/ui/associated-types/defaults-suitability.stderr6
-rw-r--r--tests/ui/associated-types/issue-20825.stderr2
-rw-r--r--tests/ui/associated-types/issue-63591.rs10
-rw-r--r--tests/ui/associated-types/issue-67684.rs8
-rw-r--r--tests/ui/async-await/async-trait-fn.current.stderr42
-rw-r--r--tests/ui/async-await/async-trait-fn.next.stderr42
-rw-r--r--tests/ui/async-await/async-trait-fn.rs1
-rw-r--r--tests/ui/async-await/async-trait-fn.stderr6
-rw-r--r--tests/ui/async-await/edition-deny-async-fns-2015.current.stderr (renamed from tests/ui/async-await/edition-deny-async-fns-2015.stderr)20
-rw-r--r--tests/ui/async-await/edition-deny-async-fns-2015.next.stderr98
-rw-r--r--tests/ui/async-await/edition-deny-async-fns-2015.rs2
-rw-r--r--tests/ui/async-await/generator-desc.stderr14
-rw-r--r--tests/ui/async-await/in-trait/async-associated-types.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-associated-types2.rs8
-rw-r--r--tests/ui/async-await/in-trait/async-default-fn-overridden.current.stderr (renamed from tests/ui/async-await/in-trait/async-default-fn-overridden.stderr)2
-rw-r--r--tests/ui/async-await/in-trait/async-default-fn-overridden.next.stderr11
-rw-r--r--tests/ui/async-await/in-trait/async-default-fn-overridden.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.current.stderr (renamed from tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr)4
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.next.stderr17
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-boxed.current.stderr (renamed from tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr)2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-boxed.next.stderr11
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-boxed.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-extra.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-manual.current.stderr (renamed from tests/ui/async-await/in-trait/async-example-desugared-manual.stderr)2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-manual.next.stderr11
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-manual.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-generics-and-bounds.current.stderr (renamed from tests/ui/async-await/in-trait/async-generics-and-bounds.stderr)12
-rw-r--r--tests/ui/async-await/in-trait/async-generics-and-bounds.next.stderr37
-rw-r--r--tests/ui/async-await/in-trait/async-generics-and-bounds.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-generics.current.stderr (renamed from tests/ui/async-await/in-trait/async-generics.stderr)12
-rw-r--r--tests/ui/async-await/in-trait/async-generics.next.stderr37
-rw-r--r--tests/ui/async-await/in-trait/async-generics.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-recursive-generic.current.stderr (renamed from tests/ui/async-await/in-trait/async-recursive-generic.stderr)2
-rw-r--r--tests/ui/async-await/in-trait/async-recursive-generic.next.stderr12
-rw-r--r--tests/ui/async-await/in-trait/async-recursive-generic.rs2
-rw-r--r--tests/ui/async-await/in-trait/async-recursive.current.stderr (renamed from tests/ui/async-await/in-trait/async-recursive.stderr)2
-rw-r--r--tests/ui/async-await/in-trait/async-recursive.next.stderr12
-rw-r--r--tests/ui/async-await/in-trait/async-recursive.rs2
-rw-r--r--tests/ui/async-await/in-trait/bad-signatures.current.stderr (renamed from tests/ui/async-await/in-trait/bad-signatures.stderr)6
-rw-r--r--tests/ui/async-await/in-trait/bad-signatures.next.stderr26
-rw-r--r--tests/ui/async-await/in-trait/bad-signatures.rs2
-rw-r--r--tests/ui/async-await/in-trait/dont-project-to-specializable-projection.current.stderr (renamed from tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr)4
-rw-r--r--tests/ui/async-await/in-trait/dont-project-to-specializable-projection.next.stderr34
-rw-r--r--tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs2
-rw-r--r--tests/ui/async-await/in-trait/early-bound-1.rs2
-rw-r--r--tests/ui/async-await/in-trait/early-bound-2.rs2
-rw-r--r--tests/ui/async-await/in-trait/fn-not-async-err2.current.stderr (renamed from tests/ui/async-await/in-trait/fn-not-async-err2.stderr)2
-rw-r--r--tests/ui/async-await/in-trait/fn-not-async-err2.next.stderr12
-rw-r--r--tests/ui/async-await/in-trait/fn-not-async-err2.rs2
-rw-r--r--tests/ui/async-await/in-trait/generics-mismatch.current.stderr16
-rw-r--r--tests/ui/async-await/in-trait/generics-mismatch.next.stderr16
-rw-r--r--tests/ui/async-await/in-trait/generics-mismatch.rs15
-rw-r--r--tests/ui/async-await/in-trait/generics-mismatch.stderr16
-rw-r--r--tests/ui/async-await/in-trait/implied-bounds.rs2
-rw-r--r--tests/ui/async-await/in-trait/issue-102138.rs2
-rw-r--r--tests/ui/async-await/in-trait/issue-102219.rs2
-rw-r--r--tests/ui/async-await/in-trait/issue-102310.rs2
-rw-r--r--tests/ui/async-await/in-trait/issue-104678.rs2
-rw-r--r--tests/ui/async-await/in-trait/lifetime-mismatch.current.stderr (renamed from tests/ui/async-await/in-trait/lifetime-mismatch.stderr)4
-rw-r--r--tests/ui/async-await/in-trait/lifetime-mismatch.next.stderr21
-rw-r--r--tests/ui/async-await/in-trait/lifetime-mismatch.rs2
-rw-r--r--tests/ui/async-await/in-trait/missing-send-bound.current.stderr (renamed from tests/ui/async-await/in-trait/missing-send-bound.stderr)8
-rw-r--r--tests/ui/async-await/in-trait/missing-send-bound.next.stderr29
-rw-r--r--tests/ui/async-await/in-trait/missing-send-bound.rs2
-rw-r--r--tests/ui/async-await/in-trait/object-safety.current.stderr (renamed from tests/ui/async-await/in-trait/object-safety.stderr)6
-rw-r--r--tests/ui/async-await/in-trait/object-safety.next.stderr27
-rw-r--r--tests/ui/async-await/in-trait/object-safety.rs2
-rw-r--r--tests/ui/async-await/in-trait/return-type-suggestion.current.stderr (renamed from tests/ui/async-await/in-trait/return-type-suggestion.stderr)4
-rw-r--r--tests/ui/async-await/in-trait/return-type-suggestion.next.stderr23
-rw-r--r--tests/ui/async-await/in-trait/return-type-suggestion.rs2
-rw-r--r--tests/ui/async-await/issue-108572.rs12
-rw-r--r--tests/ui/async-await/issue-108572.stderr12
-rw-r--r--tests/ui/async-await/large_moves.attribute.stderr22
-rw-r--r--tests/ui/async-await/large_moves.option.stderr22
-rw-r--r--tests/ui/async-await/large_moves.rs2
-rw-r--r--tests/ui/async-await/missed-capture-issue-107414.rs24
-rw-r--r--tests/ui/async-await/no-const-async.rs1
-rw-r--r--tests/ui/async-await/no-const-async.stderr33
-rw-r--r--tests/ui/async-await/pin-needed-to-poll-2.stderr3
-rw-r--r--tests/ui/async-await/task-context-arg.rs25
-rw-r--r--tests/ui/async-await/track-caller/async-block.rs4
-rw-r--r--tests/ui/async-await/track-caller/async-block.stderr14
-rw-r--r--tests/ui/async-await/track-caller/panic-track-caller.rs13
-rw-r--r--tests/ui/attributes/issue-105594-invalid-attr-validation.rs2
-rw-r--r--tests/ui/attributes/no-mangle-closure.rs11
-rw-r--r--tests/ui/attributes/no-mangle-closure.stderr8
-rw-r--r--tests/ui/auto-traits/suspicious-negative-impls-lint.rs21
-rw-r--r--tests/ui/auto-traits/suspicious-negative-impls-lint.stderr52
-rw-r--r--tests/ui/autoref-autoderef/issue-38940.rs52
-rw-r--r--tests/ui/autoref-autoderef/issue-38940.stderr23
-rw-r--r--tests/ui/auxiliary/issue-13560-1.rs (renamed from tests/ui-fulldeps/auxiliary/issue-13560-1.rs)0
-rw-r--r--tests/ui/auxiliary/issue-13560-2.rs (renamed from tests/ui-fulldeps/auxiliary/issue-13560-2.rs)0
-rw-r--r--tests/ui/auxiliary/issue-13560-3.rs (renamed from tests/ui-fulldeps/auxiliary/issue-13560-3.rs)0
-rw-r--r--tests/ui/auxiliary/issue-16822.rs (renamed from tests/ui-fulldeps/auxiliary/issue-16822.rs)0
-rw-r--r--tests/ui/auxiliary/issue-18502.rs (renamed from tests/ui-fulldeps/auxiliary/issue-18502.rs)0
-rw-r--r--tests/ui/auxiliary/issue-24106.rs (renamed from tests/ui-fulldeps/auxiliary/issue-24106.rs)0
-rw-r--r--tests/ui/binding/issue-53114-safety-checks.rs16
-rw-r--r--tests/ui/binding/issue-53114-safety-checks.stderr72
-rw-r--r--tests/ui/binding/optional_comma_in_match_arm.rs1
-rw-r--r--tests/ui/binop/issue-28837.stderr18
-rw-r--r--tests/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr10
-rw-r--r--tests/ui/borrowck/borrowck-pat-enum.rs1
-rw-r--r--tests/ui/borrowck/borrowck-vec-pattern-nesting.rs2
-rw-r--r--tests/ui/borrowck/borrowck-vec-pattern-nesting.stderr18
-rw-r--r--tests/ui/borrowck/drop-in-loop.rs24
-rw-r--r--tests/ui/borrowck/drop-in-loop.stderr14
-rw-r--r--tests/ui/borrowck/issue-45199.rs3
-rw-r--r--tests/ui/borrowck/issue-45199.stderr4
-rw-r--r--tests/ui/borrowck/issue-58776-borrowck-scans-children.rs1
-rw-r--r--tests/ui/borrowck/issue-58776-borrowck-scans-children.stderr19
-rw-r--r--tests/ui/borrowck/issue-64453.stderr2
-rw-r--r--tests/ui/borrowck/issue-70919-drop-in-loop.rs25
-rw-r--r--tests/ui/borrowck/let_underscore_temporary.rs27
-rw-r--r--tests/ui/box/unit/expr-block-generic-unique1.rs (renamed from tests/ui/expr-block-generic-unique1.rs)0
-rw-r--r--tests/ui/box/unit/expr-block-generic-unique2.rs (renamed from tests/ui/expr-block-generic-unique2.rs)0
-rw-r--r--tests/ui/box/unit/expr-if-unique.rs (renamed from tests/ui/expr-if-unique.rs)0
-rw-r--r--tests/ui/box/unit/unique-assign-copy.rs (renamed from tests/ui/unique/unique-assign-copy.rs)0
-rw-r--r--tests/ui/box/unit/unique-assign-drop.rs (renamed from tests/ui/unique/unique-assign-drop.rs)0
-rw-r--r--tests/ui/box/unit/unique-assign-generic.rs (renamed from tests/ui/unique/unique-assign-generic.rs)0
-rw-r--r--tests/ui/box/unit/unique-assign.rs (renamed from tests/ui/unique/unique-assign.rs)0
-rw-r--r--tests/ui/box/unit/unique-autoderef-field.rs (renamed from tests/ui/unique/unique-autoderef-field.rs)0
-rw-r--r--tests/ui/box/unit/unique-autoderef-index.rs (renamed from tests/ui/unique/unique-autoderef-index.rs)0
-rw-r--r--tests/ui/box/unit/unique-cmp.rs (renamed from tests/ui/unique/unique-cmp.rs)0
-rw-r--r--tests/ui/box/unit/unique-containing-tag.rs (renamed from tests/ui/unique/unique-containing-tag.rs)0
-rw-r--r--tests/ui/box/unit/unique-create.rs (renamed from tests/ui/unique/unique-create.rs)0
-rw-r--r--tests/ui/box/unit/unique-decl-init-copy.rs (renamed from tests/ui/unique/unique-decl-init-copy.rs)0
-rw-r--r--tests/ui/box/unit/unique-decl-init.rs (renamed from tests/ui/unique/unique-decl-init.rs)0
-rw-r--r--tests/ui/box/unit/unique-decl-move.rs (renamed from tests/ui/unique/unique-decl-move.rs)0
-rw-r--r--tests/ui/box/unit/unique-decl.rs (renamed from tests/ui/unique/unique-decl.rs)0
-rw-r--r--tests/ui/box/unit/unique-deref.rs (renamed from tests/ui/unique/unique-deref.rs)0
-rw-r--r--tests/ui/box/unit/unique-destructure.rs (renamed from tests/ui/unique/unique-destructure.rs)0
-rw-r--r--tests/ui/box/unit/unique-drop-complex.rs (renamed from tests/ui/unique/unique-drop-complex.rs)0
-rw-r--r--tests/ui/box/unit/unique-ffi-symbols.rs (renamed from tests/ui/unique/unique-ffi-symbols.rs)0
-rw-r--r--tests/ui/box/unit/unique-fn-arg-move.rs (renamed from tests/ui/unique/unique-fn-arg-move.rs)0
-rw-r--r--tests/ui/box/unit/unique-fn-arg-mut.rs (renamed from tests/ui/unique/unique-fn-arg-mut.rs)0
-rw-r--r--tests/ui/box/unit/unique-fn-arg.rs (renamed from tests/ui/unique/unique-fn-arg.rs)0
-rw-r--r--tests/ui/box/unit/unique-fn-ret.rs (renamed from tests/ui/unique/unique-fn-ret.rs)0
-rw-r--r--tests/ui/box/unit/unique-generic-assign.rs (renamed from tests/ui/unique/unique-generic-assign.rs)0
-rw-r--r--tests/ui/box/unit/unique-in-tag.rs (renamed from tests/ui/unique/unique-in-tag.rs)0
-rw-r--r--tests/ui/box/unit/unique-in-vec-copy.rs (renamed from tests/ui/unique/unique-in-vec-copy.rs)0
-rw-r--r--tests/ui/box/unit/unique-in-vec.rs (renamed from tests/ui/unique/unique-in-vec.rs)0
-rw-r--r--tests/ui/box/unit/unique-init.rs (renamed from tests/ui/unique/unique-init.rs)0
-rw-r--r--tests/ui/box/unit/unique-kinds.rs (renamed from tests/ui/unique/unique-kinds.rs)0
-rw-r--r--tests/ui/box/unit/unique-log.rs (renamed from tests/ui/unique/unique-log.rs)0
-rw-r--r--tests/ui/box/unit/unique-match-discrim.rs (renamed from tests/ui/unique/unique-match-discrim.rs)0
-rw-r--r--tests/ui/box/unit/unique-move-drop.rs (renamed from tests/ui/unique/unique-move-drop.rs)0
-rw-r--r--tests/ui/box/unit/unique-move-temp.rs (renamed from tests/ui/unique/unique-move-temp.rs)0
-rw-r--r--tests/ui/box/unit/unique-move.rs (renamed from tests/ui/unique/unique-move.rs)0
-rw-r--r--tests/ui/box/unit/unique-mutable.rs (renamed from tests/ui/unique/unique-mutable.rs)0
-rw-r--r--tests/ui/box/unit/unique-object-move.rs (renamed from tests/ui/unique/unique-object-move.rs)0
-rw-r--r--tests/ui/box/unit/unique-object-noncopyable.rs (renamed from tests/ui/unique-object-noncopyable.rs)0
-rw-r--r--tests/ui/box/unit/unique-object-noncopyable.stderr (renamed from tests/ui/unique-object-noncopyable.stderr)0
-rw-r--r--tests/ui/box/unit/unique-pat-2.rs (renamed from tests/ui/unique/unique-pat-2.rs)0
-rw-r--r--tests/ui/box/unit/unique-pat-3.rs (renamed from tests/ui/unique/unique-pat-3.rs)0
-rw-r--r--tests/ui/box/unit/unique-pat.rs (renamed from tests/ui/unique/unique-pat.rs)0
-rw-r--r--tests/ui/box/unit/unique-pinned-nocopy.rs (renamed from tests/ui/unique-pinned-nocopy.rs)0
-rw-r--r--tests/ui/box/unit/unique-pinned-nocopy.stderr (renamed from tests/ui/unique-pinned-nocopy.stderr)3
-rw-r--r--tests/ui/box/unit/unique-rec.rs (renamed from tests/ui/unique/unique-rec.rs)0
-rw-r--r--tests/ui/box/unit/unique-send-2.rs (renamed from tests/ui/unique/unique-send-2.rs)0
-rw-r--r--tests/ui/box/unit/unique-send.rs (renamed from tests/ui/unique/unique-send.rs)0
-rw-r--r--tests/ui/box/unit/unique-swap.rs (renamed from tests/ui/unique/unique-swap.rs)0
-rw-r--r--tests/ui/box/unit/unwind-unique.rs (renamed from tests/ui/unwind-unique.rs)0
-rw-r--r--tests/ui/cfg/auxiliary/cfg_false_lib.rs6
-rw-r--r--tests/ui/cfg/cfg-false-feature.rs20
-rw-r--r--tests/ui/cfg/cfg-false-feature.stderr35
-rw-r--r--tests/ui/cfg/cfg_false_no_std.rs11
-rw-r--r--tests/ui/chalkify/bugs/async.rs2
-rw-r--r--tests/ui/chalkify/bugs/async.stderr51
-rw-r--r--tests/ui/check-cfg/compact-values.stderr2
-rw-r--r--tests/ui/check-cfg/my-awesome-platform.json12
-rw-r--r--tests/ui/check-cfg/values-target-json.rs21
-rw-r--r--tests/ui/check-cfg/values-target-json.stderr13
-rw-r--r--tests/ui/check-static-values-constraints.rs73
-rw-r--r--tests/ui/check-static-values-constraints.stderr158
-rw-r--r--tests/ui/closures/2229_closure_analysis/array_subslice.rs13
-rw-r--r--tests/ui/closures/2229_closure_analysis/array_subslice.stderr26
-rw-r--r--tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs18
-rw-r--r--tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.stderr14
-rw-r--r--tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs31
-rw-r--r--tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.stderr15
-rw-r--r--tests/ui/closures/issue-109188.rs22
-rw-r--r--tests/ui/closures/issue-109188.stderr19
-rw-r--r--tests/ui/closures/self-supertrait-bounds.rs14
-rw-r--r--tests/ui/codegen/mono-impossible-2.rs19
-rw-r--r--tests/ui/codegen/mono-impossible.rs13
-rw-r--r--tests/ui/coercion/coerce-expect-unsized-ascribed.rs17
-rw-r--r--tests/ui/coercion/coerce-expect-unsized-ascribed.stderr58
-rw-r--r--tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs2
-rw-r--r--tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr18
-rw-r--r--tests/ui/coherence/coherence-impls-copy.stderr6
-rw-r--r--tests/ui/coherence/coherence-orphan.rs5
-rw-r--r--tests/ui/coherence/coherence-orphan.stderr15
-rw-r--r--tests/ui/coherence/coherence_inherent.stderr2
-rw-r--r--tests/ui/coherence/coherence_inherent_cc.stderr2
-rw-r--r--tests/ui/coherence/deep-bad-copy-reason.rs2
-rw-r--r--tests/ui/coherence/deep-bad-copy-reason.stderr2
-rw-r--r--tests/ui/coherence/illegal-copy-bad-projection.rs16
-rw-r--r--tests/ui/coherence/illegal-copy-bad-projection.stderr9
-rw-r--r--tests/ui/command/command-exec.rs1
-rw-r--r--tests/ui/conditional-compilation/cfg-attr-multi-true.stderr4
-rw-r--r--tests/ui/const-generics/bad-generic-in-copy-impl.rs9
-rw-r--r--tests/ui/const-generics/bad-generic-in-copy-impl.stderr9
-rw-r--r--tests/ui/const-generics/bad-subst-const-kind.rs13
-rw-r--r--tests/ui/const-generics/bad-subst-const-kind.stderr9
-rw-r--r--tests/ui/const-generics/const-arg-in-const-arg.full.stderr17
-rw-r--r--tests/ui/const-generics/const-arg-in-const-arg.min.stderr18
-rw-r--r--tests/ui/const-generics/defaults/doesnt_infer.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr8
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-94287.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/mismatched-gat-subst-kind.rs11
-rw-r--r--tests/ui/const-generics/generic_const_exprs/mismatched-gat-subst-kind.stderr18
-rw-r--r--tests/ui/const-generics/generic_const_exprs/typeid-equality-by-subtyping.rs52
-rw-r--r--tests/ui/const-generics/issue-93647.rs1
-rw-r--r--tests/ui/const-generics/issue-93647.stderr19
-rw-r--r--tests/ui/const-generics/issues/issue-82956.stderr8
-rw-r--r--tests/ui/const-generics/transmute-fail.rs35
-rw-r--r--tests/ui/const-generics/transmute-fail.stderr52
-rw-r--r--tests/ui/const-generics/transmute.rs83
-rw-r--r--tests/ui/const-generics/transmute_no_gate.rs91
-rw-r--r--tests/ui/const-generics/transmute_no_gate.stderr84
-rw-r--r--tests/ui/const-generics/type_mismatch.rs1
-rw-r--r--tests/ui/const-generics/type_mismatch.stderr18
-rw-r--r--tests/ui/const-generics/type_not_in_scope.rs1
-rw-r--r--tests/ui/const-generics/type_not_in_scope.stderr14
-rw-r--r--tests/ui/const-ptr/out_of_bounds_read.stderr6
-rw-r--r--tests/ui/const_prop/issue-86351.rs22
-rw-r--r--tests/ui/const_prop/unreachable-bounds.rs6
-rw-r--r--tests/ui/const_prop/unreachable-overflow.rs10
-rw-r--r--tests/ui/consts/const-block-const-bound.stderr38
-rw-r--r--tests/ui/consts/const-blocks/fn-call-in-non-const.stderr3
-rw-r--r--tests/ui/consts/const-blocks/migrate-fail.stderr6
-rw-r--r--tests/ui/consts/const-blocks/nll-fail.stderr6
-rw-r--r--tests/ui/consts/const-err-late.stderr6
-rw-r--r--tests/ui/consts/const-eval/const-eval-overflow-2.rs1
-rw-r--r--tests/ui/consts/const-eval/const-eval-overflow-2.stderr8
-rw-r--r--tests/ui/consts/const-eval/format.rs3
-rw-r--r--tests/ui/consts/const-eval/format.stderr35
-rw-r--r--tests/ui/consts/const-eval/issue-44578.stderr8
-rw-r--r--tests/ui/consts/const-eval/panic-assoc-never-type.rs2
-rw-r--r--tests/ui/consts/const-eval/ref_to_int_match.32bit.stderr10
-rw-r--r--tests/ui/consts/const-eval/ref_to_int_match.64bit.stderr10
-rw-r--r--tests/ui/consts/const-eval/ref_to_int_match.rs1
-rw-r--r--tests/ui/consts/const-eval/transmute-size-mismatch.rs24
-rw-r--r--tests/ui/consts/const-eval/transmute-size-mismatch.stderr37
-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-ref-ptr.stderr24
-rw-r--r--tests/ui/consts/const-eval/ub-slice-get-unchecked.rs9
-rw-r--r--tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr18
-rw-r--r--tests/ui/consts/const-eval/ub-uninhabit.rs4
-rw-r--r--tests/ui/consts/const-eval/ub-uninhabit.stderr18
-rw-r--r--tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr11
-rw-r--r--tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr11
-rw-r--r--tests/ui/consts/const-eval/validate_uninhabited_zsts.rs2
-rw-r--r--tests/ui/consts/const-fn-error.rs1
-rw-r--r--tests/ui/consts/const-fn-error.stderr19
-rw-r--r--tests/ui/consts/const-for.rs1
-rw-r--r--tests/ui/consts/const-for.stderr18
-rw-r--r--tests/ui/consts/const-match-check.eval1.stderr4
-rw-r--r--tests/ui/consts/const-match-check.eval2.stderr4
-rw-r--r--tests/ui/consts/const-match-check.matchck.stderr16
-rw-r--r--tests/ui/consts/const-pattern-irrefutable.stderr15
-rw-r--r--tests/ui/consts/const_in_pattern/cross-crate-fail.stderr6
-rw-r--r--tests/ui/consts/const_in_pattern/custom-eq-branch-warn.rs2
-rw-r--r--tests/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr2
-rw-r--r--tests/ui/consts/const_in_pattern/incomplete-slice.stderr4
-rw-r--r--tests/ui/consts/const_in_pattern/issue-78057.stderr3
-rw-r--r--tests/ui/consts/const_in_pattern/no-eq-branch-fail.stderr3
-rw-r--r--tests/ui/consts/const_in_pattern/reject_non_partial_eq.stderr3
-rw-r--r--tests/ui/consts/const_in_pattern/reject_non_structural.rs22
-rw-r--r--tests/ui/consts/const_in_pattern/reject_non_structural.stderr52
-rw-r--r--tests/ui/consts/const_in_pattern/warn_corner_cases.stderr6
-rw-r--r--tests/ui/consts/invalid-inline-const-in-match-arm.rs1
-rw-r--r--tests/ui/consts/invalid-inline-const-in-match-arm.stderr19
-rw-r--r--tests/ui/consts/issue-28113.rs1
-rw-r--r--tests/ui/consts/issue-28113.stderr19
-rw-r--r--tests/ui/consts/issue-43105.rs1
-rw-r--r--tests/ui/consts/issue-43105.stderr8
-rw-r--r--tests/ui/consts/issue-56164.rs1
-rw-r--r--tests/ui/consts/issue-56164.stderr21
-rw-r--r--tests/ui/consts/issue-64506.rs3
-rw-r--r--tests/ui/consts/issue-64506.stderr9
-rw-r--r--tests/ui/consts/issue-68542-closure-in-array-len.rs1
-rw-r--r--tests/ui/consts/issue-68542-closure-in-array-len.stderr19
-rw-r--r--tests/ui/consts/issue-73976-polymorphic.rs2
-rw-r--r--tests/ui/consts/issue-73976-polymorphic.stderr16
-rw-r--r--tests/ui/consts/issue-78655.rs1
-rw-r--r--tests/ui/consts/issue-78655.stderr8
-rw-r--r--tests/ui/consts/issue-79137-toogeneric.rs1
-rw-r--r--tests/ui/consts/issue-79137-toogeneric.stderr8
-rw-r--r--tests/ui/consts/issue-miri-1910.stderr2
-rw-r--r--tests/ui/consts/match_ice.stderr3
-rw-r--r--tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr6
-rw-r--r--tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs3
-rw-r--r--tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr11
-rw-r--r--tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr6
-rw-r--r--tests/ui/consts/miri_unleashed/assoc_const.stderr6
-rw-r--r--tests/ui/consts/miri_unleashed/assoc_const_2.stderr6
-rw-r--r--tests/ui/consts/miri_unleashed/box.rs5
-rw-r--r--tests/ui/consts/miri_unleashed/box.stderr29
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr32
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr32
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs4
-rw-r--r--tests/ui/consts/miri_unleashed/tls.stderr4
-rw-r--r--tests/ui/consts/offset_from_ub.stderr6
-rw-r--r--tests/ui/consts/uninhabited-const-issue-61744.stderr6
-rw-r--r--tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr9
-rw-r--r--tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr14
-rw-r--r--tests/ui/derived-errors/issue-31997-1.stderr2
-rw-r--r--tests/ui/derives/derive-assoc-type-not-impl.stderr3
-rw-r--r--tests/ui/derives/derives-span-Clone-enum-struct-variant.stderr3
-rw-r--r--tests/ui/derives/derives-span-Clone-enum.stderr3
-rw-r--r--tests/ui/derives/derives-span-Clone-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Clone-tuple-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Debug-enum-struct-variant.stderr3
-rw-r--r--tests/ui/derives/derives-span-Debug-enum.stderr3
-rw-r--r--tests/ui/derives/derives-span-Debug-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Debug-tuple-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Default-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Default-tuple-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Eq-enum-struct-variant.stderr3
-rw-r--r--tests/ui/derives/derives-span-Eq-enum.stderr3
-rw-r--r--tests/ui/derives/derives-span-Eq-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Eq-tuple-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Hash-enum-struct-variant.stderr3
-rw-r--r--tests/ui/derives/derives-span-Hash-enum.stderr3
-rw-r--r--tests/ui/derives/derives-span-Hash-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Hash-tuple-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Ord-enum-struct-variant.stderr3
-rw-r--r--tests/ui/derives/derives-span-Ord-enum.stderr3
-rw-r--r--tests/ui/derives/derives-span-Ord-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-Ord-tuple-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr3
-rw-r--r--tests/ui/derives/derives-span-PartialEq-enum.stderr3
-rw-r--r--tests/ui/derives/derives-span-PartialEq-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-PartialEq-tuple-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr3
-rw-r--r--tests/ui/derives/derives-span-PartialOrd-enum.stderr3
-rw-r--r--tests/ui/derives/derives-span-PartialOrd-struct.stderr3
-rw-r--r--tests/ui/derives/derives-span-PartialOrd-tuple-struct.stderr3
-rw-r--r--tests/ui/derives/deriving-no-inner-impl-error-message.stderr6
-rw-r--r--tests/ui/derives/deriving-with-repr-packed-2.stderr3
-rw-r--r--tests/ui/derives/issue-91492.stderr9
-rw-r--r--tests/ui/derives/issue-91550.stderr12
-rw-r--r--tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs6
-rw-r--r--tests/ui/diagnostic-width/tab-column-numbers.rs12
-rw-r--r--tests/ui/diagnostic-width/tab-column-numbers.stderr14
-rw-r--r--tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr8
-rw-r--r--tests/ui/did_you_mean/recursion_limit.stderr7
-rw-r--r--tests/ui/did_you_mean/recursion_limit_deref.stderr6
-rw-r--r--tests/ui/dst/issue-90528-unsizing-suggestion-1.rs20
-rw-r--r--tests/ui/dst/issue-90528-unsizing-suggestion-1.stderr56
-rw-r--r--tests/ui/dst/issue-90528-unsizing-suggestion-2.rs28
-rw-r--r--tests/ui/dst/issue-90528-unsizing-suggestion-2.stderr94
-rw-r--r--tests/ui/dst/issue-90528-unsizing-suggestion-3.rs22
-rw-r--r--tests/ui/dst/issue-90528-unsizing-suggestion-3.stderr75
-rw-r--r--tests/ui/dst/issue-90528-unsizing-suggestion-4.rs26
-rw-r--r--tests/ui/dst/issue-90528-unsizing-suggestion-4.stderr79
-rw-r--r--tests/ui/dyn-star/align.normal.stderr13
-rw-r--r--tests/ui/dyn-star/align.over_aligned.stderr6
-rw-r--r--tests/ui/dyn-star/align.rs3
-rw-r--r--tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs2
-rw-r--r--tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr2
-rw-r--r--tests/ui/dyn-star/check-size-at-cast.rs2
-rw-r--r--tests/ui/dyn-star/check-size-at-cast.stderr2
-rw-r--r--tests/ui/dyn-star/const-and-static.rs10
-rw-r--r--tests/ui/dyn-star/const-and-static.stderr11
-rw-r--r--tests/ui/dyn-star/feature-gate-dyn_star.rs2
-rw-r--r--tests/ui/dyn-star/feature-gate-dyn_star.stderr4
-rw-r--r--tests/ui/dyn-star/gated-span.rs8
-rw-r--r--tests/ui/dyn-star/gated-span.stderr12
-rw-r--r--tests/ui/dyn-star/no-explicit-dyn-star-cast.rs4
-rw-r--r--tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr8
-rw-r--r--tests/ui/dyn-star/upcast.stderr2
-rw-r--r--tests/ui/empty/empty-struct-tuple-pat.stderr4
-rw-r--r--tests/ui/enum-discriminant/auxiliary/discr-foreign-dep.rs7
-rw-r--r--tests/ui/enum-discriminant/discr-foreign.rs11
-rw-r--r--tests/ui/enum-discriminant/issue-104519.rs10
-rw-r--r--tests/ui/enum-discriminant/issue-61696.rs (renamed from tests/ui/issues/issue-61696.rs)21
-rw-r--r--tests/ui/error-codes/E0004.stderr2
-rw-r--r--tests/ui/error-codes/E0010-teach.rs5
-rw-r--r--tests/ui/error-codes/E0010-teach.stderr21
-rw-r--r--tests/ui/error-codes/E0010.rs5
-rw-r--r--tests/ui/error-codes/E0010.stderr22
-rw-r--r--tests/ui/error-codes/E0030-teach.rs1
-rw-r--r--tests/ui/error-codes/E0030-teach.stderr8
-rw-r--r--tests/ui/error-codes/E0030.rs1
-rw-r--r--tests/ui/error-codes/E0030.stderr8
-rw-r--r--tests/ui/error-codes/E0184.stderr2
-rw-r--r--tests/ui/error-codes/E0206.rs2
-rw-r--r--tests/ui/error-codes/E0206.stderr2
-rw-r--r--tests/ui/error-codes/E0275.stderr2
-rw-r--r--tests/ui/error-codes/E0277-3.stderr3
-rw-r--r--tests/ui/error-codes/E0449.stderr16
-rw-r--r--tests/ui/exclusive-drop-and-copy.rs4
-rw-r--r--tests/ui/exclusive-drop-and-copy.stderr4
-rw-r--r--tests/ui/extenv/extenv-no-args.rs2
-rw-r--r--tests/ui/extenv/extenv-no-args.stderr2
-rw-r--r--tests/ui/extenv/extenv-too-many-args.rs2
-rw-r--r--tests/ui/extenv/extenv-too-many-args.stderr2
-rw-r--r--tests/ui/extenv/issue-55897.stderr2
-rw-r--r--tests/ui/extern-mod-syntax.rs11
-rw-r--r--tests/ui/feature-gates/feature-gate-box-expr.rs14
-rw-r--r--tests/ui/feature-gates/feature-gate-box-expr.stderr12
-rw-r--r--tests/ui/feature-gates/feature-gate-box_syntax.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-box_syntax.stderr12
-rw-r--r--tests/ui/feature-gates/feature-gate-closure_track_caller.rs2
-rw-r--r--tests/ui/feature-gates/feature-gate-closure_track_caller.stderr15
-rw-r--r--tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs18
-rw-r--r--tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.stderr30
-rw-r--r--tests/ui/feature-gates/feature-gate-link_cfg.stderr1
-rw-r--r--tests/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr4
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.cfg.stderr36
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.no.stderr22
-rw-r--r--tests/ui/feature-gates/feature-gate-return_type_notation.rs22
-rw-r--r--tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr6
-rw-r--r--tests/ui/feature-gates/test-listing-format-json.rs18
-rw-r--r--tests/ui/feature-gates/test-listing-format-json.run.stderr1
-rw-r--r--tests/ui/fmt/auxiliary/format-string-proc-macro.rs36
-rw-r--r--tests/ui/fmt/format-args-argument-span.rs22
-rw-r--r--tests/ui/fmt/format-args-argument-span.stderr53
-rw-r--r--tests/ui/fmt/format-args-capture-first-literal-is-macro.rs21
-rw-r--r--tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr30
-rw-r--r--tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs8
-rw-r--r--tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr12
-rw-r--r--tests/ui/fmt/format-args-capture-issue-106408.rs10
-rw-r--r--tests/ui/fmt/format-args-capture-macro-hygiene-pass.rs16
-rw-r--r--tests/ui/fmt/ifmt-bad-arg.stderr14
-rw-r--r--tests/ui/fmt/ifmt-unimpl.stderr4
-rw-r--r--tests/ui/fmt/respanned-literal-issue-106191.rs9
-rw-r--r--tests/ui/fmt/respanned-literal-issue-106191.stderr21
-rw-r--r--tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs10
-rw-r--r--tests/ui/fn/fn-ptr-trait.rs9
-rw-r--r--tests/ui/fn/issue-39259.rs13
-rw-r--r--tests/ui/fn/issue-39259.stderr15
-rw-r--r--tests/ui/generator/clone-impl.stderr6
-rw-r--r--tests/ui/generator/issue-105084.drop_tracking_mir.stderr16
-rw-r--r--tests/ui/generator/issue-105084.rs5
-rw-r--r--tests/ui/generator/issue-87142.rs2
-rw-r--r--tests/ui/generator/non-static-is-unpin.rs2
-rw-r--r--tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr8
-rw-r--r--tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr8
-rw-r--r--tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr8
-rw-r--r--tests/ui/generator/static-not-unpin.current.stderr (renamed from tests/ui/generator/static-not-unpin.stderr)11
-rw-r--r--tests/ui/generator/static-not-unpin.next.stderr19
-rw-r--r--tests/ui/generator/static-not-unpin.rs3
-rw-r--r--tests/ui/generator/yield-in-box.rs24
-rw-r--r--tests/ui/generator/yield-in-box.stderr17
-rw-r--r--tests/ui/generic-associated-types/bugs/issue-100013.stderr8
-rw-r--r--tests/ui/generic-associated-types/gat-bounds-normalize-pred.rs17
-rw-r--r--tests/ui/generic-associated-types/issue-86218-2.rs6
-rw-r--r--tests/ui/generic-associated-types/issue-86218.rs6
-rw-r--r--tests/ui/generic-associated-types/issue-87258_a.rs2
-rw-r--r--tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr3
-rw-r--r--tests/ui/generic-associated-types/issue-87429-specialization.stderr3
-rw-r--r--tests/ui/generic-associated-types/issue-88595.rs3
-rw-r--r--tests/ui/generic-associated-types/issue-88595.stderr4
-rw-r--r--tests/ui/generic-associated-types/issue-89008.rs2
-rw-r--r--tests/ui/generic-associated-types/issue-90014.rs6
-rw-r--r--tests/ui/generic-associated-types/issue-90014.stderr6
-rw-r--r--tests/ui/generics/auxiliary/foreign-generic-mismatch.rs3
-rw-r--r--tests/ui/generics/foreign-generic-mismatch.rs10
-rw-r--r--tests/ui/generics/foreign-generic-mismatch.stderr35
-rw-r--r--tests/ui/generics/slightly-nice-generic-literal-messages.rs (renamed from tests/ui/slightly-nice-generic-literal-messages.rs)0
-rw-r--r--tests/ui/generics/slightly-nice-generic-literal-messages.stderr (renamed from tests/ui/slightly-nice-generic-literal-messages.stderr)0
-rw-r--r--tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs13
-rw-r--r--tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr102
-rw-r--r--tests/ui/higher-rank-trait-bounds/fn-ptr.classic.stderr19
-rw-r--r--tests/ui/higher-rank-trait-bounds/fn-ptr.rs14
-rw-r--r--tests/ui/higher-rank-trait-bounds/issue-95230.new.stderr19
-rw-r--r--tests/ui/higher-rank-trait-bounds/issue-95230.rs6
-rw-r--r--tests/ui/hygiene/arguments.rs2
-rw-r--r--tests/ui/hygiene/arguments.stderr2
-rw-r--r--tests/ui/hygiene/assoc_item_ctxt.rs2
-rw-r--r--tests/ui/hygiene/assoc_item_ctxt.stderr4
-rw-r--r--tests/ui/hygiene/assoc_ty_bindings.rs1
-rw-r--r--tests/ui/hygiene/auxiliary/legacy_interaction.rs2
-rw-r--r--tests/ui/hygiene/fields.rs2
-rw-r--r--tests/ui/hygiene/fields.stderr8
-rw-r--r--tests/ui/hygiene/generic_params.rs1
-rw-r--r--tests/ui/hygiene/globs.stderr4
-rw-r--r--tests/ui/hygiene/impl_items.rs2
-rw-r--r--tests/ui/hygiene/impl_items.stderr2
-rw-r--r--tests/ui/hygiene/intercrate.rs2
-rw-r--r--tests/ui/hygiene/intercrate.stderr2
-rw-r--r--tests/ui/hygiene/issue-47311.rs1
-rw-r--r--tests/ui/hygiene/issue-47312.rs1
-rw-r--r--tests/ui/hygiene/items.rs1
-rw-r--r--tests/ui/hygiene/legacy_interaction.rs1
-rw-r--r--tests/ui/hygiene/lexical.rs1
-rw-r--r--tests/ui/hygiene/no_implicit_prelude.stderr4
-rw-r--r--tests/ui/hygiene/panic-location.run.stderr2
-rw-r--r--tests/ui/hygiene/specialization.rs1
-rw-r--r--tests/ui/hygiene/trait_items-2.rs1
-rw-r--r--tests/ui/hygiene/trait_items.stderr2
-rw-r--r--tests/ui/hygiene/wrap_unhygienic_example.rs1
-rw-r--r--tests/ui/hygiene/xcrate.rs1
-rw-r--r--tests/ui/impl-trait/associated-impl-trait-type-generic-trait.rs2
-rw-r--r--tests/ui/impl-trait/associated-impl-trait-type-trivial.rs2
-rw-r--r--tests/ui/impl-trait/associated-impl-trait-type.rs2
-rw-r--r--tests/ui/impl-trait/auto-trait-leak.stderr10
-rw-r--r--tests/ui/impl-trait/impl-fn-hrtb-bounds-2.stderr2
-rw-r--r--tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs9
-rw-r--r--tests/ui/impl-trait/in-trait/box-coerce-span-in-default.current.stderr (renamed from tests/ui/impl-trait/in-trait/box-coerce-span-in-default.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/box-coerce-span-in-default.next.stderr11
-rw-r--r--tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match-works.rs6
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match.current.stderr (renamed from tests/ui/impl-trait/in-trait/deep-match.stderr)4
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match.next.stderr15
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match.rs9
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr (renamed from tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr11
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err-2.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr (renamed from tests/ui/impl-trait/in-trait/default-body-type-err.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr24
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr24
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.rs4
-rw-r--r--tests/ui/impl-trait/in-trait/default-body.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/default-method-binder-shifting.current.stderr11
-rw-r--r--tests/ui/impl-trait/in-trait/default-method-binder-shifting.next.stderr11
-rw-r--r--tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs22
-rw-r--r--tests/ui/impl-trait/in-trait/default-method-constraint.current.stderr (renamed from tests/ui/impl-trait/in-trait/default-method-constraint.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/default-method-constraint.next.stderr11
-rw-r--r--tests/ui/impl-trait/in-trait/default-method-constraint.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr (renamed from tests/ui/impl-trait/in-trait/doesnt-satisfy.stderr)4
-rw-r--r--tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/doesnt-satisfy.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr21
-rw-r--r--tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr21
-rw-r--r--tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs19
-rw-r--r--tests/ui/impl-trait/in-trait/early.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/encode.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/foreign.rs16
-rw-r--r--tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr (renamed from tests/ui/impl-trait/in-trait/generics-mismatch.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/generics-mismatch.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.current.stderr (renamed from tests/ui/impl-trait/in-trait/issue-102140.stderr)6
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.next.stderr33
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102301.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102571.current.stderr (renamed from tests/ui/impl-trait/in-trait/issue-102571.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102571.next.stderr14
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102571.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/nested-rpitit.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/new-lowering-strategy/simple-trait.rs11
-rw-r--r--tests/ui/impl-trait/in-trait/object-safety.current.stderr (renamed from tests/ui/impl-trait/in-trait/object-safety.stderr)12
-rw-r--r--tests/ui/impl-trait/in-trait/object-safety.next.stderr50
-rw-r--r--tests/ui/impl-trait/in-trait/object-safety.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr (renamed from tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/reveal.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr (renamed from tests/ui/impl-trait/in-trait/signature-mismatch.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr16
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-broken.current.stderr (renamed from tests/ui/impl-trait/in-trait/specialization-broken.stderr)6
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-broken.next.stderr31
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-broken.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-substs-remap.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/success.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr (renamed from tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.current.stderr (renamed from tests/ui/impl-trait/in-trait/wf-bounds.stderr)22
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.next.stderr40
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.rs9
-rw-r--r--tests/ui/impl-trait/in-trait/where-clause.rs2
-rw-r--r--tests/ui/impl-trait/issue-55872-1.rs2
-rw-r--r--tests/ui/impl-trait/issue-55872-2.rs2
-rw-r--r--tests/ui/impl-trait/issue-55872-2.stderr8
-rw-r--r--tests/ui/impl-trait/issue-55872-3.rs2
-rw-r--r--tests/ui/impl-trait/issue-55872.rs2
-rw-r--r--tests/ui/impl-trait/issues/issue-78722.rs1
-rw-r--r--tests/ui/impl-trait/issues/issue-78722.stderr13
-rw-r--r--tests/ui/impl-trait/issues/issue-82139.rs2
-rw-r--r--tests/ui/impl-trait/issues/issue-83919.rs12
-rw-r--r--tests/ui/impl-trait/issues/issue-86719.rs5
-rw-r--r--tests/ui/impl-trait/issues/issue-86719.stderr3
-rw-r--r--tests/ui/impl-trait/issues/issue-87340.rs4
-rw-r--r--tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs (renamed from tests/ui/impl-trait/multiple-lifetimes.rs)0
-rw-r--r--tests/ui/impl-trait/nested-return-type2.rs1
-rw-r--r--tests/ui/impl-trait/nested-return-type2.stderr17
-rw-r--r--tests/ui/impl-trait/nested-return-type3.rs1
-rw-r--r--tests/ui/impl-trait/nested-return-type3.stderr17
-rw-r--r--tests/ui/impl-trait/no-method-suggested-traits.stderr24
-rw-r--r--tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr3
-rw-r--r--tests/ui/impl-trait/type-alias-generic-param.rs2
-rw-r--r--tests/ui/impl-trait/universal_wrong_bounds.stderr4
-rw-r--r--tests/ui/impl-trait/where-allowed.rs4
-rw-r--r--tests/ui/impl-trait/where-allowed.stderr98
-rw-r--r--tests/ui/implied-bounds/ice-unbound-region-vars.rs24
-rw-r--r--tests/ui/implied-bounds/normalization-nested.lifetime.stderr18
-rw-r--r--tests/ui/implied-bounds/normalization-nested.rs39
-rw-r--r--tests/ui/implied-bounds/normalization.rs58
-rw-r--r--tests/ui/imports/auxiliary/glob-conflict.rs2
-rw-r--r--tests/ui/imports/glob-resolve1.stderr2
-rw-r--r--tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs1
-rw-r--r--tests/ui/imports/issue-38293.stderr2
-rw-r--r--tests/ui/imports/issue-4366-2.stderr2
-rw-r--r--tests/ui/imports/issue-4366.stderr2
-rw-r--r--tests/ui/imports/local-modularized-tricky-fail-1.rs1
-rw-r--r--tests/ui/imports/local-modularized-tricky-fail-1.stderr14
-rw-r--r--tests/ui/imports/overlapping_pub_trait.stderr2
-rw-r--r--tests/ui/imports/unnamed_pub_trait.stderr2
-rw-r--r--tests/ui/index_message.rs4
-rw-r--r--tests/ui/index_message.stderr2
-rw-r--r--tests/ui/inference/char-as-str-single.fixed9
-rw-r--r--tests/ui/inference/char-as-str-single.rs9
-rw-r--r--tests/ui/inference/char-as-str-single.stderr15
-rw-r--r--tests/ui/inference/issue-80409.rs36
-rw-r--r--tests/ui/inference/issue-83606.stderr2
-rw-r--r--tests/ui/inference/need_type_info/concrete-impl.rs3
-rw-r--r--tests/ui/inference/need_type_info/concrete-impl.stderr9
-rw-r--r--tests/ui/inference/need_type_info/issue-109905.rs25
-rw-r--r--tests/ui/inference/need_type_info/issue-109905.stderr15
-rw-r--r--tests/ui/infinite/infinite-trait-alias-recursion.stderr17
-rw-r--r--tests/ui/inline-const/const-match-pat-generic.rs2
-rw-r--r--tests/ui/inline-const/const-match-pat-generic.stderr16
-rw-r--r--tests/ui/internal-lints/diagnostics_incorrect.rs (renamed from tests/ui-fulldeps/internal-lints/diagnostics_incorrect.rs)0
-rw-r--r--tests/ui/internal-lints/diagnostics_incorrect.stderr (renamed from tests/ui-fulldeps/internal-lints/diagnostics_incorrect.stderr)0
-rw-r--r--tests/ui/internal-lints/existing_doc_keyword.rs (renamed from tests/ui-fulldeps/internal-lints/existing_doc_keyword.rs)0
-rw-r--r--tests/ui/internal-lints/existing_doc_keyword.stderr (renamed from tests/ui-fulldeps/internal-lints/existing_doc_keyword.stderr)2
-rw-r--r--tests/ui/internal-lints/query_stability_incorrect.rs (renamed from tests/ui-fulldeps/internal-lints/query_stability_incorrect.rs)0
-rw-r--r--tests/ui/internal-lints/query_stability_incorrect.stderr (renamed from tests/ui-fulldeps/internal-lints/query_stability_incorrect.stderr)0
-rw-r--r--tests/ui/internal-lints/rustc_pass_by_value_self.rs (renamed from tests/ui-fulldeps/internal-lints/rustc_pass_by_value_self.rs)0
-rw-r--r--tests/ui/internal-lints/rustc_pass_by_value_self.stderr (renamed from tests/ui-fulldeps/internal-lints/rustc_pass_by_value_self.stderr)0
-rw-r--r--tests/ui/internal/internal-unstable-const.stderr6
-rw-r--r--tests/ui/issue-11881.rs (renamed from tests/ui-fulldeps/issue-11881.rs)0
-rw-r--r--tests/ui/issue-13560.rs (renamed from tests/ui-fulldeps/issue-13560.rs)1
-rw-r--r--tests/ui/issue-15924.rs (renamed from tests/ui-fulldeps/issue-15924.rs)0
-rw-r--r--tests/ui/issue-16822.rs (renamed from tests/ui-fulldeps/issue-16822.rs)0
-rw-r--r--tests/ui/issue-18502.rs (renamed from tests/ui-fulldeps/issue-18502.rs)0
-rw-r--r--tests/ui/issue-24106.rs (renamed from tests/ui-fulldeps/issue-24106.rs)0
-rw-r--r--tests/ui/issue-2804.rs (renamed from tests/ui-fulldeps/issue-2804.rs)0
-rw-r--r--tests/ui/issues/issue-10465.stderr2
-rw-r--r--tests/ui/issues/issue-106755.rs2
-rw-r--r--tests/ui/issues/issue-106755.stderr18
-rw-r--r--tests/ui/issues/issue-11709.rs1
-rw-r--r--tests/ui/issues/issue-12511.stderr12
-rw-r--r--tests/ui/issues/issue-17546.stderr16
-rw-r--r--tests/ui/issues/issue-19086.stderr2
-rw-r--r--tests/ui/issues/issue-20162.stderr3
-rw-r--r--tests/ui/issues/issue-20413.stderr34
-rw-r--r--tests/ui/issues/issue-20772.stderr2
-rw-r--r--tests/ui/issues/issue-21160.stderr3
-rw-r--r--tests/ui/issues/issue-27340.rs2
-rw-r--r--tests/ui/issues/issue-27340.stderr2
-rw-r--r--tests/ui/issues/issue-27842.rs5
-rw-r--r--tests/ui/issues/issue-27842.stderr12
-rw-r--r--tests/ui/issues/issue-28433.rs4
-rw-r--r--tests/ui/issues/issue-28433.stderr10
-rw-r--r--tests/ui/issues/issue-28839.rs1
-rw-r--r--tests/ui/issues/issue-3029.rs2
-rw-r--r--tests/ui/issues/issue-35976.unimported.stderr2
-rw-r--r--tests/ui/issues/issue-37534.stderr2
-rw-r--r--tests/ui/issues/issue-38190.rs1
-rw-r--r--tests/ui/issues/issue-39175.stderr2
-rw-r--r--tests/ui/issues/issue-50403.rs2
-rw-r--r--tests/ui/issues/issue-50403.stderr2
-rw-r--r--tests/ui/issues/issue-56175.stderr4
-rw-r--r--tests/ui/issues/issue-59488.stderr20
-rw-r--r--tests/ui/issues/issue-62375.stderr3
-rw-r--r--tests/ui/issues/issue-66667-function-cmp-cycle.rs3
-rw-r--r--tests/ui/issues/issue-66667-function-cmp-cycle.stderr34
-rw-r--r--tests/ui/issues/issue-77919.stderr2
-rw-r--r--tests/ui/issues/issue-9129.rs1
-rw-r--r--tests/ui/issues/issue-98299.stderr2
-rw-r--r--tests/ui/iterators/into-iter-on-arrays-lint.fixed2
-rw-r--r--tests/ui/iterators/into-iter-on-arrays-lint.rs2
-rw-r--r--tests/ui/kindck/kindck-impl-type-params.stderr3
-rw-r--r--tests/ui/lang-items/no_owned_box_lang_item.rs16
-rw-r--r--tests/ui/lang-items/no_owned_box_lang_item.stderr4
-rw-r--r--tests/ui/late-bound-lifetimes/issue-80618.rs8
-rw-r--r--tests/ui/late-bound-lifetimes/issue-80618.stderr15
-rw-r--r--tests/ui/layout/issue-84108.stderr4
-rw-r--r--tests/ui/layout/transmute-to-tail-with-err.rs8
-rw-r--r--tests/ui/layout/transmute-to-tail-with-err.stderr14
-rw-r--r--tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs1
-rw-r--r--tests/ui/lexer/unterminated-comment.rs (renamed from tests/ui/unterminated-comment.rs)0
-rw-r--r--tests/ui/lexer/unterminated-comment.stderr (renamed from tests/ui/unterminated-comment.stderr)0
-rw-r--r--tests/ui/lexer/unterminated-nested-comment.rs (renamed from tests/ui/unterminated-nested-comment.rs)0
-rw-r--r--tests/ui/lexer/unterminated-nested-comment.stderr (renamed from tests/ui/unterminated-nested-comment.stderr)0
-rw-r--r--tests/ui/lifetimes/issue-93911.rs18
-rw-r--r--tests/ui/lifetimes/issue-95023.stderr6
-rw-r--r--tests/ui/lifetimes/unusual-rib-combinations.rs5
-rw-r--r--tests/ui/lifetimes/unusual-rib-combinations.stderr21
-rw-r--r--tests/ui/limits/issue-55878.stderr8
-rw-r--r--tests/ui/linkage-attr/issue-109144.rs4
-rw-r--r--tests/ui/linkage-attr/issue-109144.stderr9
-rw-r--r--tests/ui/lint/anonymous-reexport.rs19
-rw-r--r--tests/ui/lint/anonymous-reexport.stderr44
-rw-r--r--tests/ui/lint/clashing-extern-fn.rs33
-rw-r--r--tests/ui/lint/clashing-extern-fn.stderr18
-rw-r--r--tests/ui/lint/dead-code/issue-59003.rs18
-rw-r--r--tests/ui/lint/dead-code/issue-85255.rs12
-rw-r--r--tests/ui/lint/dead-code/issue-85255.stderr54
-rw-r--r--tests/ui/lint/dead-code/lint-dead-code-3.stderr14
-rw-r--r--tests/ui/lint/dead-code/lint-dead-code-6.rs9
-rw-r--r--tests/ui/lint/dead-code/lint-dead-code-6.stderr18
-rw-r--r--tests/ui/lint/dead-code/unused-assoc-fns.rs35
-rw-r--r--tests/ui/lint/dead-code/unused-assoc-fns.stderr29
-rw-r--r--tests/ui/lint/fn_must_use.stderr28
-rw-r--r--tests/ui/lint/inline-trait-and-foreign-items.rs2
-rw-r--r--tests/ui/lint/issue-109152.rs7
-rw-r--r--tests/ui/lint/issue-109152.stderr23
-rw-r--r--tests/ui/lint/issue-109529.fixed6
-rw-r--r--tests/ui/lint/issue-109529.rs6
-rw-r--r--tests/ui/lint/issue-109529.stderr23
-rw-r--r--tests/ui/lint/lint-temporary-cstring-as-ptr.rs8
-rw-r--r--tests/ui/lint/lint-temporary-cstring-as-ptr.stderr19
-rw-r--r--tests/ui/lint/no-coverage.rs2
-rw-r--r--tests/ui/lint/unconditional_panic_98444.rs7
-rw-r--r--tests/ui/lint/unconditional_panic_98444.stderr10
-rw-r--r--tests/ui/lint/unused/auxiliary/must-use-foreign.rs12
-rw-r--r--tests/ui/lint/unused/must-use-box-from-raw.stderr4
-rw-r--r--tests/ui/lint/unused/must-use-foreign.rs15
-rw-r--r--tests/ui/lint/unused/must_use-unit.stderr9
-rw-r--r--tests/ui/lint/unused/trait-alias-supertrait.rs15
-rw-r--r--tests/ui/lint/unused/unused-allocation.rs7
-rw-r--r--tests/ui/lint/unused/unused-allocation.stderr20
-rw-r--r--tests/ui/lint/unused/unused-async.rs2
-rw-r--r--tests/ui/lint/unused/unused-async.stderr21
-rw-r--r--tests/ui/lint/unused/unused-result.stderr17
-rw-r--r--tests/ui/lint/unused/unused_attributes-must_use.stderr34
-rw-r--r--tests/ui/lint/use-redundant/issue-92904.rs17
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-glob-parent.rs16
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr17
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-glob.rs15
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-glob.stderr16
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-multiple-namespaces.rs21
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-not-parent.rs19
-rw-r--r--tests/ui/lint/use-redundant/use-redundant.rs (renamed from tests/ui/lint/use-redundant.rs)0
-rw-r--r--tests/ui/lint/use-redundant/use-redundant.stderr (renamed from tests/ui/lint/use-redundant.stderr)0
-rw-r--r--tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs1
-rw-r--r--tests/ui/macros/bad-concat.stderr2
-rw-r--r--tests/ui/macros/concat-bytes-error.stderr8
-rw-r--r--tests/ui/macros/concat.stderr4
-rw-r--r--tests/ui/macros/issue-100199.stderr2
-rw-r--r--tests/ui/macros/issue-106837.rs10
-rw-r--r--tests/ui/macros/issue-106837.stderr18
-rw-r--r--tests/ui/macros/issue-109237.rs7
-rw-r--r--tests/ui/macros/issue-109237.stderr18
-rw-r--r--tests/ui/macros/issue-40469.rs1
-rw-r--r--tests/ui/macros/issue-98790.rs24
-rw-r--r--tests/ui/macros/macro-comma-support-rpass.rs1
-rw-r--r--tests/ui/macros/macro-include-items.rs1
-rw-r--r--tests/ui/macros/macro-outer-attributes.stderr2
-rw-r--r--tests/ui/macros/macro-path-prelude-fail-4.stderr8
-rw-r--r--tests/ui/macros/macro-path-prelude-fail-5.rs10
-rw-r--r--tests/ui/macros/macro-path-prelude-fail-5.stderr30
-rw-r--r--tests/ui/macros/macros-nonfatal-errors.stderr18
-rw-r--r--tests/ui/macros/missing-writer.rs17
-rw-r--r--tests/ui/macros/missing-writer.stderr59
-rw-r--r--tests/ui/macros/nested-use-as.rs83
-rw-r--r--tests/ui/macros/nonterminal-matching.stderr3
-rw-r--r--tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs7
-rw-r--r--tests/ui/macros/stringify.rs4
-rw-r--r--tests/ui/macros/syntax-extension-source-utils.rs7
-rw-r--r--tests/ui/malformed/malformed-derive-entry.stderr6
-rw-r--r--tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs6
-rw-r--r--tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.stderr31
-rw-r--r--tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs14
-rw-r--r--tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.stderr14
-rw-r--r--tests/ui/match/guards-parenthesized-and.rs10
-rw-r--r--tests/ui/match/match-range-fail-2.rs9
-rw-r--r--tests/ui/match/match-range-fail-2.stderr24
-rw-r--r--tests/ui/methods/inherent-bound-in-probe.rs49
-rw-r--r--tests/ui/methods/inherent-bound-in-probe.stderr38
-rw-r--r--tests/ui/methods/method-call-lifetime-args-fail.stderr31
-rw-r--r--tests/ui/methods/method-call-lifetime-args.stderr5
-rw-r--r--tests/ui/mir/addrof_alignment.rs15
-rw-r--r--tests/ui/mir/checks_without_panic_impl.rs17
-rw-r--r--tests/ui/mir/issue-109004-drop-large-array.rs16
-rw-r--r--tests/ui/mir/mir_alignment_check.rs12
-rw-r--r--tests/ui/mir/mir_boxing.rs10
-rw-r--r--tests/ui/mir/unsize-trait.rs15
-rw-r--r--tests/ui/mir/validate/transmute_cast_sized.rs17
-rw-r--r--tests/ui/mismatched_types/method-help-unsatisfied-bound.stderr3
-rw-r--r--tests/ui/missing/missing-items/missing-const-parameter.rs24
-rw-r--r--tests/ui/missing/missing-items/missing-const-parameter.stderr64
-rw-r--r--tests/ui/modules/issue-107649.stderr3
-rw-r--r--tests/ui/modules/mod_dir_implicit.rs1
-rw-r--r--tests/ui/modules/mod_dir_path.rs1
-rw-r--r--tests/ui/modules/mod_dir_path2.rs1
-rw-r--r--tests/ui/modules/mod_dir_path3.rs1
-rw-r--r--tests/ui/modules/mod_dir_path_multi.rs1
-rw-r--r--tests/ui/modules/mod_dir_recursive.rs1
-rw-r--r--tests/ui/modules/mod_dir_simple.rs1
-rw-r--r--tests/ui/modules/mod_file.rs1
-rw-r--r--tests/ui/modules/mod_file_with_path_attr.rs1
-rw-r--r--tests/ui/modules_and_files_visibility/mod_file_disambig_aux/compiletest-ignore-dir0
-rw-r--r--tests/ui/myriad-closures.rs (renamed from tests/ui-fulldeps/myriad-closures.rs)0
-rw-r--r--tests/ui/namespace/namespace-mix.stderr16
-rw-r--r--tests/ui/never_type/exhaustive_patterns.stderr4
-rw-r--r--tests/ui/never_type/issue-52443.rs1
-rw-r--r--tests/ui/never_type/issue-52443.stderr17
-rw-r--r--tests/ui/nll/closure-requirements/escape-argument-callee.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/escape-argument.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr4
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-val.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr2
-rw-r--r--tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr2
-rw-r--r--tests/ui/nll/issue-78561.rs2
-rw-r--r--tests/ui/nll/ty-outlives/impl-trait-captures.stderr8
-rw-r--r--tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr4
-rw-r--r--tests/ui/nll/user-annotations/region-error-ice-109072.rs14
-rw-r--r--tests/ui/nll/user-annotations/region-error-ice-109072.stderr26
-rw-r--r--tests/ui/non_modrs_mods/non_modrs_mods.rs1
-rw-r--r--tests/ui/non_modrs_mods_and_inline_mods/x/y/z/compiletest-ignore-dir0
-rw-r--r--tests/ui/not-clone-closure.stderr3
-rw-r--r--tests/ui/on-unimplemented/no-debug.stderr3
-rw-r--r--tests/ui/opt-in-copy.rs4
-rw-r--r--tests/ui/opt-in-copy.stderr4
-rw-r--r--tests/ui/or-patterns/exhaustiveness-non-exhaustive.stderr6
-rw-r--r--tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr6
-rw-r--r--tests/ui/panic-runtime/unwind-tables-target-required.rs5
-rw-r--r--tests/ui/parser/assoc-static-semantic-fail.rs4
-rw-r--r--tests/ui/parser/assoc-static-semantic-fail.stderr10
-rw-r--r--tests/ui/parser/attr-stmt-expr-attr-bad.rs2
-rw-r--r--tests/ui/parser/attr-stmt-expr-attr-bad.stderr115
-rw-r--r--tests/ui/parser/circular_modules_main.stderr2
-rw-r--r--tests/ui/parser/default.rs2
-rw-r--r--tests/ui/parser/default.stderr6
-rw-r--r--tests/ui/parser/dyn-trait-compatibility.rs2
-rw-r--r--tests/ui/parser/dyn-trait-compatibility.stderr16
-rw-r--r--tests/ui/parser/fn-header-semantic-fail.rs3
-rw-r--r--tests/ui/parser/fn-header-semantic-fail.stderr146
-rw-r--r--tests/ui/parser/ident-recovery.rs16
-rw-r--r--tests/ui/parser/ident-recovery.stderr42
-rw-r--r--tests/ui/parser/integer-literal-start-ident.rs2
-rw-r--r--tests/ui/parser/integer-literal-start-ident.stderr14
-rw-r--r--tests/ui/parser/issues/issue-104088.rs25
-rw-r--r--tests/ui/parser/issues/issue-104088.stderr56
-rw-r--r--tests/ui/parser/issues/issue-108242-semicolon-recovery.rs5
-rw-r--r--tests/ui/parser/issues/issue-108242-semicolon-recovery.stderr13
-rw-r--r--tests/ui/parser/issues/issue-110014.rs3
-rw-r--r--tests/ui/parser/issues/issue-110014.stderr19
-rw-r--r--tests/ui/parser/issues/issue-48508.rs1
-rw-r--r--tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs14
-rw-r--r--tests/ui/parser/removed-syntax-box.fixed14
-rw-r--r--tests/ui/parser/removed-syntax-box.rs14
-rw-r--r--tests/ui/parser/removed-syntax-box.stderr57
-rw-r--r--tests/ui/parser/trait-pub-assoc-const.rs2
-rw-r--r--tests/ui/parser/trait-pub-assoc-const.stderr6
-rw-r--r--tests/ui/parser/trait-pub-assoc-ty.rs2
-rw-r--r--tests/ui/parser/trait-pub-assoc-ty.stderr6
-rw-r--r--tests/ui/parser/trait-pub-method.rs2
-rw-r--r--tests/ui/parser/trait-pub-method.stderr6
-rw-r--r--tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr20
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr40
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr5
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr125
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr125
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr160
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr186
-rw-r--r--tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr25
-rw-r--r--tests/ui/pattern/issue-106552.stderr6
-rw-r--r--tests/ui/pattern/issue-106862.fixed44
-rw-r--r--tests/ui/pattern/issue-106862.rs44
-rw-r--r--tests/ui/pattern/issue-106862.stderr48
-rw-r--r--tests/ui/pattern/issue-68393-let-pat-assoc-constant.stderr12
-rw-r--r--tests/ui/pattern/pat-tuple-field-count-cross.stderr4
-rw-r--r--tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed2
-rw-r--r--tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr2
-rw-r--r--tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr3
-rw-r--r--tests/ui/pattern/usefulness/consts-opaque.stderr145
-rw-r--r--tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr10
-rw-r--r--tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr16
-rw-r--r--tests/ui/pattern/usefulness/empty-match.normal.stderr16
-rw-r--r--tests/ui/pattern/usefulness/floats.stderr2
-rw-r--r--tests/ui/pattern/usefulness/guards.stderr2
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr4
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr6
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr4
-rw-r--r--tests/ui/pattern/usefulness/issue-2111.stderr2
-rw-r--r--tests/ui/pattern/usefulness/issue-30240.stderr4
-rw-r--r--tests/ui/pattern/usefulness/issue-35609.stderr14
-rw-r--r--tests/ui/pattern/usefulness/issue-3601.stderr2
-rw-r--r--tests/ui/pattern/usefulness/issue-50900.stderr2
-rw-r--r--tests/ui/pattern/usefulness/issue-56379.stderr2
-rw-r--r--tests/ui/pattern/usefulness/match-byte-array-patterns-2.stderr4
-rw-r--r--tests/ui/pattern/usefulness/match-privately-empty.stderr2
-rw-r--r--tests/ui/pattern/usefulness/match-slice-patterns.stderr2
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr20
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-match-nested.stderr2
-rw-r--r--tests/ui/pattern/usefulness/non-exhaustive-match.stderr12
-rw-r--r--tests/ui/pattern/usefulness/refutable-pattern-errors.stderr4
-rw-r--r--tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr4
-rw-r--r--tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr40
-rw-r--r--tests/ui/pattern/usefulness/stable-gated-patterns.stderr4
-rw-r--r--tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr2
-rw-r--r--tests/ui/pattern/usefulness/unstable-gated-patterns.stderr2
-rw-r--r--tests/ui/privacy/auxiliary/xc-private-method-lib.rs (renamed from tests/ui/auxiliary/xc-private-method-lib.rs)0
-rw-r--r--tests/ui/privacy/effective_visibilities.rs7
-rw-r--r--tests/ui/privacy/effective_visibilities.stderr66
-rw-r--r--tests/ui/privacy/issue-29161.rs2
-rw-r--r--tests/ui/privacy/issue-29161.stderr6
-rw-r--r--tests/ui/privacy/priv-in-bad-locations.rs8
-rw-r--r--tests/ui/privacy/priv-in-bad-locations.stderr20
-rw-r--r--tests/ui/privacy/privacy-ns1.stderr6
-rw-r--r--tests/ui/privacy/privacy-ns2.stderr6
-rw-r--r--tests/ui/privacy/privacy-sanity.rs36
-rw-r--r--tests/ui/privacy/privacy-sanity.stderr96
-rw-r--r--tests/ui/privacy/private-in-public-assoc-ty.rs2
-rw-r--r--tests/ui/privacy/private-in-public-type-alias-impl-trait.rs2
-rw-r--r--tests/ui/privacy/useless-pub.rs6
-rw-r--r--tests/ui/privacy/useless-pub.stderr18
-rw-r--r--tests/ui/privacy/xc-private-method.rs (renamed from tests/ui/xc-private-method.rs)0
-rw-r--r--tests/ui/privacy/xc-private-method.stderr (renamed from tests/ui/xc-private-method.stderr)0
-rw-r--r--tests/ui/privacy/xc-private-method2.rs (renamed from tests/ui/xc-private-method2.rs)0
-rw-r--r--tests/ui/privacy/xc-private-method2.stderr (renamed from tests/ui/xc-private-method2.stderr)0
-rw-r--r--tests/ui/proc-macro/amputate-span.stderr4
-rw-r--r--tests/ui/proc-macro/attributes-on-modules-fail.stderr4
-rw-r--r--tests/ui/proc-macro/bad-projection.rs15
-rw-r--r--tests/ui/proc-macro/bad-projection.stderr9
-rw-r--r--tests/ui/proc-macro/derive-bad.rs2
-rw-r--r--tests/ui/proc-macro/derive-bad.stderr2
-rw-r--r--tests/ui/proc-macro/issue-91800.rs2
-rw-r--r--tests/ui/proc-macro/issue-91800.stderr2
-rw-r--r--tests/ui/proc-macro/macro-namespace-reserved-2.stderr16
-rw-r--r--tests/ui/proc-macro/proc-macro-abi.rs6
-rw-r--r--tests/ui/proc-macro/proc-macro-abi.stderr21
-rw-r--r--tests/ui/proc-macro/signature-proc-macro-attribute.rs10
-rw-r--r--tests/ui/proc-macro/signature-proc-macro-attribute.stderr46
-rw-r--r--tests/ui/proc-macro/signature-proc-macro-derive.rs9
-rw-r--r--tests/ui/proc-macro/signature-proc-macro-derive.stderr40
-rw-r--r--tests/ui/proc-macro/signature-proc-macro.rs9
-rw-r--r--tests/ui/proc-macro/signature-proc-macro.stderr40
-rw-r--r--tests/ui/proc-macro/signature.rs6
-rw-r--r--tests/ui/proc-macro/signature.stderr35
-rw-r--r--tests/ui/proc-macro/span-api-tests.rs1
-rw-r--r--tests/ui/process/signal-exit-status.rs6
-rw-r--r--tests/ui/range/range-pattern-out-of-bounds-issue-68972.rs2
-rw-r--r--tests/ui/range/range-pattern-out-of-bounds-issue-68972.stderr16
-rw-r--r--tests/ui/range/range_traits-2.stderr2
-rw-r--r--tests/ui/range/range_traits-3.stderr2
-rw-r--r--tests/ui/range/range_traits-6.stderr2
-rw-r--r--tests/ui/reachable/expr_box.rs8
-rw-r--r--tests/ui/reachable/expr_box.stderr17
-rw-r--r--tests/ui/reachable/reachable-unnameable-type-alias.rs (renamed from tests/ui/reachable-unnameable-type-alias.rs)0
-rw-r--r--tests/ui/recursion/issue-95134.rs2
-rw-r--r--tests/ui/regions/issue-2718.rs327
-rw-r--r--tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr3
-rw-r--r--tests/ui/resolve/crate-in-paths.stderr2
-rw-r--r--tests/ui/resolve/disambiguate-identical-names.rs (renamed from tests/ui/disambiguate-identical-names.rs)0
-rw-r--r--tests/ui/resolve/disambiguate-identical-names.stderr (renamed from tests/ui/disambiguate-identical-names.stderr)0
-rw-r--r--tests/ui/resolve/enums-are-namespaced-xc.stderr6
-rw-r--r--tests/ui/resolve/filter-intrinsics.stderr4
-rw-r--r--tests/ui/resolve/issue-102946.stderr2
-rw-r--r--tests/ui/resolve/issue-107563-ambiguous-glob-reexports.rs33
-rw-r--r--tests/ui/resolve/issue-107563-ambiguous-glob-reexports.stderr47
-rw-r--r--tests/ui/resolve/issue-16058.stderr6
-rw-r--r--tests/ui/resolve/issue-17518.stderr2
-rw-r--r--tests/ui/resolve/issue-21221-1.stderr14
-rw-r--r--tests/ui/resolve/issue-21221-2.stderr4
-rw-r--r--tests/ui/resolve/issue-21221-3.stderr2
-rw-r--r--tests/ui/resolve/issue-21221-4.stderr2
-rw-r--r--tests/ui/resolve/issue-2356.stderr2
-rw-r--r--tests/ui/resolve/issue-26545.stderr2
-rw-r--r--tests/ui/resolve/issue-35675.stderr4
-rw-r--r--tests/ui/resolve/issue-3907.stderr2
-rw-r--r--tests/ui/resolve/issue-50599.stderr4
-rw-r--r--tests/ui/resolve/issue-73427.stderr4
-rw-r--r--tests/ui/resolve/issue-90113.stderr2
-rw-r--r--tests/ui/resolve/missing-in-namespace.stderr2
-rw-r--r--tests/ui/resolve/no-implicit-prelude-nested.stderr30
-rw-r--r--tests/ui/resolve/no-implicit-prelude.stderr10
-rw-r--r--tests/ui/resolve/privacy-enum-ctor.stderr8
-rw-r--r--tests/ui/resolve/resolve-primitive-fallback.stderr2
-rw-r--r--tests/ui/resolve/tool-import.rs8
-rw-r--r--tests/ui/resolve/tool-import.stderr9
-rw-r--r--tests/ui/resolve/use_suggestion.stderr4
-rw-r--r--tests/ui/resolve/use_suggestion_placement.stderr6
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr3
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr3
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr2
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr2
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr2
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr2
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr3
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr4
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr3
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr3
-rw-r--r--tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr3
-rw-r--r--tests/ui/rfc-1937-termination-trait/issue-103052-2.current.stderr (renamed from tests/ui/rfc-1937-termination-trait/issue-103052-2.stderr)4
-rw-r--r--tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr15
-rw-r--r--tests/ui/rfc-1937-termination-trait/issue-103052-2.rs6
-rw-r--r--tests/ui/rfc-2005-default-binding-mode/slice.stderr2
-rw-r--r--tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs24
-rw-r--r--tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr31
-rw-r--r--tests/ui/rfc-2008-non-exhaustive/struct.stderr9
-rw-r--r--tests/ui/rfc-2008-non-exhaustive/variant.stderr20
-rw-r--r--tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs5
-rw-r--r--tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs23
-rw-r--r--tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr3
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr15
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr15
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr50
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs46
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr50
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr119
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs29
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr119
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs1
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr27
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr13
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs13
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/gate.rs8
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/gate.stderr15
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/nested-closure.rs2
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.rs7
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs9
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.stderr11
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs6
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr11
-rw-r--r--tests/ui/runtime/backtrace-debuginfo.rs1
-rw-r--r--tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed6
-rw-r--r--tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs6
-rw-r--r--tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr13
-rw-r--r--tests/ui/rust-2018/issue-52202-use-suggestions.stderr8
-rw-r--r--tests/ui/rust-2018/trait-import-suggestions.stderr6
-rw-r--r--tests/ui/rust-2018/uniform-paths/issue-87932.stderr2
-rw-r--r--tests/ui/rust-2021/future-prelude-collision-shadow.stderr4
-rw-r--r--tests/ui/rustdoc/doc-primitive.rs8
-rw-r--r--tests/ui/rustdoc/doc-primitive.stderr16
-rw-r--r--tests/ui/rustdoc/feature-gate-doc_primitive.rs6
-rw-r--r--tests/ui/rustdoc/feature-gate-doc_primitive.stderr15
-rw-r--r--tests/ui/self/arbitrary_self_types_trait.rs5
-rw-r--r--tests/ui/self/class-missing-self.stderr2
-rw-r--r--tests/ui/shadowed/shadowed-trait-methods.stderr2
-rw-r--r--tests/ui/simd/monomorphize-heterogeneous.rs9
-rw-r--r--tests/ui/simd/monomorphize-heterogeneous.stderr9
-rw-r--r--tests/ui/simple_global_asm.rs1
-rw-r--r--tests/ui/span/E0204.rs8
-rw-r--r--tests/ui/span/E0204.stderr8
-rw-r--r--tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr2
-rw-r--r--tests/ui/span/issue-35987.stderr2
-rw-r--r--tests/ui/span/issue-71363.stderr3
-rw-r--r--tests/ui/specialization/issue-59435.stderr3
-rw-r--r--tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs12
-rw-r--r--tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr14
-rw-r--r--tests/ui/stability-attribute/auxiliary/const-stability-attribute-implies.rs12
-rw-r--r--tests/ui/stability-attribute/auxiliary/similar-unstable-method.rs13
-rw-r--r--tests/ui/stability-attribute/const-stability-attribute-implies-missing.rs16
-rw-r--r--tests/ui/stability-attribute/const-stability-attribute-implies-missing.stderr8
-rw-r--r--tests/ui/stability-attribute/const-stability-attribute-implies-no-feature.rs16
-rw-r--r--tests/ui/stability-attribute/const-stability-attribute-implies-no-feature.stderr10
-rw-r--r--tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.rs19
-rw-r--r--tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.stderr22
-rw-r--r--tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.rs21
-rw-r--r--tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.stderr22
-rw-r--r--tests/ui/stability-attribute/issue-109177.rs13
-rw-r--r--tests/ui/stability-attribute/issue-109177.stderr21
-rw-r--r--tests/ui/static/static-mut-not-constant.rs6
-rw-r--r--tests/ui/static/static-mut-not-constant.stderr13
-rw-r--r--tests/ui/statics/uninhabited-static.stderr4
-rw-r--r--tests/ui/stats/hir-stats.stderr86
-rw-r--r--tests/ui/std/issue-15149.rs (renamed from tests/ui-fulldeps/std/issue-15149.rs)0
-rw-r--r--tests/ui/std/issue-81357-unsound-file-methods.rs (renamed from tests/ui-fulldeps/std/issue-81357-unsound-file-methods.rs)0
-rw-r--r--tests/ui/std/stdio-from.rs (renamed from tests/ui-fulldeps/std/stdio-from.rs)0
-rw-r--r--tests/ui/std/switch-stdout.rs (renamed from tests/ui-fulldeps/std/switch-stdout.rs)1
-rw-r--r--tests/ui/str/str-escape.rs22
-rw-r--r--tests/ui/str/str-escape.stderr20
-rw-r--r--tests/ui/structs-enums/align-struct.rs26
-rw-r--r--tests/ui/structs/struct-path-alias-bounds.stderr3
-rw-r--r--tests/ui/structs/struct-tuple-field-names.rs3
-rw-r--r--tests/ui/structs/struct-tuple-field-names.stderr20
-rw-r--r--tests/ui/suggestions/bad-infer-in-trait-impl.rs10
-rw-r--r--tests/ui/suggestions/bad-infer-in-trait-impl.stderr14
-rw-r--r--tests/ui/suggestions/chain-method-call-mutation-in-place.rs6
-rw-r--r--tests/ui/suggestions/chain-method-call-mutation-in-place.stderr37
-rw-r--r--tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr3
-rw-r--r--tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs5
-rw-r--r--tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr9
-rw-r--r--tests/ui/suggestions/core-std-import-order-issue-83564.stderr4
-rw-r--r--tests/ui/suggestions/correct-binder-for-arbitrary-bound-sugg.rs16
-rw-r--r--tests/ui/suggestions/correct-binder-for-arbitrary-bound-sugg.stderr22
-rw-r--r--tests/ui/suggestions/derive-macro-missing-bounds.stderr3
-rw-r--r--tests/ui/suggestions/derive-trait-for-method-call.stderr9
-rw-r--r--tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr4
-rw-r--r--tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr17
-rw-r--r--tests/ui/suggestions/import-trait-for-method-call.stderr2
-rw-r--r--tests/ui/suggestions/invalid-bin-op.stderr3
-rw-r--r--tests/ui/suggestions/issue-107860.rs6
-rw-r--r--tests/ui/suggestions/issue-107860.stderr12
-rw-r--r--tests/ui/suggestions/issue-108470.fixed29
-rw-r--r--tests/ui/suggestions/issue-108470.rs29
-rw-r--r--tests/ui/suggestions/issue-108470.stderr27
-rw-r--r--tests/ui/suggestions/issue-109291.rs4
-rw-r--r--tests/ui/suggestions/issue-109291.stderr12
-rw-r--r--tests/ui/suggestions/issue-109396.rs12
-rw-r--r--tests/ui/suggestions/issue-109396.stderr34
-rw-r--r--tests/ui/suggestions/issue-109436.rs13
-rw-r--r--tests/ui/suggestions/issue-109436.stderr15
-rw-r--r--tests/ui/suggestions/issue-84973-blacklist.stderr6
-rw-r--r--tests/ui/suggestions/issue-97760.stderr4
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed2
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs2
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr6
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs2
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr6
-rw-r--r--tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed2
-rw-r--r--tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs2
-rw-r--r--tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr2
-rw-r--r--tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed2
-rw-r--r--tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs2
-rw-r--r--tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr2
-rw-r--r--tests/ui/suggestions/multiline-multipart-suggestion.rs19
-rw-r--r--tests/ui/suggestions/multiline-multipart-suggestion.stderr46
-rw-r--r--tests/ui/suggestions/mut-borrow-needed-by-trait.stderr10
-rw-r--r--tests/ui/suggestions/no-extern-crate-in-type.stderr2
-rw-r--r--tests/ui/suggestions/raw-name-use-suggestion.stderr2
-rw-r--r--tests/ui/suggestions/ref-pattern-binding.stderr20
-rw-r--r--tests/ui/suggestions/suggest-pin-macro.rs23
-rw-r--r--tests/ui/suggestions/suggest-pin-macro.stderr19
-rw-r--r--tests/ui/suggestions/suggest-ret-on-async-w-late.rs11
-rw-r--r--tests/ui/suggestions/suggest-ret-on-async-w-late.stderr11
-rw-r--r--tests/ui/suggestions/suggest-tryinto-edition-change.stderr14
-rw-r--r--tests/ui/suggestions/use-placement-resolve.stderr2
-rw-r--r--tests/ui/suggestions/use-placement-typeck.stderr2
-rw-r--r--tests/ui/symbol-names/basic.legacy.stderr4
-rw-r--r--tests/ui/symbol-names/basic.v0.stderr2
-rw-r--r--tests/ui/symbol-names/foreign-types.stderr2
-rw-r--r--tests/ui/symbol-names/impl1.v0.stderr6
-rw-r--r--tests/ui/symbol-names/issue-60925.legacy.stderr4
-rw-r--r--tests/ui/symbol-names/issue-60925.v0.stderr2
-rw-r--r--tests/ui/symbol-names/issue-75326.v0.stderr2
-rw-r--r--tests/ui/symbol-names/trait-objects.v0.stderr6
-rw-r--r--tests/ui/symbol-names/x86-stdcall.rs4
-rw-r--r--tests/ui/sync/suggest-once-cell.rs2
-rw-r--r--tests/ui/sync/suggest-once-cell.stderr4
-rw-r--r--tests/ui/sync/suggest-ref-cell.rs2
-rw-r--r--tests/ui/sync/suggest-ref-cell.stderr4
-rw-r--r--tests/ui/target-feature/gate.rs1
-rw-r--r--tests/ui/target-feature/gate.stderr2
-rw-r--r--tests/ui/target-feature/invalid-attribute.rs36
-rw-r--r--tests/ui/target-feature/invalid-attribute.stderr95
-rw-r--r--tests/ui/test-attrs/custom-test-frameworks/issue-107454.rs10
-rw-r--r--tests/ui/test-attrs/custom-test-frameworks/issue-107454.stderr15
-rw-r--r--tests/ui/test-attrs/issue-109816.rs7
-rw-r--r--tests/ui/test-attrs/issue-109816.stderr16
-rw-r--r--tests/ui/test-attrs/test-attr-non-associated-functions.rs6
-rw-r--r--tests/ui/test-attrs/test-attr-non-associated-functions.stderr36
-rw-r--r--tests/ui/test-attrs/test-on-not-fn.stderr24
-rw-r--r--tests/ui/test-attrs/tests-listing-format-default.rs18
-rw-r--r--tests/ui/test-attrs/tests-listing-format-default.run.stdout5
-rw-r--r--tests/ui/test-attrs/tests-listing-format-json-without-unstableopts.rs18
-rw-r--r--tests/ui/test-attrs/tests-listing-format-json-without-unstableopts.run.stderr1
-rw-r--r--tests/ui/test-attrs/tests-listing-format-json.rs21
-rw-r--r--tests/ui/test-attrs/tests-listing-format-json.run.stdout5
-rw-r--r--tests/ui/test-attrs/tests-listing-format-terse.rs18
-rw-r--r--tests/ui/test-attrs/tests-listing-format-terse.run.stdout3
-rw-r--r--tests/ui/thir-print/thir-flat.stdout4
-rw-r--r--tests/ui/thir-print/thir-tree-match.stdout54
-rw-r--r--tests/ui/thir-print/thir-tree.stdout4
-rw-r--r--tests/ui/thread-local/auxiliary/tls-export.rs17
-rw-r--r--tests/ui/thread-local/auxiliary/tls-rlib.rs15
-rw-r--r--tests/ui/thread-local/thread-local-mutation.rs (renamed from tests/ui/thread-local-mutation.rs)0
-rw-r--r--tests/ui/thread-local/thread-local-mutation.stderr (renamed from tests/ui/thread-local-mutation.stderr)0
-rw-r--r--tests/ui/thread-local/thread-local-static.rs (renamed from tests/ui/thread-local-static.rs)0
-rw-r--r--tests/ui/thread-local/thread-local-static.stderr (renamed from tests/ui/thread-local-static.stderr)0
-rw-r--r--tests/ui/thread-local/tls-dylib-access.rs19
-rw-r--r--tests/ui/threads-sendsync/issue-43733-2.rs2
-rw-r--r--tests/ui/threads-sendsync/issue-43733.rs8
-rw-r--r--tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr8
-rw-r--r--tests/ui/trait-bounds/impl-bound-with-references-error.stderr2
-rw-r--r--tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr2
-rw-r--r--tests/ui/traits/alias/dont-elaborate-non-self.rs10
-rw-r--r--tests/ui/traits/alias/dont-elaborate-non-self.stderr20
-rw-r--r--tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs2
-rw-r--r--tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr14
-rw-r--r--tests/ui/traits/copy-is-not-modulo-regions.not_static.stderr2
-rw-r--r--tests/ui/traits/copy-is-not-modulo-regions.rs2
-rw-r--r--tests/ui/traits/dyn-trait.rs1
-rw-r--r--tests/ui/traits/inductive-overflow/lifetime.rs6
-rw-r--r--tests/ui/traits/inductive-overflow/lifetime.stderr14
-rw-r--r--tests/ui/traits/inductive-overflow/supertrait-auto-trait.stderr3
-rw-r--r--tests/ui/traits/issue-50480.rs4
-rw-r--r--tests/ui/traits/issue-50480.stderr4
-rw-r--r--tests/ui/traits/issue-71136.stderr3
-rw-r--r--tests/ui/traits/issue-78372.stderr2
-rw-r--r--tests/ui/traits/issue-87558.stderr6
-rw-r--r--tests/ui/traits/issue-91949-hangs-on-recursion.rs2
-rw-r--r--tests/ui/traits/issue-91949-hangs-on-recursion.stderr12
-rw-r--r--tests/ui/traits/item-privacy.stderr6
-rw-r--r--tests/ui/traits/method-private.stderr2
-rw-r--r--tests/ui/traits/new-solver/alias-eq-in-canonical-response.rs40
-rw-r--r--tests/ui/traits/new-solver/alias-sub.rs34
-rw-r--r--tests/ui/traits/new-solver/alias_eq_dont_use_normalizes_to_if_substs_eq.rs2
-rw-r--r--tests/ui/traits/new-solver/auto-with-drop_tracking_mir.fail.stderr18
-rw-r--r--tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs26
-rw-r--r--tests/ui/traits/new-solver/canonical-int-var-eq-in-response.rs22
-rw-r--r--tests/ui/traits/new-solver/canonical-ty-var-eq-in-response.rs39
-rw-r--r--tests/ui/traits/new-solver/cast-checks-handling-projections.rs (renamed from tests/ui/typeck/lazy-norm/cast-checks-handling-projections.rs)2
-rw-r--r--tests/ui/traits/new-solver/closure-inference-guidance.rs11
-rw-r--r--tests/ui/traits/new-solver/coherence/issue-102048.rs44
-rw-r--r--tests/ui/traits/new-solver/coherence/issue-102048.stderr12
-rw-r--r--tests/ui/traits/new-solver/const-param-placeholder.fail.stderr16
-rw-r--r--tests/ui/traits/new-solver/const-param-placeholder.rs21
-rw-r--r--tests/ui/traits/new-solver/deduce-ty-from-object.rs6
-rw-r--r--tests/ui/traits/new-solver/destruct.rs13
-rw-r--r--tests/ui/traits/new-solver/dont-elaborate-for-projections.rs12
-rw-r--r--tests/ui/traits/new-solver/equating-projection-cyclically.rs (renamed from tests/ui/typeck/lazy-norm/equating-projection-cyclically.rs)0
-rw-r--r--tests/ui/traits/new-solver/equating-projection-cyclically.stderr (renamed from tests/ui/typeck/lazy-norm/equating-projection-cyclically.stderr)0
-rw-r--r--tests/ui/traits/new-solver/float-canonical.rs8
-rw-r--r--tests/ui/traits/new-solver/fn-trait.rs21
-rw-r--r--tests/ui/traits/new-solver/fn-trait.stderr124
-rw-r--r--tests/ui/traits/new-solver/int-var-alias-eq.rs18
-rw-r--r--tests/ui/traits/new-solver/int-var-is-send.rs8
-rw-r--r--tests/ui/traits/new-solver/iter-filter-projection.rs12
-rw-r--r--tests/ui/traits/new-solver/lazy-nested-obligations-1.rs13
-rw-r--r--tests/ui/traits/new-solver/lazy-nested-obligations-2.rs23
-rw-r--r--tests/ui/traits/new-solver/lazy-nested-obligations-3.rs38
-rw-r--r--tests/ui/traits/new-solver/more-object-bound.rs2
-rw-r--r--tests/ui/traits/new-solver/more-object-bound.stderr13
-rw-r--r--tests/ui/traits/new-solver/nested-obligations-with-bound-vars-gat.rs43
-rw-r--r--tests/ui/traits/new-solver/normalize-param-env-1.rs40
-rw-r--r--tests/ui/traits/new-solver/normalize-param-env-2.rs26
-rw-r--r--tests/ui/traits/new-solver/normalize-param-env-3.rs32
-rw-r--r--tests/ui/traits/new-solver/param-discr-kind.rs8
-rw-r--r--tests/ui/traits/new-solver/pointee.rs18
-rw-r--r--tests/ui/traits/new-solver/pointer-like.rs2
-rw-r--r--tests/ui/traits/new-solver/pointer-like.stderr2
-rw-r--r--tests/ui/traits/new-solver/prefer-candidate-no-constraints.rs22
-rw-r--r--tests/ui/traits/new-solver/prefer-param-env-on-ambiguity.rs10
-rw-r--r--tests/ui/traits/new-solver/projection-discr-kind.rs18
-rw-r--r--tests/ui/traits/new-solver/projection-discr-kind.stderr17
-rw-r--r--tests/ui/traits/new-solver/recursive-self-normalization-2.rs19
-rw-r--r--tests/ui/traits/new-solver/recursive-self-normalization-2.stderr16
-rw-r--r--tests/ui/traits/new-solver/recursive-self-normalization.rs15
-rw-r--r--tests/ui/traits/new-solver/recursive-self-normalization.stderr16
-rw-r--r--tests/ui/traits/new-solver/runaway-impl-candidate-selection.rs15
-rw-r--r--tests/ui/traits/new-solver/runaway-impl-candidate-selection.stderr9
-rw-r--r--tests/ui/traits/new-solver/specialization-transmute.rs30
-rw-r--r--tests/ui/traits/new-solver/specialization-transmute.stderr31
-rw-r--r--tests/ui/traits/new-solver/specialization-unconstrained.rs22
-rw-r--r--tests/ui/traits/new-solver/specialization-unconstrained.stderr25
-rw-r--r--tests/ui/traits/new-solver/stall-num-var-auto-trait.fallback.stderr17
-rw-r--r--tests/ui/traits/new-solver/stall-num-var-auto-trait.rs25
-rw-r--r--tests/ui/traits/non_lifetime_binders/bad-copy-cond.rs9
-rw-r--r--tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr24
-rw-r--r--tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs11
-rw-r--r--tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr19
-rw-r--r--tests/ui/traits/non_lifetime_binders/method-probe.rs16
-rw-r--r--tests/ui/traits/non_lifetime_binders/method-probe.stderr11
-rw-r--r--tests/ui/traits/non_lifetime_binders/missing-assoc-item.rs11
-rw-r--r--tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr23
-rw-r--r--tests/ui/traits/non_lifetime_binders/supertrait-object-safety.rs24
-rw-r--r--tests/ui/traits/non_lifetime_binders/supertrait-object-safety.stderr56
-rw-r--r--tests/ui/traits/reservation-impl/coherence-conflict.next.stderr11
-rw-r--r--tests/ui/traits/reservation-impl/coherence-conflict.old.stderr (renamed from tests/ui/traits/reservation-impl/coherence-conflict.stderr)2
-rw-r--r--tests/ui/traits/reservation-impl/coherence-conflict.rs3
-rw-r--r--tests/ui/traits/reservation-impl/no-use.next.stderr (renamed from tests/ui/traits/reservation-impl/no-use.stderr)2
-rw-r--r--tests/ui/traits/reservation-impl/no-use.old.stderr13
-rw-r--r--tests/ui/traits/reservation-impl/no-use.rs3
-rw-r--r--tests/ui/traits/reservation-impl/non-lattice-ok.rs6
-rw-r--r--tests/ui/traits/reservation-impl/ok.rs3
-rw-r--r--tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.rs34
-rw-r--r--tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.stderr24
-rw-r--r--tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.rs33
-rw-r--r--tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.stderr14
-rw-r--r--tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr9
-rw-r--r--tests/ui/traits/wrong-mul-method-signature.rs (renamed from tests/ui/wrong-mul-method-signature.rs)0
-rw-r--r--tests/ui/traits/wrong-mul-method-signature.stderr (renamed from tests/ui/wrong-mul-method-signature.stderr)0
-rw-r--r--tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr30
-rw-r--r--tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr100
-rw-r--r--tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr30
-rw-r--r--tests/ui/transmutability/enums/should_pad_variants.stderr5
-rw-r--r--tests/ui/transmutability/enums/should_respect_endianness.stderr5
-rw-r--r--tests/ui/transmutability/issue-101739-1.rs2
-rw-r--r--tests/ui/transmutability/issue-101739-1.stderr12
-rw-r--r--tests/ui/transmutability/primitives/bool.current.stderr (renamed from tests/ui/transmutability/primitives/bool.stderr)9
-rw-r--r--tests/ui/transmutability/primitives/bool.next.stderr18
-rw-r--r--tests/ui/transmutability/primitives/bool.rs4
-rw-r--r--tests/ui/transmutability/primitives/numbers.current.stderr (renamed from tests/ui/transmutability/primitives/numbers.stderr)513
-rw-r--r--tests/ui/transmutability/primitives/numbers.next.stderr858
-rw-r--r--tests/ui/transmutability/primitives/numbers.rs3
-rw-r--r--tests/ui/transmutability/primitives/unit.current.stderr (renamed from tests/ui/transmutability/primitives/unit.stderr)9
-rw-r--r--tests/ui/transmutability/primitives/unit.next.stderr24
-rw-r--r--tests/ui/transmutability/primitives/unit.rs3
-rw-r--r--tests/ui/transmutability/references.current.stderr (renamed from tests/ui/transmutability/references.stderr)9
-rw-r--r--tests/ui/transmutability/references.next.stderr25
-rw-r--r--tests/ui/transmutability/references.rs3
-rw-r--r--tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr60
-rw-r--r--tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr10
-rw-r--r--tests/ui/transmutability/unions/should_pad_variants.stderr5
-rw-r--r--tests/ui/transmutability/unions/should_reject_contraction.stderr5
-rw-r--r--tests/ui/transmutability/unions/should_reject_disjoint.stderr10
-rw-r--r--tests/ui/transmutability/unions/should_reject_intersecting.stderr10
-rw-r--r--tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr5
-rw-r--r--tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr5
-rw-r--r--tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr5
-rw-r--r--tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr5
-rw-r--r--tests/ui/transmute/transmute-padding-ice.stderr5
-rw-r--r--tests/ui/tuple/tuple-index.rs (renamed from tests/ui/tuple-index.rs)0
-rw-r--r--tests/ui/type-alias-impl-trait/assoc-type-const.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/assoc-type-lifetime.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/associated-type-impl-trait-lifetime.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/auxiliary/collect_hidden_types.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/imply_bounds_from_bounds.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.rs6
-rw-r--r--tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr2
-rw-r--r--tests/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-53598.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-57611-trait-alias.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-57700.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-57807-associated-type.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-58887.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-60371.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-60371.stderr4
-rw-r--r--tests/ui/type-alias-impl-trait/issue-60564-working.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-74761-2.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-74761.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-78450.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-89952.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-90400-1.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-90400-2.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/issue-94429.rs4
-rw-r--r--tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs2
-rw-r--r--tests/ui/type/type-check/assignment-in-if.stderr9
-rw-r--r--tests/ui/type/type-check/point-at-inference-3.fixed3
-rw-r--r--tests/ui/type/type-check/point-at-inference-3.rs3
-rw-r--r--tests/ui/type/type-check/point-at-inference-3.stderr6
-rw-r--r--tests/ui/type/type-check/point-at-inference-4.rs3
-rw-r--r--tests/ui/type/type-check/point-at-inference-4.stderr11
-rw-r--r--tests/ui/type/type-check/point-at-inference.stderr4
-rw-r--r--tests/ui/typeck/bad-type-in-vec-contains.stderr1
-rw-r--r--tests/ui/typeck/bad-type-in-vec-push.stderr2
-rw-r--r--tests/ui/typeck/explain_clone_autoref.stderr3
-rw-r--r--tests/ui/typeck/issue-105946.rs8
-rw-r--r--tests/ui/typeck/issue-105946.stderr32
-rw-r--r--tests/ui/typeck/issue-107775.stderr6
-rw-r--r--tests/ui/typeck/issue-110052.rs12
-rw-r--r--tests/ui/typeck/issue-110052.stderr9
-rw-r--r--tests/ui/typeck/issue-43189.stderr2
-rw-r--r--tests/ui/typeck/issue-87935-unsized-box-expr.rs10
-rw-r--r--tests/ui/typeck/issue-87935-unsized-box-expr.stderr12
-rw-r--r--tests/ui/typeck/issue-90164.stderr3
-rw-r--r--tests/ui/typeck/lazy-norm/cast-checks-handling-projections.stderr9
-rw-r--r--tests/ui/typeck/output-type-mismatch.rs (renamed from tests/ui/output-type-mismatch.rs)0
-rw-r--r--tests/ui/typeck/output-type-mismatch.stderr (renamed from tests/ui/output-type-mismatch.stderr)0
-rw-r--r--tests/ui/typeck/suppressed-error.rs (renamed from tests/ui/suppressed-error.rs)0
-rw-r--r--tests/ui/typeck/suppressed-error.stderr (renamed from tests/ui/suppressed-error.stderr)0
-rw-r--r--tests/ui/typeck/tag-that-dare-not-speak-its-name.rs (renamed from tests/ui/tag-that-dare-not-speak-its-name.rs)0
-rw-r--r--tests/ui/typeck/tag-that-dare-not-speak-its-name.stderr (renamed from tests/ui/tag-that-dare-not-speak-its-name.stderr)0
-rw-r--r--tests/ui/typeck/terr-in-field.rs (renamed from tests/ui/terr-in-field.rs)0
-rw-r--r--tests/ui/typeck/terr-in-field.stderr (renamed from tests/ui/terr-in-field.stderr)0
-rw-r--r--tests/ui/typeck/terr-sorts.rs (renamed from tests/ui/terr-sorts.rs)0
-rw-r--r--tests/ui/typeck/terr-sorts.stderr (renamed from tests/ui/terr-sorts.stderr)0
-rw-r--r--tests/ui/typeck/while-type-error.rs (renamed from tests/ui/while-type-error.rs)0
-rw-r--r--tests/ui/typeck/while-type-error.stderr (renamed from tests/ui/while-type-error.stderr)0
-rw-r--r--tests/ui/typeck/wrong-ret-type.rs (renamed from tests/ui/wrong-ret-type.rs)0
-rw-r--r--tests/ui/typeck/wrong-ret-type.stderr (renamed from tests/ui/wrong-ret-type.stderr)0
-rw-r--r--tests/ui/ufcs/ufcs-partially-resolved.rs44
-rw-r--r--tests/ui/ufcs/ufcs-partially-resolved.stderr190
-rw-r--r--tests/ui/ufcs/ufcs-polymorphic-paths.rs (renamed from tests/ui/ufcs-polymorphic-paths.rs)0
-rw-r--r--tests/ui/underscore-imports/shadow.stderr2
-rw-r--r--tests/ui/union/field_checks.rs10
-rw-r--r--tests/ui/union/field_checks.stderr30
-rw-r--r--tests/ui/union/issue-41073.rs2
-rw-r--r--tests/ui/union/issue-41073.stderr6
-rw-r--r--tests/ui/union/union-copy.rs2
-rw-r--r--tests/ui/union/union-copy.stderr2
-rw-r--r--tests/ui/union/union-derive-clone.mirunsafeck.stderr6
-rw-r--r--tests/ui/union/union-derive-clone.thirunsafeck.stderr6
-rw-r--r--tests/ui/union/union-derive-eq.mirunsafeck.stderr3
-rw-r--r--tests/ui/union/union-derive-eq.thirunsafeck.stderr3
-rw-r--r--tests/ui/union/union-with-drop-fields.mirunsafeck.stderr18
-rw-r--r--tests/ui/union/union-with-drop-fields.rs6
-rw-r--r--tests/ui/union/union-with-drop-fields.thirunsafeck.stderr18
-rw-r--r--tests/ui/union/unresolved-field-isnt-copy.rs8
-rw-r--r--tests/ui/union/unresolved-field-isnt-copy.stderr9
-rw-r--r--tests/ui/unpretty/box.rs9
-rw-r--r--tests/ui/unpretty/box.stdout14
-rw-r--r--tests/ui/unpretty/flattened-format-args.rs8
-rw-r--r--tests/ui/unpretty/flattened-format-args.stdout16
-rw-r--r--tests/ui/unpretty/mir-unpretty.rs (renamed from tests/ui/mir-unpretty.rs)0
-rw-r--r--tests/ui/unpretty/mir-unpretty.stderr (renamed from tests/ui/mir-unpretty.stderr)0
-rw-r--r--tests/ui/unpretty/unpretty-expr-fn-arg.rs (renamed from tests/ui/unpretty-expr-fn-arg.rs)0
-rw-r--r--tests/ui/unpretty/unpretty-expr-fn-arg.stdout (renamed from tests/ui/unpretty-expr-fn-arg.stdout)0
-rw-r--r--tests/ui/unresolved/unresolved-candidates.stderr2
-rw-r--r--tests/ui/unsafe/foreign-unsafe-fn-called.mir.stderr (renamed from tests/ui/foreign-unsafe-fn-called.mir.stderr)0
-rw-r--r--tests/ui/unsafe/foreign-unsafe-fn-called.rs (renamed from tests/ui/foreign-unsafe-fn-called.rs)0
-rw-r--r--tests/ui/unsafe/foreign-unsafe-fn-called.thir.stderr (renamed from tests/ui/foreign-unsafe-fn-called.thir.stderr)0
-rw-r--r--tests/ui/unsafe/new-unsafe-pointers.rs (renamed from tests/ui/new-unsafe-pointers.rs)0
-rw-r--r--tests/ui/unsafe/unsafe-fn-called-from-unsafe-blk.rs (renamed from tests/ui/unsafe-fn-called-from-unsafe-blk.rs)0
-rw-r--r--tests/ui/unsafe/unsafe-fn-called-from-unsafe-fn.rs (renamed from tests/ui/unsafe-fn-called-from-unsafe-fn.rs)0
-rw-r--r--tests/ui/unsafe/unsafe-fn-deref-ptr.mir.stderr28
-rw-r--r--tests/ui/unsafe/unsafe-fn-deref-ptr.rs3
-rw-r--r--tests/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr28
-rw-r--r--tests/ui/unsafe/unsafe-pointer-assignability.rs (renamed from tests/ui/unsafe-pointer-assignability.rs)0
-rw-r--r--tests/ui/use/use-mod/use-mod.rs (renamed from tests/ui/use/use-mod.rs)0
-rw-r--r--tests/ui/use/use-mod/use-mod.stderr (renamed from tests/ui/use/use-mod.stderr)0
-rw-r--r--tests/ui/use/use.rs (renamed from tests/ui/use.rs)0
-rw-r--r--tests/ui/variance/variance-intersection-of-ref-and-opt-ref.rs (renamed from tests/ui/variance-intersection-of-ref-and-opt-ref.rs)0
-rw-r--r--tests/ui/variance/variance-iterators-in-libcore.rs (renamed from tests/ui/variance-iterators-in-libcore.rs)0
-rw-r--r--tests/ui/wasm/wasm-custom-section-relocations.rs (renamed from tests/ui/wasm-custom-section-relocations.rs)0
-rw-r--r--tests/ui/wasm/wasm-custom-section-relocations.stderr (renamed from tests/ui/wasm-custom-section-relocations.stderr)0
-rw-r--r--tests/ui/wf/hir-wf-check-erase-regions.rs4
-rw-r--r--tests/ui/wf/hir-wf-check-erase-regions.stderr16
-rw-r--r--tests/ui/wf/issue-110157.rs12
-rw-r--r--tests/ui/wf/issue-110157.stderr32
-rw-r--r--tests/ui/wf/wf-const-type.stderr3
-rw-r--r--tests/ui/wf/wf-static-type.stderr3
-rw-r--r--tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr4
-rw-r--r--tests/ui/where-clauses/where-clauses-method-unsatisfied.stderr3
-rw-r--r--tests/ui/where-clauses/where-clauses-unsatisfied.stderr3
2954 files changed, 23410 insertions, 8460 deletions
diff --git a/tests/ui-toml/array_size_threshold/array_size_threshold.rs b/src/tools/clippy/tests/ui-toml/array_size_threshold/array_size_threshold.rs
index 7f623c7a9..7f623c7a9 100644
--- a/tests/ui-toml/array_size_threshold/array_size_threshold.rs
+++ b/src/tools/clippy/tests/ui-toml/array_size_threshold/array_size_threshold.rs
diff --git a/tests/ui-toml/array_size_threshold/array_size_threshold.stderr b/src/tools/clippy/tests/ui-toml/array_size_threshold/array_size_threshold.stderr
index ac017b209..ac017b209 100644
--- a/tests/ui-toml/array_size_threshold/array_size_threshold.stderr
+++ b/src/tools/clippy/tests/ui-toml/array_size_threshold/array_size_threshold.stderr
diff --git a/tests/ui-toml/array_size_threshold/clippy.toml b/src/tools/clippy/tests/ui-toml/array_size_threshold/clippy.toml
index 3f1fe9a12..3f1fe9a12 100644
--- a/tests/ui-toml/array_size_threshold/clippy.toml
+++ b/src/tools/clippy/tests/ui-toml/array_size_threshold/clippy.toml
diff --git a/tests/assembly/asm/global_asm.rs b/tests/assembly/asm/global_asm.rs
index 0b361a7ed..36f017cf9 100644
--- a/tests/assembly/asm/global_asm.rs
+++ b/tests/assembly/asm/global_asm.rs
@@ -25,9 +25,9 @@ global_asm!("movl ${}, %ecx", const 5, options(att_syntax));
global_asm!("call {}", sym my_func);
// CHECK: lea rax, [rip + MY_STATIC]
global_asm!("lea rax, [rip + {}]", sym MY_STATIC);
-// CHECK: call _RNvCsiubXh4Yz005_10global_asm6foobar
+// CHECK: call _RNvCsddMtV7nAi4C_10global_asm6foobar
global_asm!("call {}", sym foobar);
-// CHECK: _RNvCsiubXh4Yz005_10global_asm6foobar:
+// CHECK: _RNvCsddMtV7nAi4C_10global_asm6foobar:
fn foobar() {
loop {}
}
diff --git a/tests/assembly/asm/m68k-types.rs b/tests/assembly/asm/m68k-types.rs
new file mode 100644
index 000000000..0322e615a
--- /dev/null
+++ b/tests/assembly/asm/m68k-types.rs
@@ -0,0 +1,83 @@
+// assembly-output: emit-asm
+// compile-flags: --target m68k-unknown-linux-gnu
+// needs-llvm-components: m68k
+
+#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
+#![crate_type = "rlib"]
+#![no_core]
+#![allow(non_camel_case_types)]
+
+#[rustc_builtin_macro]
+macro_rules! asm {
+ () => {};
+}
+#[rustc_builtin_macro]
+macro_rules! concat {
+ () => {};
+}
+
+#[lang = "sized"]
+trait Sized {}
+#[lang = "copy"]
+trait Copy {}
+
+type ptr = *const u64;
+
+impl Copy for i8 {}
+impl Copy for i16 {}
+impl Copy for i32 {}
+impl Copy for i64 {}
+impl Copy for ptr {}
+
+macro_rules! check {
+ ($func:ident $ty:ident $class:ident $mov:literal) => {
+ #[no_mangle]
+ pub unsafe fn $func(x: $ty) -> $ty {
+ let y;
+ asm!(concat!($mov, " {}, {};"), out($class) y, in($class) x);
+ y
+ }
+ };
+}
+
+// CHECK-LABEL: reg_data_i8:
+// CHECK: ;APP
+// CHECK: move.b %d{{[0-9]}}, %d{{[0-9]}}
+// CHECK: ;NO_APP
+check!(reg_data_i8 i8 reg_data "move.b");
+
+// CHECK-LABEL: reg_data_i16:
+// CHECK: ;APP
+// CHECK: move.w %d{{[0-9]}}, %d{{[0-9]}}
+// CHECK: ;NO_APP
+check!(reg_data_i16 i16 reg_data "move.w");
+
+// CHECK-LABEL: reg_data_i32:
+// CHECK: ;APP
+// CHECK: move.l %d{{[0-9]}}, %d{{[0-9]}}
+// CHECK: ;NO_APP
+check!(reg_data_i32 i32 reg_data "move.l");
+
+// CHECK-LABEL: reg_addr_i16:
+// CHECK: ;APP
+// CHECK: move.w %a{{[0-9]}}, %a{{[0-9]}}
+// CHECK: ;NO_APP
+check!(reg_addr_i16 i16 reg_addr "move.w");
+
+// CHECK-LABEL: reg_addr_i32:
+// CHECK: ;APP
+// CHECK: move.l %a{{[0-9]}}, %a{{[0-9]}}
+// CHECK: ;NO_APP
+check!(reg_addr_i32 i32 reg_addr "move.l");
+
+// CHECK-LABEL: reg_i16:
+// CHECK: ;APP
+// CHECK: move.w %{{[da][0-9]}}, %{{[da][0-9]}}
+// CHECK: ;NO_APP
+check!(reg_i16 i16 reg "move.w");
+
+// CHECK-LABEL: reg_i32:
+// CHECK: ;APP
+// CHECK: move.l %{{[da][0-9]}}, %{{[da][0-9]}}
+// CHECK: ;NO_APP
+check!(reg_i32 i32 reg "move.l");
diff --git a/tests/assembly/is_aligned.rs b/tests/assembly/is_aligned.rs
index 620a3da94..148d11ee4 100644
--- a/tests/assembly/is_aligned.rs
+++ b/tests/assembly/is_aligned.rs
@@ -1,6 +1,7 @@
// assembly-output: emit-asm
// min-llvm-version: 15.0
// only-x86_64
+// ignore-sgx
// revisions: opt-speed opt-size
// [opt-speed] compile-flags: -Copt-level=1
// [opt-size] compile-flags: -Copt-level=s
diff --git a/tests/assembly/static-relocation-model.rs b/tests/assembly/static-relocation-model.rs
index faa2e3952..41aa9a461 100644
--- a/tests/assembly/static-relocation-model.rs
+++ b/tests/assembly/static-relocation-model.rs
@@ -6,6 +6,7 @@
// [A64] needs-llvm-components: aarch64
// [ppc64le] compile-flags: --target powerpc64le-unknown-linux-gnu -Crelocation-model=static
// [ppc64le] needs-llvm-components: powerpc
+// ignore-debug: alignment checks insert panics that we don't have a lang item for
#![feature(no_core, lang_items)]
#![no_core]
diff --git a/tests/assembly/strict_provenance.rs b/tests/assembly/strict_provenance.rs
index 01f1957d5..24a7c6b5b 100644
--- a/tests/assembly/strict_provenance.rs
+++ b/tests/assembly/strict_provenance.rs
@@ -1,6 +1,7 @@
// assembly-output: emit-asm
// compile-flags: -Copt-level=1
// only-x86_64
+// ignore-sgx
// min-llvm-version: 15.0
#![crate_type = "rlib"]
diff --git a/tests/assembly/x86_64-floating-point-clamp.rs b/tests/assembly/x86_64-floating-point-clamp.rs
index 0f3b465d0..0bc6baad4 100644
--- a/tests/assembly/x86_64-floating-point-clamp.rs
+++ b/tests/assembly/x86_64-floating-point-clamp.rs
@@ -4,6 +4,7 @@
// assembly-output: emit-asm
// compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
// only-x86_64
+// ignore-sgx
// CHECK-LABEL: clamp_demo:
#[no_mangle]
diff --git a/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs b/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs
index 79d82cf70..7eb3c6948 100644
--- a/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs
+++ b/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs
@@ -11,7 +11,7 @@ pub extern fn plus_one(r: &mut u64) {
// CHECK: plus_one
// CHECK: lfence
-// CHECK-NEXT: addq
+// CHECK-NEXT: incq
// CHECK: popq [[REGISTER:%[a-z]+]]
// CHECK-NEXT: lfence
// CHECK-NEXT: jmpq *[[REGISTER]]
diff --git a/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs b/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs
index c316379d5..4745ebc4f 100644
--- a/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs
+++ b/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs
@@ -10,9 +10,7 @@ use std::arch::asm;
pub extern "C" fn get(ptr: *const u64) -> u64 {
let value: u64;
unsafe {
- asm!(".start_inline_asm:",
- "mov {}, [{}]",
- ".end_inline_asm:",
+ asm!("mov {}, [{}]",
out(reg) value,
in(reg) ptr);
}
@@ -20,24 +18,17 @@ pub extern "C" fn get(ptr: *const u64) -> u64 {
}
// CHECK: get
-// CHECK: .start_inline_asm
-// CHECK-NEXT: movq
+// CHECK: movq
// CHECK-NEXT: lfence
-// CHECK-NEXT: .end_inline_asm
#[no_mangle]
pub extern "C" fn myret() {
unsafe {
- asm!(
- ".start_myret_inline_asm:",
- "ret",
- ".end_myret_inline_asm:",
- );
+ asm!("ret");
}
}
// CHECK: myret
-// CHECK: .start_myret_inline_asm
-// CHECK-NEXT: shlq $0, (%rsp)
+// CHECK: shlq $0, (%rsp)
// CHECK-NEXT: lfence
// CHECK-NEXT: retq
diff --git a/tests/assembly/x86_64-no-jump-tables.rs b/tests/assembly/x86_64-no-jump-tables.rs
index 007c3591a..edf4adaad 100644
--- a/tests/assembly/x86_64-no-jump-tables.rs
+++ b/tests/assembly/x86_64-no-jump-tables.rs
@@ -6,6 +6,7 @@
// compile-flags: -O
// [set] compile-flags: -Zno-jump-tables
// only-x86_64
+// ignore-sgx
#![crate_type = "lib"]
diff --git a/tests/codegen-units/polymorphization/auxiliary/poly-dep.rs b/tests/codegen-units/polymorphization/auxiliary/poly-dep.rs
new file mode 100644
index 000000000..fdbfa1b09
--- /dev/null
+++ b/tests/codegen-units/polymorphization/auxiliary/poly-dep.rs
@@ -0,0 +1,4 @@
+// compile-flags: -Zpolymorphize=on
+
+#[inline(never)]
+pub fn foo<T>() {}
diff --git a/tests/codegen-units/polymorphization/poly-foreign.rs b/tests/codegen-units/polymorphization/poly-foreign.rs
new file mode 100644
index 000000000..9da082daf
--- /dev/null
+++ b/tests/codegen-units/polymorphization/poly-foreign.rs
@@ -0,0 +1,11 @@
+// aux-build:poly-dep.rs
+// compile-flags: --crate-type=lib -Zprint-mono-items=eager -Zpolymorphize=on
+
+extern crate poly_dep;
+
+pub static FN1: fn() = poly_dep::foo::<i32>;
+pub static FN2: fn() = poly_dep::foo::<u32>;
+
+//~ MONO_ITEM static FN1
+//~ MONO_ITEM static FN2
+//~ MONO_ITEM fn poly_dep::foo::<T>
diff --git a/tests/codegen/abi-main-signature-16bit-c-int.rs b/tests/codegen/abi-main-signature-16bit-c-int.rs
index 4ed491dfb..3548cc06a 100644
--- a/tests/codegen/abi-main-signature-16bit-c-int.rs
+++ b/tests/codegen/abi-main-signature-16bit-c-int.rs
@@ -17,7 +17,6 @@
// ignore-wasm32
// ignore-x86
// ignore-x86_64
-// ignore-xcore
fn main() {
}
diff --git a/tests/codegen/adjustments.rs b/tests/codegen/adjustments.rs
index 6d2247517..b53a68a55 100644
--- a/tests/codegen/adjustments.rs
+++ b/tests/codegen/adjustments.rs
@@ -13,7 +13,7 @@ pub fn helper(_: usize) {
pub fn no_op_slice_adjustment(x: &[u8]) -> &[u8] {
// We used to generate an extra alloca and memcpy for the block's trailing expression value, so
// check that we copy directly to the return value slot
-// CHECK: %0 = insertvalue { {{\[0 x i8\]\*|ptr}}, [[USIZE]] } undef, {{\[0 x i8\]\*|ptr}} %x.0, 0
+// CHECK: %0 = insertvalue { {{\[0 x i8\]\*|ptr}}, [[USIZE]] } poison, {{\[0 x i8\]\*|ptr}} %x.0, 0
// CHECK: %1 = insertvalue { {{\[0 x i8\]\*|ptr}}, [[USIZE]] } %0, [[USIZE]] %x.1, 1
// CHECK: ret { {{\[0 x i8\]\*|ptr}}, [[USIZE]] } %1
{ x }
diff --git a/tests/codegen/array-map.rs b/tests/codegen/array-map.rs
index 9298e89e3..7b8ab2c79 100644
--- a/tests/codegen/array-map.rs
+++ b/tests/codegen/array-map.rs
@@ -38,10 +38,10 @@ pub fn short_integer_zip_map(x: [u32; 8], y: [u32; 8]) -> [u32; 8] {
//
// CHECK-LABEL: @long_integer_map
#[no_mangle]
-pub fn long_integer_map(x: [u32; 64]) -> [u32; 64] {
+pub fn long_integer_map(x: [u32; 512]) -> [u32; 512] {
// CHECK: start:
- // CHECK-NEXT: alloca [64 x i32]
- // CHECK-NEXT: alloca %"core::mem::manually_drop::ManuallyDrop<[u32; 64]>"
+ // CHECK-NEXT: alloca [512 x i32]
+ // CHECK-NEXT: alloca %"core::mem::manually_drop::ManuallyDrop<[u32; 512]>"
// CHECK-NOT: alloca
// CHECK: mul <{{[0-9]+}} x i32>
// CHECK: add <{{[0-9]+}} x i32>
diff --git a/tests/codegen/comparison-operators-2-tuple.rs b/tests/codegen/comparison-operators-2-tuple.rs
new file mode 100644
index 000000000..a9d25e3b5
--- /dev/null
+++ b/tests/codegen/comparison-operators-2-tuple.rs
@@ -0,0 +1,121 @@
+// compile-flags: -C opt-level=1 -Z merge-functions=disabled
+// min-llvm-version: 15.0
+// only-x86_64
+
+#![crate_type = "lib"]
+
+use std::cmp::Ordering;
+
+type TwoTuple = (i16, u16);
+
+//
+// The operators are all overridden directly, so should optimize easily.
+//
+// Yes, the `s[lg]t` is correct for the `[lg]e` version because it's only used
+// in the side of the select where we know the values are *not* equal.
+//
+
+// CHECK-LABEL: @check_lt_direct
+// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
+#[no_mangle]
+pub fn check_lt_direct(a: TwoTuple, b: TwoTuple) -> bool {
+ // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP0:.+]] = icmp slt i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP1:.+]] = icmp ult i16 %[[A1]], %[[B1]]
+ // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+ // CHECK: ret i1 %[[R]]
+ a < b
+}
+
+// CHECK-LABEL: @check_le_direct
+// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
+#[no_mangle]
+pub fn check_le_direct(a: TwoTuple, b: TwoTuple) -> bool {
+ // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP0:.+]] = icmp slt i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP1:.+]] = icmp ule i16 %[[A1]], %[[B1]]
+ // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+ // CHECK: ret i1 %[[R]]
+ a <= b
+}
+
+// CHECK-LABEL: @check_gt_direct
+// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
+#[no_mangle]
+pub fn check_gt_direct(a: TwoTuple, b: TwoTuple) -> bool {
+ // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP1:.+]] = icmp ugt i16 %[[A1]], %[[B1]]
+ // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+ // CHECK: ret i1 %[[R]]
+ a > b
+}
+
+// CHECK-LABEL: @check_ge_direct
+// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
+#[no_mangle]
+pub fn check_ge_direct(a: TwoTuple, b: TwoTuple) -> bool {
+ // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP1:.+]] = icmp uge i16 %[[A1]], %[[B1]]
+ // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+ // CHECK: ret i1 %[[R]]
+ a >= b
+}
+
+//
+// These ones are harder, since there are more intermediate values to remove.
+//
+// `<` seems to be getting lucky right now, so test that doesn't regress.
+//
+// The others, however, aren't managing to optimize away the extra `select`s yet.
+// See <https://github.com/rust-lang/rust/issues/106107> for more about this.
+//
+
+// CHECK-LABEL: @check_lt_via_cmp
+// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
+#[no_mangle]
+pub fn check_lt_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
+ // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP0:.+]] = icmp slt i16 %[[A0]], %[[B0]]
+ // CHECK-DAG: %[[CMP1:.+]] = icmp ult i16 %[[A1]], %[[B1]]
+ // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+ // CHECK: ret i1 %[[R]]
+ Ord::cmp(&a, &b).is_lt()
+}
+
+// CHECK-LABEL: @check_le_via_cmp
+// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
+#[no_mangle]
+pub fn check_le_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
+ // FIXME-CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+ // FIXME-CHECK-DAG: %[[CMP0:.+]] = icmp sle i16 %[[A0]], %[[B0]]
+ // FIXME-CHECK-DAG: %[[CMP1:.+]] = icmp ule i16 %[[A1]], %[[B1]]
+ // FIXME-CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+ // FIXME-CHECK: ret i1 %[[R]]
+ Ord::cmp(&a, &b).is_le()
+}
+
+// CHECK-LABEL: @check_gt_via_cmp
+// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
+#[no_mangle]
+pub fn check_gt_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
+ // FIXME-CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+ // FIXME-CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]]
+ // FIXME-CHECK-DAG: %[[CMP1:.+]] = icmp ugt i16 %[[A1]], %[[B1]]
+ // FIXME-CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+ // FIXME-CHECK: ret i1 %[[R]]
+ Ord::cmp(&a, &b).is_gt()
+}
+
+// CHECK-LABEL: @check_ge_via_cmp
+// CHECK-SAME: (i16 noundef %[[A0:.+]], i16 noundef %[[A1:.+]], i16 noundef %[[B0:.+]], i16 noundef %[[B1:.+]])
+#[no_mangle]
+pub fn check_ge_via_cmp(a: TwoTuple, b: TwoTuple) -> bool {
+ // FIXME-CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]]
+ // FIXME-CHECK-DAG: %[[CMP0:.+]] = icmp sge i16 %[[A0]], %[[B0]]
+ // FIXME-CHECK-DAG: %[[CMP1:.+]] = icmp uge i16 %[[A1]], %[[B1]]
+ // FIXME-CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]]
+ // FIXME-CHECK: ret i1 %[[R]]
+ Ord::cmp(&a, &b).is_ge()
+}
diff --git a/tests/codegen/consts.rs b/tests/codegen/consts.rs
index dd22fd0f7..fc2badc41 100644
--- a/tests/codegen/consts.rs
+++ b/tests/codegen/consts.rs
@@ -9,7 +9,7 @@
// CHECK: @STATIC = {{.*}}, align 4
// This checks the constants from inline_enum_const
-// CHECK: @alloc_76bfe2f13a3e3b01074971d122eac57e = {{.*}}, align 2
+// CHECK: @alloc_af1f8e8e6f4b341431a1d405e652df2d = {{.*}}, align 2
// This checks the constants from {low,high}_align_const, they share the same
// constant, but the alignment differs, so the higher one should be used
diff --git a/tests/codegen/debug-limited.rs b/tests/codegen/debug-limited.rs
new file mode 100644
index 000000000..48d676887
--- /dev/null
+++ b/tests/codegen/debug-limited.rs
@@ -0,0 +1,27 @@
+// Verify that the limited debuginfo option emits llvm's FullDebugInfo, but no type info.
+//
+// compile-flags: -C debuginfo=limited
+
+#[repr(C)]
+struct StructType {
+ a: i64,
+ b: i32,
+}
+
+extern "C" {
+ fn creator() -> *mut StructType;
+ fn save(p: *const StructType);
+}
+
+fn main() {
+ unsafe {
+ let value: &mut StructType = &mut *creator();
+ value.a = 7;
+ save(value as *const StructType)
+ }
+}
+
+// CHECK: !DICompileUnit
+// CHECK: emissionKind: FullDebug
+// CHECK: !DILocation
+// CHECK-NOT: !DIBasicType
diff --git a/tests/codegen/debug-line-directives-only.rs b/tests/codegen/debug-line-directives-only.rs
new file mode 100644
index 000000000..750bdd49d
--- /dev/null
+++ b/tests/codegen/debug-line-directives-only.rs
@@ -0,0 +1,27 @@
+// Verify that the only debuginfo generated are the line directives.
+//
+// compile-flags: -C debuginfo=line-directives-only
+
+#[repr(C)]
+struct StructType {
+ a: i64,
+ b: i32,
+}
+
+extern "C" {
+ fn creator() -> *mut StructType;
+ fn save(p: *const StructType);
+}
+
+fn main() {
+ unsafe {
+ let value: &mut StructType = &mut *creator();
+ value.a = 7;
+ save(value as *const StructType)
+ }
+}
+
+// CHECK: !DICompileUnit
+// CHECK: emissionKind: DebugDirectivesOnly
+// CHECK: !DILocation
+// CHECK-NOT: !DIBasicType
diff --git a/tests/codegen/debug-line-tables-only.rs b/tests/codegen/debug-line-tables-only.rs
new file mode 100644
index 000000000..3ed165a6f
--- /dev/null
+++ b/tests/codegen/debug-line-tables-only.rs
@@ -0,0 +1,27 @@
+// Verify that the only debuginfo generated are the line tables.
+//
+// compile-flags: -C debuginfo=line-tables-only
+
+#[repr(C)]
+struct StructType {
+ a: i64,
+ b: i32,
+}
+
+extern "C" {
+ fn creator() -> *mut StructType;
+ fn save(p: *const StructType);
+}
+
+fn main() {
+ unsafe {
+ let value: &mut StructType = &mut *creator();
+ value.a = 7;
+ save(value as *const StructType)
+ }
+}
+
+// CHECK: !DICompileUnit
+// CHECK: emissionKind: LineTablesOnly
+// CHECK: !DILocation
+// CHECK-NOT: !DIBasicType
diff --git a/tests/codegen/enum-match.rs b/tests/codegen/enum-match.rs
index 5f8063a27..36c6be190 100644
--- a/tests/codegen/enum-match.rs
+++ b/tests/codegen/enum-match.rs
@@ -34,8 +34,11 @@ pub enum Enum1 {
// CHECK: define noundef i8 @match1{{.*}}
// CHECK-NEXT: start:
-// CHECK-NEXT: [[DISCR:%.*]] = {{.*}}call i8 @llvm.usub.sat.i8(i8 %0, i8 1)
-// CHECK-NEXT: switch i8 [[DISCR]], label {{.*}} [
+// CHECK-NEXT: %1 = add i8 %0, -2
+// CHECK-NEXT: %2 = zext i8 %1 to i64
+// CHECK-NEXT: %3 = icmp ult i8 %1, 2
+// CHECK-NEXT: %4 = add nuw nsw i64 %2, 1
+// CHECK-NEXT: %_2 = select i1 %3, i64 %4, i64 0
#[no_mangle]
pub fn match1(e: Enum1) -> u8 {
use Enum1::*;
diff --git a/tests/codegen/fewer-names.rs b/tests/codegen/fewer-names.rs
index ac8cba06b..7f383a5c1 100644
--- a/tests/codegen/fewer-names.rs
+++ b/tests/codegen/fewer-names.rs
@@ -13,8 +13,8 @@ pub fn sum(x: u32, y: u32) -> u32 {
// NO-LABEL: define{{.*}}i32 @sum(i32 noundef %x, i32 noundef %y)
// NO-NEXT: start:
-// NO-NEXT: %z = add i32 %y, %x
-// NO-NEXT: ret i32 %z
+// NO-NEXT: %0 = add i32 %y, %x
+// NO-NEXT: ret i32 %0
let z = x + y;
z
}
diff --git a/tests/codegen/global_asm.rs b/tests/codegen/global_asm.rs
index fab84868f..9912b1e75 100644
--- a/tests/codegen/global_asm.rs
+++ b/tests/codegen/global_asm.rs
@@ -1,39 +1,20 @@
// ignore-aarch64
-// ignore-aarch64_be
// ignore-arm
-// ignore-armeb
// ignore-avr
-// ignore-bpfel
-// ignore-bpfeb
+// ignore-bpf
+// ignore-bpf
// ignore-hexagon
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
-// ignore-powerpc64le
// ignore-powerpc
-// ignore-r600
-// ignore-amdgcn
// ignore-sparc
-// ignore-sparcv9
-// ignore-sparcel
+// ignore-sparc64
// ignore-s390x
-// ignore-tce
// ignore-thumb
-// ignore-thumbeb
-// ignore-xcore
-// ignore-nvptx
// ignore-nvptx64
-// ignore-le32
-// ignore-le64
-// ignore-amdil
-// ignore-amdil64
-// ignore-hsail
-// ignore-hsail64
-// ignore-spir
-// ignore-spir64
-// ignore-kalimba
-// ignore-shave
+// ignore-spirv
// ignore-wasm32
// ignore-wasm64
// ignore-emscripten
diff --git a/tests/codegen/global_asm_include.rs b/tests/codegen/global_asm_include.rs
index 02ee91645..b68c5ad3b 100644
--- a/tests/codegen/global_asm_include.rs
+++ b/tests/codegen/global_asm_include.rs
@@ -1,39 +1,20 @@
// ignore-aarch64
-// ignore-aarch64_be
// ignore-arm
-// ignore-armeb
// ignore-avr
-// ignore-bpfel
-// ignore-bpfeb
+// ignore-bpf
+// ignore-bpf
// ignore-hexagon
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
-// ignore-powerpc64le
// ignore-powerpc
-// ignore-r600
-// ignore-amdgcn
// ignore-sparc
-// ignore-sparcv9
-// ignore-sparcel
+// ignore-sparc64
// ignore-s390x
-// ignore-tce
// ignore-thumb
-// ignore-thumbeb
-// ignore-xcore
-// ignore-nvptx
// ignore-nvptx64
-// ignore-le32
-// ignore-le64
-// ignore-amdil
-// ignore-amdil64
-// ignore-hsail
-// ignore-hsail64
-// ignore-spir
-// ignore-spir64
-// ignore-kalimba
-// ignore-shave
+// ignore-spirv
// ignore-wasm32
// ignore-wasm64
// ignore-emscripten
diff --git a/tests/codegen/global_asm_x2.rs b/tests/codegen/global_asm_x2.rs
index bdcf0ea84..d87e02bef 100644
--- a/tests/codegen/global_asm_x2.rs
+++ b/tests/codegen/global_asm_x2.rs
@@ -1,39 +1,20 @@
// ignore-aarch64
-// ignore-aarch64_be
// ignore-arm
-// ignore-armeb
// ignore-avr
-// ignore-bpfel
-// ignore-bpfeb
+// ignore-bpf
+// ignore-bpf
// ignore-hexagon
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
-// ignore-powerpc64le
// ignore-powerpc
-// ignore-r600
-// ignore-amdgcn
// ignore-sparc
-// ignore-sparcv9
-// ignore-sparcel
+// ignore-sparc64
// ignore-s390x
-// ignore-tce
// ignore-thumb
-// ignore-thumbeb
-// ignore-xcore
-// ignore-nvptx
// ignore-nvptx64
-// ignore-le32
-// ignore-le64
-// ignore-amdil
-// ignore-amdil64
-// ignore-hsail
-// ignore-hsail64
-// ignore-spir
-// ignore-spir64
-// ignore-kalimba
-// ignore-shave
+// ignore-spirv
// ignore-wasm32
// ignore-wasm64
// ignore-emscripten
diff --git a/tests/codegen/inherit_overflow.rs b/tests/codegen/inherit_overflow.rs
index 0b0b890b2..39909d7ab 100644
--- a/tests/codegen/inherit_overflow.rs
+++ b/tests/codegen/inherit_overflow.rs
@@ -4,7 +4,7 @@
//[NOASSERT] compile-flags: -Coverflow-checks=off
// CHECK-LABEL: define{{.*}} @assertion
-// ASSERT: call void @_ZN4core9panicking5panic17h
+// ASSERT: call void @{{.*4core9panicking5panic}}
// NOASSERT: ret i8 0
#[no_mangle]
pub fn assertion() -> u8 {
diff --git a/tests/codegen/inline-function-args-debug-info.rs b/tests/codegen/inline-function-args-debug-info.rs
new file mode 100644
index 000000000..e3d8caa49
--- /dev/null
+++ b/tests/codegen/inline-function-args-debug-info.rs
@@ -0,0 +1,20 @@
+// This test checks that debug information includes function argument indexes even if the function
+// gets inlined by MIR inlining. Without function argument indexes, `info args` in gdb won't show
+// arguments and their values for the current function.
+
+// compile-flags: -Zinline-mir=yes -Cdebuginfo=2 --edition=2021
+
+#![crate_type = "lib"]
+
+pub fn outer_function(x: usize, y: usize) -> usize {
+ inner_function(x, y) + 1
+}
+
+#[inline]
+fn inner_function(aaaa: usize, bbbb: usize) -> usize {
+ // CHECK: !DILocalVariable(name: "aaaa", arg: 1
+ // CHECK-SAME: line: 14
+ // CHECK: !DILocalVariable(name: "bbbb", arg: 2
+ // CHECK-SAME: line: 14
+ aaaa + bbbb
+}
diff --git a/tests/codegen/intrinsics/transmute-x64.rs b/tests/codegen/intrinsics/transmute-x64.rs
new file mode 100644
index 000000000..99d258c62
--- /dev/null
+++ b/tests/codegen/intrinsics/transmute-x64.rs
@@ -0,0 +1,35 @@
+// compile-flags: -O -C no-prepopulate-passes
+// only-x86_64 (it's using arch-specific types)
+// min-llvm-version: 15.0 # this test assumes `ptr`s
+
+#![crate_type = "lib"]
+
+use std::arch::x86_64::{__m128, __m128i, __m256i};
+use std::mem::transmute;
+
+// CHECK-LABEL: @check_sse_float_to_int(
+#[no_mangle]
+pub unsafe fn check_sse_float_to_int(x: __m128) -> __m128i {
+ // CHECK-NOT: alloca
+ // CHECK: %1 = load <4 x float>, ptr %x, align 16
+ // CHECK: store <4 x float> %1, ptr %0, align 16
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_sse_pair_to_avx(
+#[no_mangle]
+pub unsafe fn check_sse_pair_to_avx(x: (__m128i, __m128i)) -> __m256i {
+ // CHECK-NOT: alloca
+ // CHECK: %1 = load <4 x i64>, ptr %x, align 16
+ // CHECK: store <4 x i64> %1, ptr %0, align 32
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_sse_pair_from_avx(
+#[no_mangle]
+pub unsafe fn check_sse_pair_from_avx(x: __m256i) -> (__m128i, __m128i) {
+ // CHECK-NOT: alloca
+ // CHECK: %1 = load <4 x i64>, ptr %x, align 32
+ // CHECK: store <4 x i64> %1, ptr %0, align 16
+ transmute(x)
+}
diff --git a/tests/codegen/intrinsics/transmute.rs b/tests/codegen/intrinsics/transmute.rs
new file mode 100644
index 000000000..57f901c67
--- /dev/null
+++ b/tests/codegen/intrinsics/transmute.rs
@@ -0,0 +1,431 @@
+// compile-flags: -O -C no-prepopulate-passes
+// only-64bit (so I don't need to worry about usize)
+// min-llvm-version: 15.0 # this test assumes `ptr`s
+
+#![crate_type = "lib"]
+#![feature(core_intrinsics)]
+#![feature(custom_mir)]
+#![feature(inline_const)]
+#![allow(unreachable_code)]
+
+use std::mem::{transmute, MaybeUninit};
+
+// Some of the cases here are statically rejected by `mem::transmute`, so
+// we need to generate custom MIR for those cases to get to codegen.
+use std::intrinsics::mir::*;
+
+enum Never {}
+
+#[repr(align(2))]
+pub struct BigNever(Never, u16, Never);
+
+#[repr(align(8))]
+pub struct Scalar64(i64);
+
+#[repr(C, align(4))]
+pub struct Aggregate64(u16, u8, i8, f32);
+
+#[repr(C)]
+pub struct Aggregate8(u8);
+
+// CHECK-LABEL: @check_bigger_size(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "initial")]
+pub unsafe fn check_bigger_size(x: u16) -> u32 {
+ // CHECK: call void @llvm.trap
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+// CHECK-LABEL: @check_smaller_size(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "initial")]
+pub unsafe fn check_smaller_size(x: u32) -> u16 {
+ // CHECK: call void @llvm.trap
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+// CHECK-LABEL: @check_smaller_array(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "initial")]
+pub unsafe fn check_smaller_array(x: [u32; 7]) -> [u32; 3] {
+ // CHECK: call void @llvm.trap
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+// CHECK-LABEL: @check_bigger_array(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "initial")]
+pub unsafe fn check_bigger_array(x: [u32; 3]) -> [u32; 7] {
+ // CHECK: call void @llvm.trap
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+// CHECK-LABEL: @check_to_uninhabited(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "initial")]
+pub unsafe fn check_to_uninhabited(x: u16) -> BigNever {
+ // CHECK: call void @llvm.trap
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+// CHECK-LABEL: @check_from_uninhabited(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "initial")]
+pub unsafe fn check_from_uninhabited(x: BigNever) -> u16 {
+ // CHECK: ret i16 poison
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+// CHECK-LABEL: @check_intermediate_passthrough(
+#[no_mangle]
+pub unsafe fn check_intermediate_passthrough(x: u32) -> i32 {
+ // CHECK: start
+ // CHECK: %[[TMP:.+]] = add i32 1, %x
+ // CHECK: %[[RET:.+]] = add i32 %[[TMP]], 1
+ // CHECK: ret i32 %[[RET]]
+ unsafe {
+ transmute::<u32, i32>(1 + x) + 1
+ }
+}
+
+// CHECK-LABEL: @check_nop_pair(
+#[no_mangle]
+pub unsafe fn check_nop_pair(x: (u8, i8)) -> (i8, u8) {
+ // CHECK-NOT: alloca
+ // CHECK: %0 = insertvalue { i8, i8 } poison, i8 %x.0, 0
+ // CHECK: %1 = insertvalue { i8, i8 } %0, i8 %x.1, 1
+ // CHECK: ret { i8, i8 } %1
+ unsafe {
+ transmute(x)
+ }
+}
+
+// CHECK-LABEL: @check_to_newtype(
+#[no_mangle]
+pub unsafe fn check_to_newtype(x: u64) -> Scalar64 {
+ // CHECK-NOT: alloca
+ // CHECK: ret i64 %x
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_from_newtype(
+#[no_mangle]
+pub unsafe fn check_from_newtype(x: Scalar64) -> u64 {
+ // CHECK-NOT: alloca
+ // CHECK: ret i64 %x
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_aggregate_to_bool(
+#[no_mangle]
+pub unsafe fn check_aggregate_to_bool(x: Aggregate8) -> bool {
+ // CHECK: %x = alloca %Aggregate8, align 1
+ // CHECK: %[[BYTE:.+]] = load i8, ptr %x, align 1
+ // CHECK: %[[BOOL:.+]] = trunc i8 %[[BYTE]] to i1
+ // CHECK: ret i1 %[[BOOL]]
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_aggregate_from_bool(
+#[no_mangle]
+pub unsafe fn check_aggregate_from_bool(x: bool) -> Aggregate8 {
+ // CHECK: %0 = alloca %Aggregate8, align 1
+ // CHECK: %[[BYTE:.+]] = zext i1 %x to i8
+ // CHECK: store i8 %[[BYTE]], ptr %0, align 1
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_byte_to_bool(
+#[no_mangle]
+pub unsafe fn check_byte_to_bool(x: u8) -> bool {
+ // CHECK-NOT: alloca
+ // CHECK: %0 = trunc i8 %x to i1
+ // CHECK: ret i1 %0
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_byte_from_bool(
+#[no_mangle]
+pub unsafe fn check_byte_from_bool(x: bool) -> u8 {
+ // CHECK-NOT: alloca
+ // CHECK: %0 = zext i1 %x to i8
+ // CHECK: ret i8 %0
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_to_pair(
+#[no_mangle]
+pub unsafe fn check_to_pair(x: u64) -> Option<i32> {
+ // CHECK: %0 = alloca { i32, i32 }, align 4
+ // CHECK: store i64 %x, ptr %0, align 4
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_from_pair(
+#[no_mangle]
+pub unsafe fn check_from_pair(x: Option<i32>) -> u64 {
+ // The two arguments are of types that are only 4-aligned, but they're
+ // immediates so we can write using the destination alloca's alignment.
+ const { assert!(std::mem::align_of::<Option<i32>>() == 4) };
+
+ // CHECK: %0 = alloca i64, align 8
+ // CHECK: store i32 %x.0, ptr %1, align 8
+ // CHECK: store i32 %x.1, ptr %2, align 4
+ // CHECK: %3 = load i64, ptr %0, align 8
+ // CHECK: ret i64 %3
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_to_float(
+#[no_mangle]
+pub unsafe fn check_to_float(x: u32) -> f32 {
+ // CHECK-NOT: alloca
+ // CHECK: %0 = bitcast i32 %x to float
+ // CHECK: ret float %0
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_from_float(
+#[no_mangle]
+pub unsafe fn check_from_float(x: f32) -> u32 {
+ // CHECK-NOT: alloca
+ // CHECK: %0 = bitcast float %x to i32
+ // CHECK: ret i32 %0
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_to_bytes(
+#[no_mangle]
+pub unsafe fn check_to_bytes(x: u32) -> [u8; 4] {
+ // CHECK: %0 = alloca [4 x i8], align 1
+ // CHECK: store i32 %x, ptr %0, align 1
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_from_bytes(
+#[no_mangle]
+pub unsafe fn check_from_bytes(x: [u8; 4]) -> u32 {
+ // CHECK: %x = alloca [4 x i8], align 1
+ // CHECK: %[[VAL:.+]] = load i32, ptr %x, align 1
+ // CHECK: ret i32 %[[VAL]]
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_to_aggregate(
+#[no_mangle]
+pub unsafe fn check_to_aggregate(x: u64) -> Aggregate64 {
+ // CHECK: %0 = alloca %Aggregate64, align 4
+ // CHECK: store i64 %x, ptr %0, align 4
+ // CHECK: %1 = load i64, ptr %0, align 4
+ // CHECK: ret i64 %1
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_from_aggregate(
+#[no_mangle]
+pub unsafe fn check_from_aggregate(x: Aggregate64) -> u64 {
+ // CHECK: %x = alloca %Aggregate64, align 4
+ // CHECK: %[[VAL:.+]] = load i64, ptr %x, align 4
+ // CHECK: ret i64 %[[VAL]]
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_long_array_less_aligned(
+#[no_mangle]
+pub unsafe fn check_long_array_less_aligned(x: [u64; 100]) -> [u16; 400] {
+ // CHECK-NEXT: start
+ // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 2 %0, ptr align 8 %x, i64 800, i1 false)
+ // CHECK-NEXT: ret void
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_long_array_more_aligned(
+#[no_mangle]
+pub unsafe fn check_long_array_more_aligned(x: [u8; 100]) -> [u32; 25] {
+ // CHECK-NEXT: start
+ // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 1 %x, i64 100, i1 false)
+ // CHECK-NEXT: ret void
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_pair_with_bool(
+#[no_mangle]
+pub unsafe fn check_pair_with_bool(x: (u8, bool)) -> (bool, i8) {
+ // CHECK-NOT: alloca
+ // CHECK: trunc i8 %x.0 to i1
+ // CHECK: zext i1 %x.1 to i8
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_float_to_pointer(
+#[no_mangle]
+pub unsafe fn check_float_to_pointer(x: f64) -> *const () {
+ // CHECK-NOT: alloca
+ // CHECK: %0 = bitcast double %x to i64
+ // CHECK: %1 = inttoptr i64 %0 to ptr
+ // CHECK: ret ptr %1
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_float_from_pointer(
+#[no_mangle]
+pub unsafe fn check_float_from_pointer(x: *const ()) -> f64 {
+ // CHECK-NOT: alloca
+ // CHECK: %0 = ptrtoint ptr %x to i64
+ // CHECK: %1 = bitcast i64 %0 to double
+ // CHECK: ret double %1
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_array_to_pair(
+#[no_mangle]
+pub unsafe fn check_array_to_pair(x: [u8; 16]) -> (i64, u64) {
+ // CHECK-NOT: alloca
+ // CHECK: %[[FST:.+]] = load i64, ptr %{{.+}}, align 1, !noundef !
+ // CHECK: %[[SND:.+]] = load i64, ptr %{{.+}}, align 1, !noundef !
+ // CHECK: %[[PAIR0:.+]] = insertvalue { i64, i64 } poison, i64 %[[FST]], 0
+ // CHECK: %[[PAIR01:.+]] = insertvalue { i64, i64 } %[[PAIR0]], i64 %[[SND]], 1
+ // CHECK: ret { i64, i64 } %[[PAIR01]]
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_pair_to_array(
+#[no_mangle]
+pub unsafe fn check_pair_to_array(x: (i64, u64)) -> [u8; 16] {
+ // CHECK-NOT: alloca
+ // CHECK: store i64 %x.0, ptr %{{.+}}, align 1
+ // CHECK: store i64 %x.1, ptr %{{.+}}, align 1
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_heterogeneous_integer_pair(
+#[no_mangle]
+pub unsafe fn check_heterogeneous_integer_pair(x: (i32, bool)) -> (bool, u32) {
+ // CHECK: store i32 %x.0
+ // CHECK: %[[WIDER:.+]] = zext i1 %x.1 to i8
+ // CHECK: store i8 %[[WIDER]]
+
+ // CHECK: %[[BYTE:.+]] = load i8
+ // CHECK: trunc i8 %[[BYTE:.+]] to i1
+ // CHECK: load i32
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_heterogeneous_float_pair(
+#[no_mangle]
+pub unsafe fn check_heterogeneous_float_pair(x: (f64, f32)) -> (f32, f64) {
+ // CHECK: store double %x.0
+ // CHECK: store float %x.1
+ // CHECK: %[[A:.+]] = load float
+ // CHECK: %[[B:.+]] = load double
+ // CHECK: %[[P:.+]] = insertvalue { float, double } poison, float %[[A]], 0
+ // CHECK: insertvalue { float, double } %[[P]], double %[[B]], 1
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_issue_110005(
+#[no_mangle]
+pub unsafe fn check_issue_110005(x: (usize, bool)) -> Option<Box<[u8]>> {
+ // CHECK: store i64 %x.0
+ // CHECK: %[[WIDER:.+]] = zext i1 %x.1 to i8
+ // CHECK: store i8 %[[WIDER]]
+ // CHECK: load ptr
+ // CHECK: load i64
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_pair_to_dst_ref(
+#[no_mangle]
+pub unsafe fn check_pair_to_dst_ref<'a>(x: (usize, usize)) -> &'a [u8] {
+ // CHECK: %0 = inttoptr i64 %x.0 to ptr
+ // CHECK: %1 = insertvalue { ptr, i64 } poison, ptr %0, 0
+ // CHECK: %2 = insertvalue { ptr, i64 } %1, i64 %x.1, 1
+ // CHECK: ret { ptr, i64 } %2
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_issue_109992(
+#[no_mangle]
+#[custom_mir(dialect = "runtime", phase = "optimized")]
+pub unsafe fn check_issue_109992(x: ()) -> [(); 1] {
+ // 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(
+ x: (MaybeUninit<u16>, MaybeUninit<u64>),
+) -> (MaybeUninit<i64>, MaybeUninit<i16>) {
+ // Thanks to `MaybeUninit` this is actually defined behaviour,
+ // unlike the examples above with pairs of primitives.
+
+ // CHECK: store i16 %x.0
+ // CHECK: store i64 %x.1
+ // CHECK: load i64
+ // CHECK-NOT: noundef
+ // CHECK: load i16
+ // CHECK-NOT: noundef
+ // CHECK: ret { i64, i16 }
+ transmute(x)
+}
+
+#[repr(align(8))]
+pub struct HighAlignScalar(u8);
+
+// CHECK-LABEL: @check_to_overalign(
+#[no_mangle]
+pub unsafe fn check_to_overalign(x: u64) -> HighAlignScalar {
+ // CHECK: %0 = alloca %HighAlignScalar, align 8
+ // CHECK: store i64 %x, ptr %0, align 8
+ // CHECK: %1 = load i64, ptr %0, align 8
+ // CHECK: ret i64 %1
+ transmute(x)
+}
+
+// CHECK-LABEL: @check_from_overalign(
+#[no_mangle]
+pub unsafe fn check_from_overalign(x: HighAlignScalar) -> u64 {
+ // CHECK: %x = alloca %HighAlignScalar, align 8
+ // CHECK: %[[VAL:.+]] = load i64, ptr %x, align 8
+ // CHECK: ret i64 %[[VAL]]
+ transmute(x)
+}
diff --git a/tests/codegen/auxiliary/static_dllimport_aux.rs b/tests/codegen/issues/auxiliary/static_dllimport_aux.rs
index afb0dc42f..afb0dc42f 100644
--- a/tests/codegen/auxiliary/static_dllimport_aux.rs
+++ b/tests/codegen/issues/auxiliary/static_dllimport_aux.rs
diff --git a/tests/codegen/issues/issue-101048.rs b/tests/codegen/issues/issue-101048.rs
new file mode 100644
index 000000000..efa4db93e
--- /dev/null
+++ b/tests/codegen/issues/issue-101048.rs
@@ -0,0 +1,13 @@
+// compile-flags: -O
+// min-llvm-version: 16
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn all_zero(data: &[u64]) -> bool {
+ // CHECK-LABEL: @all_zero(
+ // CHECK: [[PHI:%.*]] = phi i1
+ // CHECK-NOT: phi i8
+ // CHECK-NOT: zext
+ data.iter().copied().fold(true, |acc, x| acc & (x == 0))
+}
diff --git a/tests/codegen/issues/issue-101082.rs b/tests/codegen/issues/issue-101082.rs
new file mode 100644
index 000000000..2cbe99942
--- /dev/null
+++ b/tests/codegen/issues/issue-101082.rs
@@ -0,0 +1,17 @@
+// compile-flags: -O
+// min-llvm-version: 16
+// ignore-debug: the debug assertions get in the way
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn test() -> usize {
+ // CHECK-LABEL: @test(
+ // CHECK: ret {{i64|i32}} 165
+ let values = [23, 16, 54, 3, 60, 9];
+ let mut acc = 0;
+ for item in values {
+ acc += item;
+ }
+ acc
+}
diff --git a/tests/codegen/issues/issue-101814.rs b/tests/codegen/issues/issue-101814.rs
new file mode 100644
index 000000000..13796352c
--- /dev/null
+++ b/tests/codegen/issues/issue-101814.rs
@@ -0,0 +1,20 @@
+// compile-flags: -O
+// min-llvm-version: 16
+// ignore-debug: the debug assertions get in the way
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn test(a: [i32; 10]) -> i32 {
+ // CHECK-LABEL: @test(
+ // CHECK: [[L1:%.+]] = load i32
+ // CHECK: [[L2:%.+]] = load i32
+ // CHECK: [[R:%.+]] = add i32 [[L1]], [[L2]]
+ // CHECK: ret i32 [[R]]
+ let mut sum = 0;
+ for v in a.iter().skip(8) {
+ sum += v;
+ }
+
+ sum
+}
diff --git a/tests/codegen/issues/issue-103132.rs b/tests/codegen/issues/issue-103132.rs
new file mode 100644
index 000000000..cc87d7cd2
--- /dev/null
+++ b/tests/codegen/issues/issue-103132.rs
@@ -0,0 +1,16 @@
+// compile-flags: -O -C overflow-checks
+// min-llvm-version: 16
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn test(arr: &[u8], weight: u32) {
+ // CHECK-LABEL: @test(
+ // CHECK-NOT: panic
+ let weight = weight.min(256 * 256 * 256);
+
+ for x in arr {
+ assert!(weight <= 256 * 256 * 256);
+ let result = *x as u32 * weight;
+ }
+}
diff --git a/tests/codegen/issue-103285-ptr-addr-overflow-check.rs b/tests/codegen/issues/issue-103285-ptr-addr-overflow-check.rs
index a3499babe..a3499babe 100644
--- a/tests/codegen/issue-103285-ptr-addr-overflow-check.rs
+++ b/tests/codegen/issues/issue-103285-ptr-addr-overflow-check.rs
diff --git a/tests/codegen/issues/issue-103327.rs b/tests/codegen/issues/issue-103327.rs
new file mode 100644
index 000000000..cee00facc
--- /dev/null
+++ b/tests/codegen/issues/issue-103327.rs
@@ -0,0 +1,18 @@
+// compile-flags: -O
+// min-llvm-version: 16
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn test(a: i32, b: i32) -> bool {
+ // CHECK-LABEL: @test(
+ // CHECK: ret i1 true
+ let c1 = (a >= 0) && (a <= 10);
+ let c2 = (b >= 0) && (b <= 20);
+
+ if c1 & c2 {
+ a + 100 != b
+ } else {
+ true
+ }
+}
diff --git a/tests/codegen/issue-103840.rs b/tests/codegen/issues/issue-103840.rs
index f19d7031b..f19d7031b 100644
--- a/tests/codegen/issue-103840.rs
+++ b/tests/codegen/issues/issue-103840.rs
diff --git a/tests/codegen/issue-105386-ub-in-debuginfo.rs b/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
index d54ac9e33..d54ac9e33 100644
--- a/tests/codegen/issue-105386-ub-in-debuginfo.rs
+++ b/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
diff --git a/tests/codegen/issues/issue-106369.rs b/tests/codegen/issues/issue-106369.rs
new file mode 100644
index 000000000..3fe7be4f1
--- /dev/null
+++ b/tests/codegen/issues/issue-106369.rs
@@ -0,0 +1,15 @@
+// compile-flags: -O
+// ignore-debug (the extra assertions get in the way)
+
+#![crate_type = "lib"]
+
+// From <https://github.com/rust-lang/rust/issues/106369#issuecomment-1369095304>
+
+// CHECK-LABEL: @issue_106369(
+#[no_mangle]
+pub unsafe fn issue_106369(ptr: *const &i32) -> bool {
+ // CHECK-NOT: icmp
+ // CHECK: ret i1 true
+ // CHECK-NOT: icmp
+ Some(std::ptr::read(ptr)).is_some()
+}
diff --git a/tests/codegen/issue-13018.rs b/tests/codegen/issues/issue-13018.rs
index b70ea1f48..b70ea1f48 100644
--- a/tests/codegen/issue-13018.rs
+++ b/tests/codegen/issues/issue-13018.rs
diff --git a/tests/codegen/issue-15953.rs b/tests/codegen/issues/issue-15953.rs
index 28d284289..28d284289 100644
--- a/tests/codegen/issue-15953.rs
+++ b/tests/codegen/issues/issue-15953.rs
diff --git a/tests/codegen/issue-27130.rs b/tests/codegen/issues/issue-27130.rs
index e5ee94e1f..e5ee94e1f 100644
--- a/tests/codegen/issue-27130.rs
+++ b/tests/codegen/issues/issue-27130.rs
diff --git a/tests/codegen/issue-32031.rs b/tests/codegen/issues/issue-32031.rs
index abef92c19..abef92c19 100644
--- a/tests/codegen/issue-32031.rs
+++ b/tests/codegen/issues/issue-32031.rs
diff --git a/tests/codegen/issue-32364.rs b/tests/codegen/issues/issue-32364.rs
index 85493a4bb..85493a4bb 100644
--- a/tests/codegen/issue-32364.rs
+++ b/tests/codegen/issues/issue-32364.rs
diff --git a/tests/codegen/issue-34634.rs b/tests/codegen/issues/issue-34634.rs
index f53fa240c..f53fa240c 100644
--- a/tests/codegen/issue-34634.rs
+++ b/tests/codegen/issues/issue-34634.rs
diff --git a/tests/codegen/issue-34947-pow-i32.rs b/tests/codegen/issues/issue-34947-pow-i32.rs
index 653da8e8b..653da8e8b 100644
--- a/tests/codegen/issue-34947-pow-i32.rs
+++ b/tests/codegen/issues/issue-34947-pow-i32.rs
diff --git a/tests/codegen/issue-37945.rs b/tests/codegen/issues/issue-37945.rs
index fe54375bb..4f386d335 100644
--- a/tests/codegen/issue-37945.rs
+++ b/tests/codegen/issues/issue-37945.rs
@@ -1,9 +1,6 @@
// compile-flags: -O -Zmerge-functions=disabled
-// ignore-x86
-// ignore-arm
-// ignore-emscripten
-// ignore-gnux32
-// ignore 32-bit platforms (LLVM has a bug with them)
+// ignore-32bit LLVM has a bug with them
+// ignore-debug
// Check that LLVM understands that `Iter` pointer is not null. Issue #37945.
diff --git a/tests/codegen/issue-44056-macos-tls-align.rs b/tests/codegen/issues/issue-44056-macos-tls-align.rs
index 1a3923f1b..1a3923f1b 100644
--- a/tests/codegen/issue-44056-macos-tls-align.rs
+++ b/tests/codegen/issues/issue-44056-macos-tls-align.rs
diff --git a/tests/codegen/issue-45222.rs b/tests/codegen/issues/issue-45222.rs
index e9b05e648..e9b05e648 100644
--- a/tests/codegen/issue-45222.rs
+++ b/tests/codegen/issues/issue-45222.rs
diff --git a/tests/codegen/issue-45466.rs b/tests/codegen/issues/issue-45466.rs
index c79542767..c79542767 100644
--- a/tests/codegen/issue-45466.rs
+++ b/tests/codegen/issues/issue-45466.rs
diff --git a/tests/codegen/issue-45964-bounds-check-slice-pos.rs b/tests/codegen/issues/issue-45964-bounds-check-slice-pos.rs
index 1daa213fc..1daa213fc 100644
--- a/tests/codegen/issue-45964-bounds-check-slice-pos.rs
+++ b/tests/codegen/issues/issue-45964-bounds-check-slice-pos.rs
diff --git a/tests/codegen/issue-47278.rs b/tests/codegen/issues/issue-47278.rs
index 9076274f4..9076274f4 100644
--- a/tests/codegen/issue-47278.rs
+++ b/tests/codegen/issues/issue-47278.rs
diff --git a/tests/codegen/issue-47442.rs b/tests/codegen/issues/issue-47442.rs
index 6944336d3..6944336d3 100644
--- a/tests/codegen/issue-47442.rs
+++ b/tests/codegen/issues/issue-47442.rs
diff --git a/tests/codegen/issue-56267-2.rs b/tests/codegen/issues/issue-56267-2.rs
index 4dc9ebfeb..4dc9ebfeb 100644
--- a/tests/codegen/issue-56267-2.rs
+++ b/tests/codegen/issues/issue-56267-2.rs
diff --git a/tests/codegen/issue-56267.rs b/tests/codegen/issues/issue-56267.rs
index 7bdd25779..7bdd25779 100644
--- a/tests/codegen/issue-56267.rs
+++ b/tests/codegen/issues/issue-56267.rs
diff --git a/tests/codegen/issue-56927.rs b/tests/codegen/issues/issue-56927.rs
index 044d72181..044d72181 100644
--- a/tests/codegen/issue-56927.rs
+++ b/tests/codegen/issues/issue-56927.rs
diff --git a/tests/codegen/issue-58881.rs b/tests/codegen/issues/issue-58881.rs
index 00f8953d9..00f8953d9 100644
--- a/tests/codegen/issue-58881.rs
+++ b/tests/codegen/issues/issue-58881.rs
diff --git a/tests/codegen/issue-59352.rs b/tests/codegen/issues/issue-59352.rs
index d271fe027..d271fe027 100644
--- a/tests/codegen/issue-59352.rs
+++ b/tests/codegen/issues/issue-59352.rs
diff --git a/tests/codegen/issue-69101-bounds-check.rs b/tests/codegen/issues/issue-69101-bounds-check.rs
index a3aca3a29..a3aca3a29 100644
--- a/tests/codegen/issue-69101-bounds-check.rs
+++ b/tests/codegen/issues/issue-69101-bounds-check.rs
diff --git a/tests/codegen/issue-73031.rs b/tests/codegen/issues/issue-73031.rs
index a09c4bcfb..a09c4bcfb 100644
--- a/tests/codegen/issue-73031.rs
+++ b/tests/codegen/issues/issue-73031.rs
diff --git a/tests/codegen/issues/issue-73258.rs b/tests/codegen/issues/issue-73258.rs
new file mode 100644
index 000000000..0134f929b
--- /dev/null
+++ b/tests/codegen/issues/issue-73258.rs
@@ -0,0 +1,38 @@
+// compile-flags: -O
+// ignore-debug (the extra assertions get in the way)
+
+#![crate_type = "lib"]
+
+// Adapted from <https://github.com/rust-lang/rust/issues/73258#issue-637346014>
+
+#[derive(Clone, Copy)]
+#[repr(u8)]
+pub enum Foo {
+ A, B, C, D,
+}
+
+// CHECK-LABEL: @issue_73258(
+#[no_mangle]
+pub unsafe fn issue_73258(ptr: *const Foo) -> Foo {
+ // CHECK-NOT: icmp
+ // CHECK-NOT: call
+ // CHECK-NOT: br
+ // CHECK-NOT: select
+
+ // CHECK: %[[R:.+]] = load i8
+ // CHECK-SAME: !range !
+
+ // CHECK-NOT: icmp
+ // CHECK-NOT: call
+ // CHECK-NOT: br
+ // CHECK-NOT: select
+
+ // CHECK: ret i8 %[[R]]
+
+ // CHECK-NOT: icmp
+ // CHECK-NOT: call
+ // CHECK-NOT: br
+ // CHECK-NOT: select
+ let k: Option<Foo> = Some(ptr.read());
+ return k.unwrap();
+}
diff --git a/tests/codegen/issue-73338-effecient-cmp.rs b/tests/codegen/issues/issue-73338-effecient-cmp.rs
index 85c2bbfd0..85c2bbfd0 100644
--- a/tests/codegen/issue-73338-effecient-cmp.rs
+++ b/tests/codegen/issues/issue-73338-effecient-cmp.rs
diff --git a/tests/codegen/issue-73396-bounds-check-after-position.rs b/tests/codegen/issues/issue-73396-bounds-check-after-position.rs
index 8d07a67a1..8d07a67a1 100644
--- a/tests/codegen/issue-73396-bounds-check-after-position.rs
+++ b/tests/codegen/issues/issue-73396-bounds-check-after-position.rs
diff --git a/tests/codegen/issue-73827-bounds-check-index-in-subexpr.rs b/tests/codegen/issues/issue-73827-bounds-check-index-in-subexpr.rs
index 1ad05906e..1ad05906e 100644
--- a/tests/codegen/issue-73827-bounds-check-index-in-subexpr.rs
+++ b/tests/codegen/issues/issue-73827-bounds-check-index-in-subexpr.rs
diff --git a/tests/codegen/issue-75525-bounds-checks.rs b/tests/codegen/issues/issue-75525-bounds-checks.rs
index 2d363d8f7..2d363d8f7 100644
--- a/tests/codegen/issue-75525-bounds-checks.rs
+++ b/tests/codegen/issues/issue-75525-bounds-checks.rs
diff --git a/tests/codegen/issue-75546.rs b/tests/codegen/issues/issue-75546.rs
index 470a9e040..470a9e040 100644
--- a/tests/codegen/issue-75546.rs
+++ b/tests/codegen/issues/issue-75546.rs
diff --git a/tests/codegen/issue-75659.rs b/tests/codegen/issues/issue-75659.rs
index 9394868c0..9394868c0 100644
--- a/tests/codegen/issue-75659.rs
+++ b/tests/codegen/issues/issue-75659.rs
diff --git a/tests/codegen/issues/issue-75978.rs b/tests/codegen/issues/issue-75978.rs
new file mode 100644
index 000000000..f335e92c3
--- /dev/null
+++ b/tests/codegen/issues/issue-75978.rs
@@ -0,0 +1,19 @@
+// compile-flags: -O
+// min-llvm-version: 16
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn test() -> u32 {
+ // CHECK-LABEL: @test(
+ // CHECK: ret i32 13
+ let s = [1, 2, 3, 4, 5, 6, 7];
+
+ let mut iter = s.iter();
+ let mut sum = 0;
+ while let Some(_) = iter.next() {
+ sum += iter.next().map_or(1, |&x| x)
+ }
+
+ sum
+}
diff --git a/tests/codegen/issue-77812.rs b/tests/codegen/issues/issue-77812.rs
index 4cc824145..4cc824145 100644
--- a/tests/codegen/issue-77812.rs
+++ b/tests/codegen/issues/issue-77812.rs
diff --git a/tests/codegen/issue-81408-dllimport-thinlto-windows.rs b/tests/codegen/issues/issue-81408-dllimport-thinlto-windows.rs
index 0b6ab4f7e..0b6ab4f7e 100644
--- a/tests/codegen/issue-81408-dllimport-thinlto-windows.rs
+++ b/tests/codegen/issues/issue-81408-dllimport-thinlto-windows.rs
diff --git a/tests/codegen/issue-84268.rs b/tests/codegen/issues/issue-84268.rs
index 7ca195447..7ca195447 100644
--- a/tests/codegen/issue-84268.rs
+++ b/tests/codegen/issues/issue-84268.rs
diff --git a/tests/codegen/issue-85872-multiple-reverse.rs b/tests/codegen/issues/issue-85872-multiple-reverse.rs
index 591a1aca7..591a1aca7 100644
--- a/tests/codegen/issue-85872-multiple-reverse.rs
+++ b/tests/codegen/issues/issue-85872-multiple-reverse.rs
diff --git a/tests/codegen/issue-86106.rs b/tests/codegen/issues/issue-86106.rs
index 9ccbcb24f..9ccbcb24f 100644
--- a/tests/codegen/issue-86106.rs
+++ b/tests/codegen/issues/issue-86106.rs
diff --git a/tests/codegen/issue-96274.rs b/tests/codegen/issues/issue-96274.rs
index 28bfcce0d..28bfcce0d 100644
--- a/tests/codegen/issue-96274.rs
+++ b/tests/codegen/issues/issue-96274.rs
diff --git a/tests/codegen/issue-96497-slice-size-nowrap.rs b/tests/codegen/issues/issue-96497-slice-size-nowrap.rs
index 0413ed6b2..0413ed6b2 100644
--- a/tests/codegen/issue-96497-slice-size-nowrap.rs
+++ b/tests/codegen/issues/issue-96497-slice-size-nowrap.rs
diff --git a/tests/codegen/issue-98156-const-arg-temp-lifetime.rs b/tests/codegen/issues/issue-98156-const-arg-temp-lifetime.rs
index 12ace5fff..12ace5fff 100644
--- a/tests/codegen/issue-98156-const-arg-temp-lifetime.rs
+++ b/tests/codegen/issues/issue-98156-const-arg-temp-lifetime.rs
diff --git a/tests/codegen/issue-98294-get-mut-copy-from-slice-opt.rs b/tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs
index 7da29cd79..7da29cd79 100644
--- a/tests/codegen/issue-98294-get-mut-copy-from-slice-opt.rs
+++ b/tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs
diff --git a/tests/codegen/issues/issue-99960.rs b/tests/codegen/issues/issue-99960.rs
new file mode 100644
index 000000000..e9c9367fa
--- /dev/null
+++ b/tests/codegen/issues/issue-99960.rs
@@ -0,0 +1,15 @@
+// compile-flags: -O
+// min-llvm-version: 16
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn test(dividend: i64, divisor: i64) -> Option<i64> {
+ // CHECK-LABEL: @test(
+ // CHECK-NOT: panic
+ if dividend > i64::min_value() && divisor != 0 {
+ Some(dividend / divisor)
+ } else {
+ None
+ }
+}
diff --git a/tests/codegen/mem-replace-big-type.rs b/tests/codegen/mem-replace-big-type.rs
new file mode 100644
index 000000000..f6898e2f7
--- /dev/null
+++ b/tests/codegen/mem-replace-big-type.rs
@@ -0,0 +1,36 @@
+// This test ensures that `mem::replace::<T>` only ever calls `@llvm.memcpy`
+// with `size_of::<T>()` as the size, and never goes through any wrapper that
+// may e.g. multiply `size_of::<T>()` with a variable "count" (which is only
+// known to be `1` after inlining).
+
+// compile-flags: -C no-prepopulate-passes -Zinline-mir=no
+// ignore-debug: the debug assertions get in the way
+
+#![crate_type = "lib"]
+
+#[repr(C, align(8))]
+pub struct Big([u64; 7]);
+pub fn replace_big(dst: &mut Big, src: Big) -> Big {
+ // Before the `read_via_copy` intrinsic, this emitted six `memcpy`s.
+ std::mem::replace(dst, src)
+}
+
+// NOTE(eddyb) the `CHECK-NOT`s ensure that the only calls of `@llvm.memcpy` in
+// the entire output, are the direct calls we want, from `ptr::replace`.
+
+// CHECK-NOT: call void @llvm.memcpy
+
+// For a large type, we expect exactly three `memcpy`s
+// CHECK-LABEL: define internal void @{{.+}}mem{{.+}}replace{{.+}}sret(%Big)
+ // CHECK-NOT: alloca
+ // CHECK: alloca %Big
+ // CHECK-NOT: alloca
+ // CHECK-NOT: call void @llvm.memcpy
+ // CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %{{.*}}, {{i8\*|ptr}} align 8 %{{.*}}, i{{.*}} 56, i1 false)
+ // CHECK-NOT: call void @llvm.memcpy
+ // CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %{{.*}}, {{i8\*|ptr}} align 8 %{{.*}}, i{{.*}} 56, i1 false)
+ // CHECK-NOT: call void @llvm.memcpy
+ // CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %{{.*}}, {{i8\*|ptr}} align 8 %{{.*}}, i{{.*}} 56, i1 false)
+ // CHECK-NOT: call void @llvm.memcpy
+
+// CHECK-NOT: call void @llvm.memcpy
diff --git a/tests/codegen/mem-replace-direct-memcpy.rs b/tests/codegen/mem-replace-direct-memcpy.rs
index e8bbf0e1b..83babab4f 100644
--- a/tests/codegen/mem-replace-direct-memcpy.rs
+++ b/tests/codegen/mem-replace-direct-memcpy.rs
@@ -13,12 +13,21 @@ pub fn replace_byte(dst: &mut u8, src: u8) -> u8 {
}
// NOTE(eddyb) the `CHECK-NOT`s ensure that the only calls of `@llvm.memcpy` in
-// the entire output, are the two direct calls we want, from `ptr::replace`.
+// the entire output, are the direct calls we want, from `ptr::replace`.
// CHECK-NOT: call void @llvm.memcpy
-// CHECK: ; core::mem::replace
-// CHECK-NOT: call void @llvm.memcpy
-// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, i{{.*}} 1, i1 false)
-// CHECK-NOT: call void @llvm.memcpy
-// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, i{{.*}} 1, i1 false)
+
+// For a small type, we expect one each of `load`/`store`/`memcpy` instead
+// CHECK-LABEL: define internal noundef i8 @{{.+}}mem{{.+}}replace
+ // CHECK-NOT: alloca
+ // CHECK: alloca i8
+ // CHECK-NOT: alloca
+ // CHECK-NOT: call void @llvm.memcpy
+ // CHECK: load i8
+ // CHECK-NOT: call void @llvm.memcpy
+ // CHECK: store i8
+ // CHECK-NOT: call void @llvm.memcpy
+ // CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, i{{.*}} 1, i1 false)
+ // CHECK-NOT: call void @llvm.memcpy
+
// CHECK-NOT: call void @llvm.memcpy
diff --git a/tests/codegen/optimize-attr-1.rs b/tests/codegen/optimize-attr-1.rs
index 22abe06e7..1d1f0a386 100644
--- a/tests/codegen/optimize-attr-1.rs
+++ b/tests/codegen/optimize-attr-1.rs
@@ -8,7 +8,6 @@
// CHECK-LABEL: define{{.*}}i32 @nothing
// CHECK-SAME: [[NOTHING_ATTRS:#[0-9]+]]
-// NO-OPT: ret i32 4
// SIZE-OPT: ret i32 4
// SPEEC-OPT: ret i32 4
#[no_mangle]
@@ -18,7 +17,6 @@ pub fn nothing() -> i32 {
// CHECK-LABEL: define{{.*}}i32 @size
// CHECK-SAME: [[SIZE_ATTRS:#[0-9]+]]
-// NO-OPT: ret i32 6
// SIZE-OPT: ret i32 6
// SPEED-OPT: ret i32 6
#[optimize(size)]
@@ -31,7 +29,6 @@ pub fn size() -> i32 {
// NO-OPT-SAME: [[NOTHING_ATTRS]]
// SPEED-OPT-SAME: [[NOTHING_ATTRS]]
// SIZE-OPT-SAME: [[SPEED_ATTRS:#[0-9]+]]
-// NO-OPT: ret i32 8
// SIZE-OPT: ret i32 8
// SPEED-OPT: ret i32 8
#[optimize(speed)]
diff --git a/tests/codegen/option-as-slice.rs b/tests/codegen/option-as-slice.rs
index d5077dbf6..d735d5583 100644
--- a/tests/codegen/option-as-slice.rs
+++ b/tests/codegen/option-as-slice.rs
@@ -1,4 +1,4 @@
-// compile-flags: -O
+// compile-flags: -O -Z randomize-layout=no
// only-x86_64
#![crate_type = "lib"]
@@ -12,17 +12,25 @@ use core::option::Option;
// CHECK-LABEL: @u64_opt_as_slice
#[no_mangle]
pub fn u64_opt_as_slice(o: &Option<u64>) -> &[u64] {
- // CHECK: start:
// CHECK-NOT: select
- // CHECK: ret
+ // CHECK-NOT: br
+ // CHECK-NOT: switch
+ // CHECK-NOT: icmp
o.as_slice()
}
// CHECK-LABEL: @nonzero_u64_opt_as_slice
#[no_mangle]
pub fn nonzero_u64_opt_as_slice(o: &Option<NonZeroU64>) -> &[NonZeroU64] {
- // CHECK: start:
// CHECK-NOT: select
- // CHECK: ret
+ // CHECK-NOT: br
+ // CHECK-NOT: switch
+ // CHECK-NOT: icmp
+ // CHECK: %[[NZ:.+]] = icmp ne i64 %{{.+}}, 0
+ // CHECK-NEXT: zext i1 %[[NZ]] to i64
+ // CHECK-NOT: select
+ // CHECK-NOT: br
+ // CHECK-NOT: switch
+ // CHECK-NOT: icmp
o.as_slice()
}
diff --git a/tests/codegen/ptr-read-metadata.rs b/tests/codegen/ptr-read-metadata.rs
new file mode 100644
index 000000000..e1e327266
--- /dev/null
+++ b/tests/codegen/ptr-read-metadata.rs
@@ -0,0 +1,96 @@
+// compile-flags: -O -Z merge-functions=disabled
+// no-system-llvm
+// ignore-debug (the extra assertions get in the way)
+
+#![crate_type = "lib"]
+
+// Ensure that various forms of reading pointers correctly annotate the `load`s
+// with `!noundef` and `!range` metadata to enable extra optimization.
+
+use std::mem::MaybeUninit;
+
+// CHECK-LABEL: define noundef i8 @copy_byte(
+#[no_mangle]
+pub unsafe fn copy_byte(p: *const u8) -> u8 {
+ // CHECK-NOT: load
+ // CHECK: load i8, ptr %p, align 1
+ // CHECK-SAME: !noundef !
+ // CHECK-NOT: load
+ *p
+}
+
+// CHECK-LABEL: define noundef i8 @read_byte(
+#[no_mangle]
+pub unsafe fn read_byte(p: *const u8) -> u8 {
+ // CHECK-NOT: load
+ // CHECK: load i8, ptr %p, align 1
+ // CHECK-SAME: !noundef !
+ // CHECK-NOT: load
+ p.read()
+}
+
+// CHECK-LABEL: define i8 @read_byte_maybe_uninit(
+#[no_mangle]
+pub unsafe fn read_byte_maybe_uninit(p: *const MaybeUninit<u8>) -> MaybeUninit<u8> {
+ // CHECK-NOT: load
+ // CHECK: load i8, ptr %p, align 1
+ // CHECK-NOT: noundef
+ // CHECK-NOT: load
+ p.read()
+}
+
+// CHECK-LABEL: define noundef i8 @read_byte_assume_init(
+#[no_mangle]
+pub unsafe fn read_byte_assume_init(p: &MaybeUninit<u8>) -> u8 {
+ // CHECK-NOT: load
+ // CHECK: load i8, ptr %p, align 1
+ // CHECK-SAME: !noundef !
+ // CHECK-NOT: load
+ p.assume_init_read()
+}
+
+// CHECK-LABEL: define noundef i32 @copy_char(
+#[no_mangle]
+pub unsafe fn copy_char(p: *const char) -> char {
+ // CHECK-NOT: load
+ // CHECK: load i32, ptr %p
+ // CHECK-SAME: !range ![[RANGE:[0-9]+]]
+ // CHECK-SAME: !noundef !
+ // CHECK-NOT: load
+ *p
+}
+
+// CHECK-LABEL: define noundef i32 @read_char(
+#[no_mangle]
+pub unsafe fn read_char(p: *const char) -> char {
+ // CHECK-NOT: load
+ // CHECK: load i32, ptr %p
+ // CHECK-SAME: !range ![[RANGE]]
+ // CHECK-SAME: !noundef !
+ // CHECK-NOT: load
+ p.read()
+}
+
+// CHECK-LABEL: define i32 @read_char_maybe_uninit(
+#[no_mangle]
+pub unsafe fn read_char_maybe_uninit(p: *const MaybeUninit<char>) -> MaybeUninit<char> {
+ // CHECK-NOT: load
+ // CHECK: load i32, ptr %p
+ // CHECK-NOT: range
+ // CHECK-NOT: noundef
+ // CHECK-NOT: load
+ p.read()
+}
+
+// CHECK-LABEL: define noundef i32 @read_char_assume_init(
+#[no_mangle]
+pub unsafe fn read_char_assume_init(p: &MaybeUninit<char>) -> char {
+ // CHECK-NOT: load
+ // CHECK: load i32, ptr %p
+ // CHECK-SAME: !range ![[RANGE]]
+ // CHECK-SAME: !noundef !
+ // CHECK-NOT: load
+ p.assume_init_read()
+}
+
+// CHECK: ![[RANGE]] = !{i32 0, i32 1114112}
diff --git a/tests/codegen/remap_path_prefix/main.rs b/tests/codegen/remap_path_prefix/main.rs
index 6c0cd6997..f1e1dd69b 100644
--- a/tests/codegen/remap_path_prefix/main.rs
+++ b/tests/codegen/remap_path_prefix/main.rs
@@ -12,7 +12,7 @@ mod aux_mod;
include!("aux_mod.rs");
// Here we check that the expansion of the file!() macro is mapped.
-// CHECK: @alloc_92a59126a55aa3c0019b6c8a007fe001 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>
+// CHECK: @alloc_5761061597a97f66e13ef2ff92712c4b = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>
pub static FILE_PATH: &'static str = file!();
fn main() {
diff --git a/tests/codegen/repr-transparent-aggregates-2.rs b/tests/codegen/repr-transparent-aggregates-2.rs
index df7e88f08..e9fa5143b 100644
--- a/tests/codegen/repr-transparent-aggregates-2.rs
+++ b/tests/codegen/repr-transparent-aggregates-2.rs
@@ -6,7 +6,6 @@
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
-// ignore-powerpc64le
// ignore-riscv64 see codegen/riscv-abi
// ignore-s390x
// ignore-sparc
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
index 7c77398df..fd488a14b 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
@@ -4,7 +4,8 @@
#![crate_type = "lib"]
#![allow(non_camel_case_types)]
-#![feature(repr_simd, platform_intrinsics, min_const_generics)]
+#![feature(repr_simd, platform_intrinsics)]
+#![feature(inline_const)]
#[repr(simd)]
#[derive(Copy, Clone)]
@@ -18,23 +19,65 @@ pub struct T([f32; 4]);
#[derive(Copy, Clone)]
pub struct U(f32, f32, f32, f32);
+// CHECK-LABEL: @array_align(
+#[no_mangle]
+pub fn array_align() -> usize {
+ // CHECK: ret [[USIZE:i[0-9]+]] [[ARRAY_ALIGN:[0-9]+]]
+ const { std::mem::align_of::<f32>() }
+}
+
+// CHECK-LABEL: @vector_align(
+#[no_mangle]
+pub fn vector_align() -> usize {
+ // CHECK: ret [[USIZE]] [[VECTOR_ALIGN:[0-9]+]]
+ const { std::mem::align_of::<U>() }
+}
+
// CHECK-LABEL: @build_array_s
#[no_mangle]
pub fn build_array_s(x: [f32; 4]) -> S<4> {
- // CHECK: call void @llvm.memcpy.{{.+}}({{.*}}, i{{[0-9]+}} 16, i1 false)
+ // CHECK: call void @llvm.memcpy.{{.+}}({{.*}} align [[VECTOR_ALIGN]] {{.*}} align [[ARRAY_ALIGN]] {{.*}}, [[USIZE]] 16, i1 false)
S::<4>(x)
}
+// CHECK-LABEL: @build_array_transmute_s
+#[no_mangle]
+pub fn build_array_transmute_s(x: [f32; 4]) -> S<4> {
+ // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]]
+ // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %0|.+>\* %.+}}, align [[VECTOR_ALIGN]]
+ unsafe { std::mem::transmute(x) }
+}
+
// CHECK-LABEL: @build_array_t
#[no_mangle]
pub fn build_array_t(x: [f32; 4]) -> T {
- // CHECK: call void @llvm.memcpy.{{.+}}({{.*}}, i{{[0-9]+}} 16, i1 false)
+ // CHECK: call void @llvm.memcpy.{{.+}}({{.*}} align [[VECTOR_ALIGN]] {{.*}} align [[ARRAY_ALIGN]] {{.*}}, [[USIZE]] 16, i1 false)
T(x)
}
+// CHECK-LABEL: @build_array_transmute_t
+#[no_mangle]
+pub fn build_array_transmute_t(x: [f32; 4]) -> T {
+ // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]]
+ // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %0|.+>\* %.+}}, align [[VECTOR_ALIGN]]
+ unsafe { std::mem::transmute(x) }
+}
+
// CHECK-LABEL: @build_array_u
#[no_mangle]
pub fn build_array_u(x: [f32; 4]) -> U {
- // CHECK: call void @llvm.memcpy.{{.+}}({{.*}}, i{{[0-9]+}} 16, i1 false)
+ // CHECK: store float %a, {{.+}}, align [[VECTOR_ALIGN]]
+ // CHECK: store float %b, {{.+}}, align [[ARRAY_ALIGN]]
+ // CHECK: store float %c, {{.+}}, align
+ // CHECK: store float %d, {{.+}}, align [[ARRAY_ALIGN]]
+ let [a, b, c, d] = x;
+ U(a, b, c, d)
+}
+
+// CHECK-LABEL: @build_array_transmute_u
+#[no_mangle]
+pub fn build_array_transmute_u(x: [f32; 4]) -> U {
+ // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]]
+ // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %0|.+>\* %.+}}, align [[VECTOR_ALIGN]]
unsafe { std::mem::transmute(x) }
}
diff --git a/tests/codegen/simd-wide-sum.rs b/tests/codegen/simd-wide-sum.rs
index 04314dc29..db2aa20bd 100644
--- a/tests/codegen/simd-wide-sum.rs
+++ b/tests/codegen/simd-wide-sum.rs
@@ -1,4 +1,4 @@
-// compile-flags: -C opt-level=3 --edition=2021
+// compile-flags: -C opt-level=3 -Z merge-functions=disabled --edition=2021
// only-x86_64
// ignore-debug: the debug assertions get in the way
diff --git a/tests/codegen/slice-indexing.rs b/tests/codegen/slice-indexing.rs
new file mode 100644
index 000000000..c40d59fb0
--- /dev/null
+++ b/tests/codegen/slice-indexing.rs
@@ -0,0 +1,35 @@
+// compile-flags: -O
+// only-64bit (because the LLVM type of i64 for usize shows up)
+// ignore-debug: the debug assertions get in the way
+
+#![crate_type = "lib"]
+
+use std::ops::Range;
+
+// CHECK-LABEL: @index_by_range(
+#[no_mangle]
+pub fn index_by_range(x: &[u16], r: Range<usize>) -> &[u16] {
+ // CHECK: sub nuw i64
+ &x[r]
+}
+
+// CHECK-LABEL: @get_unchecked_by_range(
+#[no_mangle]
+pub unsafe fn get_unchecked_by_range(x: &[u16], r: Range<usize>) -> &[u16] {
+ // CHECK: sub nuw i64
+ x.get_unchecked(r)
+}
+
+// CHECK-LABEL: @index_mut_by_range(
+#[no_mangle]
+pub fn index_mut_by_range(x: &mut [i32], r: Range<usize>) -> &mut [i32] {
+ // CHECK: sub nuw i64
+ &mut x[r]
+}
+
+// CHECK-LABEL: @get_unchecked_mut_by_range(
+#[no_mangle]
+pub unsafe fn get_unchecked_mut_by_range(x: &mut [i32], r: Range<usize>) -> &mut [i32] {
+ // CHECK: sub nuw i64
+ x.get_unchecked_mut(r)
+}
diff --git a/tests/codegen/transmute-scalar.rs b/tests/codegen/transmute-scalar.rs
index 260dcbac0..af2cef472 100644
--- a/tests/codegen/transmute-scalar.rs
+++ b/tests/codegen/transmute-scalar.rs
@@ -1,80 +1,57 @@
// compile-flags: -O -C no-prepopulate-passes
+// min-llvm-version: 15.0 # this test assumes `ptr`s and thus no `pointercast`s
#![crate_type = "lib"]
-// FIXME(eddyb) all of these tests show memory stores and loads, even after a
-// scalar `bitcast`, more special-casing is required to remove `alloca` usage.
+// With opaque ptrs in LLVM, `transmute` can load/store any `alloca` as any type,
+// without needing to pointercast, and SRoA will turn that into a `bitcast`.
+// Thus memory-to-memory transmutes don't need to generate them ourselves.
+
+// However, `bitcast`s and `ptrtoint`s and `inttoptr`s are still worth doing when
+// that allows us to avoid the `alloca`s entirely; see `rvalue_creates_operand`.
// CHECK-LABEL: define{{.*}}i32 @f32_to_bits(float noundef %x)
-// CHECK: store i32 %{{.*}}, {{.*}} %0
-// CHECK-NEXT: %[[RES:.*]] = load i32, {{.*}} %0
-// CHECK: ret i32 %[[RES]]
+// CHECK: %0 = bitcast float %x to i32
+// CHECK-NEXT: ret i32 %0
#[no_mangle]
pub fn f32_to_bits(x: f32) -> u32 {
unsafe { std::mem::transmute(x) }
}
// CHECK-LABEL: define{{.*}}i8 @bool_to_byte(i1 noundef zeroext %b)
-// CHECK: %1 = zext i1 %b to i8
-// CHECK-NEXT: store i8 %1, {{.*}} %0
-// CHECK-NEXT: %2 = load i8, {{.*}} %0
-// CHECK: ret i8 %2
+// CHECK: %0 = zext i1 %b to i8
+// CHECK-NEXT: ret i8 %0
#[no_mangle]
pub fn bool_to_byte(b: bool) -> u8 {
unsafe { std::mem::transmute(b) }
}
// CHECK-LABEL: define{{.*}}noundef zeroext i1 @byte_to_bool(i8 noundef %byte)
-// CHECK: %1 = trunc i8 %byte to i1
-// CHECK-NEXT: %2 = zext i1 %1 to i8
-// CHECK-NEXT: store i8 %2, {{.*}} %0
-// CHECK-NEXT: %3 = load i8, {{.*}} %0
-// CHECK-NEXT: %4 = trunc i8 %3 to i1
-// CHECK: ret i1 %4
+// CHECK: %0 = trunc i8 %byte to i1
+// CHECK-NEXT: ret i1 %0
#[no_mangle]
pub unsafe fn byte_to_bool(byte: u8) -> bool {
std::mem::transmute(byte)
}
-// CHECK-LABEL: define{{.*}}{{i8\*|ptr}} @ptr_to_ptr({{i16\*|ptr}} noundef %p)
-// CHECK: store {{i8\*|ptr}} %{{.*}}, {{.*}} %0
-// CHECK-NEXT: %[[RES:.*]] = load {{i8\*|ptr}}, {{.*}} %0
-// CHECK: ret {{i8\*|ptr}} %[[RES]]
+// CHECK-LABEL: define{{.*}}ptr @ptr_to_ptr(ptr noundef %p)
+// CHECK: ret ptr %p
#[no_mangle]
pub fn ptr_to_ptr(p: *mut u16) -> *mut u8 {
unsafe { std::mem::transmute(p) }
}
-// HACK(eddyb) scalar `transmute`s between pointers and non-pointers are
-// currently not special-cased like other scalar `transmute`s, because
-// LLVM requires specifically `ptrtoint`/`inttoptr` instead of `bitcast`.
-//
-// Tests below show the non-special-cased behavior (with the possible
-// future special-cased instructions in the "NOTE(eddyb)" comments).
-
-// CHECK: define{{.*}}[[USIZE:i[0-9]+]] @ptr_to_int({{i16\*|ptr}} noundef %p)
-
-// NOTE(eddyb) see above, the following two CHECK lines should ideally be this:
-// %2 = ptrtoint i16* %p to [[USIZE]]
-// store [[USIZE]] %2, [[USIZE]]* %0
-// CHECK: store {{i16\*|ptr}} %p, {{.*}}
-
-// CHECK-NEXT: %[[RES:.*]] = load [[USIZE]], {{.*}} %0
-// CHECK: ret [[USIZE]] %[[RES]]
+// CHECK: define{{.*}}[[USIZE:i[0-9]+]] @ptr_to_int(ptr noundef %p)
+// CHECK: %0 = ptrtoint ptr %p to [[USIZE]]
+// CHECK-NEXT: ret [[USIZE]] %0
#[no_mangle]
pub fn ptr_to_int(p: *mut u16) -> usize {
unsafe { std::mem::transmute(p) }
}
-// CHECK: define{{.*}}{{i16\*|ptr}} @int_to_ptr([[USIZE]] noundef %i)
-
-// NOTE(eddyb) see above, the following two CHECK lines should ideally be this:
-// %2 = inttoptr [[USIZE]] %i to i16*
-// store i16* %2, i16** %0
-// CHECK: store [[USIZE]] %i, {{.*}}
-
-// CHECK-NEXT: %[[RES:.*]] = load {{i16\*|ptr}}, {{.*}} %0
-// CHECK: ret {{i16\*|ptr}} %[[RES]]
+// CHECK: define{{.*}}ptr @int_to_ptr([[USIZE]] noundef %i)
+// CHECK: %0 = inttoptr [[USIZE]] %i to ptr
+// CHECK-NEXT: ret ptr %0
#[no_mangle]
pub fn int_to_ptr(i: usize) -> *mut u16 {
unsafe { std::mem::transmute(i) }
diff --git a/tests/codegen/var-names.rs b/tests/codegen/var-names.rs
index d4715efad..53841df32 100644
--- a/tests/codegen/var-names.rs
+++ b/tests/codegen/var-names.rs
@@ -9,7 +9,7 @@ pub fn test(a: u32, b: u32) -> u32 {
// CHECK: %c = add i32 %a, %b
let d = c;
let e = d * a;
- // CHECK-NEXT: %e = mul i32 %c, %a
+ // CHECK-NEXT: %0 = mul i32 %c, %a
e
- // CHECK-NEXT: ret i32 %e
+ // CHECK-NEXT: ret i32 %0
}
diff --git a/tests/codegen/vec-as-ptr.rs b/tests/codegen/vec-as-ptr.rs
new file mode 100644
index 000000000..8ff7ba9cb
--- /dev/null
+++ b/tests/codegen/vec-as-ptr.rs
@@ -0,0 +1,19 @@
+// compile-flags: -O -Zmerge-functions=disabled
+
+#![crate_type = "lib"]
+
+// Test that even though we return a *const u8 not a &[u8] or a NonNull<u8>, LLVM knows that this
+// pointer is nonnull.
+// CHECK: nonnull {{i8\*|ptr}} @vec_as_ptr
+#[no_mangle]
+pub fn vec_as_ptr(v: &Vec<u8>) -> *const u8 {
+ v.as_ptr()
+}
+
+// Test that even though we return a *const u8 not a &[u8] or a NonNull<u8>, LLVM knows that this
+// pointer is nonnull.
+// CHECK: nonnull {{i8\*|ptr}} @vec_as_mut_ptr
+#[no_mangle]
+pub fn vec_as_mut_ptr(v: &mut Vec<u8>) -> *mut u8 {
+ v.as_mut_ptr()
+}
diff --git a/tests/codegen/vec-in-place.rs b/tests/codegen/vec-in-place.rs
index 999260422..d68067ceb 100644
--- a/tests/codegen/vec-in-place.rs
+++ b/tests/codegen/vec-in-place.rs
@@ -1,11 +1,13 @@
// ignore-debug: the debug assertions get in the way
// compile-flags: -O -Z merge-functions=disabled
+// min-llvm-version: 16
#![crate_type = "lib"]
// Ensure that trivial casts of vec elements are O(1)
pub struct Wrapper<T>(T);
+// previously repr(C) caused the optimization to fail
#[repr(C)]
pub struct Foo {
a: u64,
@@ -14,9 +16,8 @@ pub struct Foo {
d: u64,
}
-// Going from an aggregate struct to another type currently requires Copy to
-// enable the TrustedRandomAccess specialization. Without it optimizations do not yet
-// reliably recognize the loops as noop for repr(C) or non-Copy structs.
+// implementing Copy exercises the TrustedRandomAccess specialization inside the in-place
+// specialization
#[derive(Copy, Clone)]
pub struct Bar {
a: u64,
@@ -25,6 +26,14 @@ pub struct Bar {
d: u64,
}
+// this exercises the try-fold codepath
+pub struct Baz {
+ a: u64,
+ b: u64,
+ c: u64,
+ d: u64,
+}
+
// CHECK-LABEL: @vec_iterator_cast_primitive
#[no_mangle]
pub fn vec_iterator_cast_primitive(vec: Vec<i8>) -> Vec<u8> {
@@ -52,18 +61,29 @@ pub fn vec_iterator_cast_unwrap(vec: Vec<Wrapper<u8>>) -> Vec<u8> {
// CHECK-LABEL: @vec_iterator_cast_aggregate
#[no_mangle]
pub fn vec_iterator_cast_aggregate(vec: Vec<[u64; 4]>) -> Vec<Foo> {
- // FIXME These checks should be the same as other functions.
- // CHECK-NOT: @__rust_alloc
- // CHECK-NOT: @__rust_alloc
+ // CHECK-NOT: loop
+ // CHECK-NOT: call
vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect()
}
-// CHECK-LABEL: @vec_iterator_cast_deaggregate
+// CHECK-LABEL: @vec_iterator_cast_deaggregate_tra
#[no_mangle]
-pub fn vec_iterator_cast_deaggregate(vec: Vec<Bar>) -> Vec<[u64; 4]> {
- // FIXME These checks should be the same as other functions.
- // CHECK-NOT: @__rust_alloc
- // CHECK-NOT: @__rust_alloc
+pub fn vec_iterator_cast_deaggregate_tra(vec: Vec<Bar>) -> Vec<[u64; 4]> {
+ // CHECK-NOT: loop
+ // CHECK-NOT: call
+
+ // Safety: For the purpose of this test we assume that Bar layout matches [u64; 4].
+ // This currently is not guaranteed for repr(Rust) types, but it happens to work here and
+ // the UCG may add additional guarantees for homogenous types in the future that would make this
+ // correct.
+ vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect()
+}
+
+// CHECK-LABEL: @vec_iterator_cast_deaggregate_fold
+#[no_mangle]
+pub fn vec_iterator_cast_deaggregate_fold(vec: Vec<Baz>) -> Vec<[u64; 4]> {
+ // CHECK-NOT: loop
+ // CHECK-NOT: call
// Safety: For the purpose of this test we assume that Bar layout matches [u64; 4].
// This currently is not guaranteed for repr(Rust) types, but it happens to work here and
diff --git a/tests/codegen/vec-shrink-panik.rs b/tests/codegen/vec-shrink-panik.rs
index aa6589dc3..b3c3483fe 100644
--- a/tests/codegen/vec-shrink-panik.rs
+++ b/tests/codegen/vec-shrink-panik.rs
@@ -1,3 +1,8 @@
+// revisions: old new
+// LLVM 17 realizes double panic is not possible and doesn't generate calls
+// to panic_cannot_unwind.
+// [old]ignore-llvm-version: 17 - 99
+// [new]min-llvm-version: 17
// compile-flags: -O
// ignore-debug: the debug assertions get in the way
#![crate_type = "lib"]
@@ -18,11 +23,11 @@ pub fn shrink_to_fit(vec: &mut Vec<u32>) {
pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> {
// CHECK-NOT: panic
- // Call to panic_cannot_unwind in case of double-panic is expected,
- // but other panics are not.
+ // Call to panic_cannot_unwind in case of double-panic is expected
+ // on LLVM 16 and older, but other panics are not.
// CHECK: cleanup
- // CHECK-NEXT: ; call core::panicking::panic_cannot_unwind
- // CHECK-NEXT: panic_cannot_unwind
+ // old-NEXT: ; call core::panicking::panic_cannot_unwind
+ // old-NEXT: panic_cannot_unwind
// CHECK-NOT: panic
vec.into_boxed_slice()
@@ -34,14 +39,14 @@ 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,
- // but other panics are not.
+ // on LLVM 16 and older, but other panics are not.
// CHECK: cleanup
- // CHECK-NEXT: ; call core::panicking::panic_cannot_unwind
- // CHECK-NEXT: panic_cannot_unwind
+ // old-NEXT: ; call core::panicking::panic_cannot_unwind
+ // old-NEXT: panic_cannot_unwind
// CHECK-NOT: panic
iter.iter().copied().collect()
}
-// CHECK: ; core::panicking::panic_cannot_unwind
-// CHECK: declare void @{{.*}}panic_cannot_unwind
+// old: ; core::panicking::panic_cannot_unwind
+// old: declare void @{{.*}}panic_cannot_unwind
diff --git a/tests/codegen/virtual-function-elimination.rs b/tests/codegen/virtual-function-elimination.rs
index 4cf7e12fe..f22176a02 100644
--- a/tests/codegen/virtual-function-elimination.rs
+++ b/tests/codegen/virtual-function-elimination.rs
@@ -1,5 +1,6 @@
// compile-flags: -Zvirtual-function-elimination -Clto -O -Csymbol-mangling-version=v0
// ignore-32bit
+// ignore-debug
// CHECK: @vtable.0 = {{.*}}, !type ![[TYPE0:[0-9]+]], !vcall_visibility ![[VCALL_VIS0:[0-9]+]]
// CHECK: @vtable.1 = {{.*}}, !type ![[TYPE1:[0-9]+]], !vcall_visibility ![[VCALL_VIS0:[0-9]+]]
@@ -81,7 +82,7 @@ fn taking_u(u: &dyn U) -> i32 {
}
pub fn taking_v(v: &dyn V) -> i32 {
- // CHECK: @llvm.type.checked.load({{.*}}, i32 24, metadata !"NtCsfRpWlKdQPZn_28virtual_function_elimination1V")
+ // CHECK: @llvm.type.checked.load({{.*}}, i32 24, metadata !"NtCs64ITQYi9761_28virtual_function_elimination1V")
v.public_function()
}
@@ -96,5 +97,5 @@ pub fn main() {
// CHECK: ![[TYPE0]] = !{i64 0, !"[[MANGLED_TYPE0]]"}
// CHECK: ![[VCALL_VIS0]] = !{i64 2}
// CHECK: ![[TYPE1]] = !{i64 0, !"[[MANGLED_TYPE1]]"}
-// CHECK: ![[TYPE2]] = !{i64 0, !"NtCsfRpWlKdQPZn_28virtual_function_elimination1V"}
+// CHECK: ![[TYPE2]] = !{i64 0, !"NtCs64ITQYi9761_28virtual_function_elimination1V"}
// CHECK: ![[VCALL_VIS2]] = !{i64 1}
diff --git a/tests/debuginfo/function-names.rs b/tests/debuginfo/function-names.rs
index 2227de3b3..d9aa03fee 100644
--- a/tests/debuginfo/function-names.rs
+++ b/tests/debuginfo/function-names.rs
@@ -37,7 +37,7 @@
// Const generic parameter
// gdb-command:info functions -q function_names::const_generic_fn.*
// gdb-check:[...]static fn function_names::const_generic_fn_bool<false>();
-// gdb-check:[...]static fn function_names::const_generic_fn_non_int<{CONST#6348c650c7b26618}>();
+// gdb-check:[...]static fn function_names::const_generic_fn_non_int<{CONST#ad91263f6d2dd96e}>();
// gdb-check:[...]static fn function_names::const_generic_fn_signed_int<-7>();
// gdb-check:[...]static fn function_names::const_generic_fn_unsigned_int<14>();
@@ -76,9 +76,9 @@
// Const generic parameter
// cdb-command:x a!function_names::const_generic_fn*
// cdb-check:[...] a!function_names::const_generic_fn_bool<false> (void)
+// cdb-check:[...] a!function_names::const_generic_fn_non_int<CONST$ad91263f6d2dd96e> (void)
// cdb-check:[...] a!function_names::const_generic_fn_unsigned_int<14> (void)
// cdb-check:[...] a!function_names::const_generic_fn_signed_int<-7> (void)
-// cdb-check:[...] a!function_names::const_generic_fn_non_int<CONST$6348c650c7b26618> (void)
#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
diff --git a/tests/debuginfo/type-names.rs b/tests/debuginfo/type-names.rs
index d7b79a845..c5ce044dd 100644
--- a/tests/debuginfo/type-names.rs
+++ b/tests/debuginfo/type-names.rs
@@ -175,7 +175,6 @@
// 0-sized structs appear to be optimized away in some cases, so only check the structs that do
// actually appear.
// cdb-command:dv /t *_struct
-// cdb-check:struct type_names::GenericStruct<enum2$<type_names::mod1::Enum2>,f64> mut_generic_struct = [...]
// ENUMS
// cdb-command:dv /t *_enum_*
diff --git a/tests/incremental/auxiliary/circular-dependencies-aux.rs b/tests/incremental/auxiliary/circular-dependencies-aux.rs
new file mode 100644
index 000000000..0e74eb1b2
--- /dev/null
+++ b/tests/incremental/auxiliary/circular-dependencies-aux.rs
@@ -0,0 +1,10 @@
+// edition: 2021
+// compile-flags: --crate-type lib --extern circular_dependencies={{build-base}}/circular-dependencies/libcircular_dependencies.rmeta --emit dep-info,metadata
+
+use circular_dependencies::Foo;
+
+pub fn consume_foo(_: Foo) {}
+
+pub fn produce_foo() -> Foo {
+ Foo
+}
diff --git a/tests/incremental/circular-dependencies.rs b/tests/incremental/circular-dependencies.rs
new file mode 100644
index 000000000..10673066a
--- /dev/null
+++ b/tests/incremental/circular-dependencies.rs
@@ -0,0 +1,37 @@
+// ignore-tidy-linelength
+// revisions: cpass1 cfail2
+// edition: 2021
+// [cpass1] compile-flags: --crate-type lib --emit dep-info,metadata
+// [cfail2] aux-build: circular-dependencies-aux.rs
+// [cfail2] compile-flags: --test --extern aux={{build-base}}/circular-dependencies/auxiliary/libcircular_dependencies_aux.rmeta -L dependency={{build-base}}/circular-dependencies
+
+pub struct Foo;
+//[cfail2]~^ NOTE `Foo` is defined in the current crate
+//[cfail2]~| NOTE `Foo` is defined in the current crate
+//[cfail2]~| NOTE `circular_dependencies::Foo` is defined in crate `circular_dependencies`
+//[cfail2]~| NOTE `circular_dependencies::Foo` is defined in crate `circular_dependencies`
+
+pub fn consume_foo(_: Foo) {}
+//[cfail2]~^ NOTE function defined here
+
+pub fn produce_foo() -> Foo {
+ Foo
+}
+
+#[test]
+fn test() {
+ aux::consume_foo(produce_foo());
+ //[cfail2]~^ ERROR mismatched types [E0308]
+ //[cfail2]~| NOTE expected `circular_dependencies::Foo`, found `Foo`
+ //[cfail2]~| NOTE arguments to this function are incorrect
+ //[cfail2]~| NOTE `Foo` and `circular_dependencies::Foo` have similar names, but are actually distinct types
+ //[cfail2]~| NOTE the crate `circular_dependencies` is compiled multiple times, possibly with different configurations
+ //[cfail2]~| NOTE function defined here
+
+ consume_foo(aux::produce_foo());
+ //[cfail2]~^ ERROR mismatched types [E0308]
+ //[cfail2]~| NOTE expected `Foo`, found `circular_dependencies::Foo`
+ //[cfail2]~| NOTE arguments to this function are incorrect
+ //[cfail2]~| NOTE `circular_dependencies::Foo` and `Foo` have similar names, but are actually distinct types
+ //[cfail2]~| NOTE the crate `circular_dependencies` is compiled multiple times, possibly with different configurations
+}
diff --git a/tests/incremental/hashes/let_expressions.rs b/tests/incremental/hashes/let_expressions.rs
index 180bf6fec..7aca43242 100644
--- a/tests/incremental/hashes/let_expressions.rs
+++ b/tests/incremental/hashes/let_expressions.rs
@@ -193,9 +193,9 @@ pub fn add_initializer() {
}
#[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck,optimized_mir")]
+#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck")]
#[rustc_clean(cfg="cfail3")]
-#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,typeck,optimized_mir")]
+#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,typeck")]
#[rustc_clean(cfg="cfail6")]
pub fn add_initializer() {
let _x: i16 = 3i16;
diff --git a/tests/incremental/issue-108481-feed-eval-always.rs b/tests/incremental/issue-108481-feed-eval-always.rs
new file mode 100644
index 000000000..8f346a720
--- /dev/null
+++ b/tests/incremental/issue-108481-feed-eval-always.rs
@@ -0,0 +1,16 @@
+// revisions: cpass1 cpass2
+
+#![crate_type = "rlib"]
+
+use std::fmt::Debug;
+
+// MCVE kindly provided by Nilstrieb at
+// https://github.com/rust-lang/rust/issues/108481#issuecomment-1493080185
+
+#[derive(Debug)]
+pub struct ConstGeneric<const CHUNK_SIZE: usize> {
+ _p: [(); CHUNK_SIZE],
+}
+
+#[cfg(cpass1)]
+impl<const CHUNK_SIZE: usize> ConstGeneric<CHUNK_SIZE> {}
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 5f8b2f931..b1d34a196 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
@@ -1,36 +1,36 @@
// MIR for `address_of_reborrow` after SimplifyCfg-initial
| User Type Annotations
-| 0: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:7:5: 7:18, inferred_ty: *const [i32; 10]
-| 1: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:9:5: 9:25, inferred_ty: *const dyn std::marker::Send
-| 2: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:13:12: 13:20, inferred_ty: *const [i32; 10]
-| 3: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:13:12: 13:20, inferred_ty: *const [i32; 10]
-| 4: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32; 10]) }, span: $DIR/address_of.rs:14:12: 14:28, inferred_ty: *const [i32; 10]
-| 5: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32; 10]) }, span: $DIR/address_of.rs:14:12: 14:28, inferred_ty: *const [i32; 10]
-| 6: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:15:12: 15:27, inferred_ty: *const dyn std::marker::Send
-| 7: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:15:12: 15:27, inferred_ty: *const dyn std::marker::Send
-| 8: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32]) }, span: $DIR/address_of.rs:16:12: 16:24, inferred_ty: *const [i32]
-| 9: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32]) }, span: $DIR/address_of.rs:16:12: 16:24, inferred_ty: *const [i32]
-| 10: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:18:5: 18:18, inferred_ty: *const [i32; 10]
-| 11: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:20:5: 20:25, inferred_ty: *const dyn std::marker::Send
-| 12: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:23:12: 23:20, inferred_ty: *const [i32; 10]
-| 13: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*const ^0) }, span: $DIR/address_of.rs:23:12: 23:20, inferred_ty: *const [i32; 10]
-| 14: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32; 10]) }, span: $DIR/address_of.rs:24:12: 24:28, inferred_ty: *const [i32; 10]
-| 15: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32; 10]) }, span: $DIR/address_of.rs:24:12: 24:28, inferred_ty: *const [i32; 10]
-| 16: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:25:12: 25:27, inferred_ty: *const dyn std::marker::Send
-| 17: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*const dyn std::marker::Send) }, span: $DIR/address_of.rs:25:12: 25:27, inferred_ty: *const dyn std::marker::Send
-| 18: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32]) }, span: $DIR/address_of.rs:26:12: 26:24, inferred_ty: *const [i32]
-| 19: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*const [i32]) }, span: $DIR/address_of.rs:26:12: 26:24, inferred_ty: *const [i32]
-| 20: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*mut ^0) }, span: $DIR/address_of.rs:28:5: 28:16, inferred_ty: *mut [i32; 10]
-| 21: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*mut dyn std::marker::Send) }, span: $DIR/address_of.rs:30:5: 30:23, inferred_ty: *mut dyn std::marker::Send
-| 22: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*mut ^0) }, span: $DIR/address_of.rs:33:12: 33:18, inferred_ty: *mut [i32; 10]
-| 23: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }], value: Ty(*mut ^0) }, span: $DIR/address_of.rs:33:12: 33:18, inferred_ty: *mut [i32; 10]
-| 24: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut [i32; 10]) }, span: $DIR/address_of.rs:34:12: 34:26, inferred_ty: *mut [i32; 10]
-| 25: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut [i32; 10]) }, span: $DIR/address_of.rs:34:12: 34:26, inferred_ty: *mut [i32; 10]
-| 26: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*mut dyn std::marker::Send) }, span: $DIR/address_of.rs:35:12: 35:25, inferred_ty: *mut dyn std::marker::Send
-| 27: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }], value: Ty(*mut dyn std::marker::Send) }, span: $DIR/address_of.rs:35:12: 35:25, inferred_ty: *mut dyn std::marker::Send
-| 28: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut [i32]) }, span: $DIR/address_of.rs:36:12: 36:22, inferred_ty: *mut [i32]
-| 29: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut [i32]) }, span: $DIR/address_of.rs:36:12: 36:22, inferred_ty: *mut [i32]
+| 0: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:7:5: 7:18, inferred_ty: *const [i32; 10]
+| 1: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:9:5: 9:25, inferred_ty: *const dyn std::marker::Send
+| 2: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:13:12: 13:20, inferred_ty: *const [i32; 10]
+| 3: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:13:12: 13:20, inferred_ty: *const [i32; 10]
+| 4: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:14:12: 14:28, inferred_ty: *const [i32; 10]
+| 5: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:14:12: 14:28, inferred_ty: *const [i32; 10]
+| 6: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:15:12: 15:27, inferred_ty: *const dyn std::marker::Send
+| 7: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:15:12: 15:27, inferred_ty: *const dyn std::marker::Send
+| 8: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:16:12: 16:24, inferred_ty: *const [i32]
+| 9: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:16:12: 16:24, inferred_ty: *const [i32]
+| 10: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:18:5: 18:18, inferred_ty: *const [i32; 10]
+| 11: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:20:5: 20:25, inferred_ty: *const dyn std::marker::Send
+| 12: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:23:12: 23:20, inferred_ty: *const [i32; 10]
+| 13: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:23:12: 23:20, inferred_ty: *const [i32; 10]
+| 14: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:24:12: 24:28, inferred_ty: *const [i32; 10]
+| 15: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:24:12: 24:28, inferred_ty: *const [i32; 10]
+| 16: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:25:12: 25:27, inferred_ty: *const dyn std::marker::Send
+| 17: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:25:12: 25:27, inferred_ty: *const dyn std::marker::Send
+| 18: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:26:12: 26:24, inferred_ty: *const [i32]
+| 19: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:26:12: 26:24, inferred_ty: *const [i32]
+| 20: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:28:5: 28:16, inferred_ty: *mut [i32; 10]
+| 21: user_ty: Canonical { value: Ty(*mut dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:30:5: 30:23, inferred_ty: *mut dyn std::marker::Send
+| 22: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:33:12: 33:18, inferred_ty: *mut [i32; 10]
+| 23: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(General(U0)) }] }, span: $DIR/address_of.rs:33:12: 33:18, inferred_ty: *mut [i32; 10]
+| 24: user_ty: Canonical { value: Ty(*mut [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:34:12: 34:26, inferred_ty: *mut [i32; 10]
+| 25: user_ty: Canonical { value: Ty(*mut [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:34:12: 34:26, inferred_ty: *mut [i32; 10]
+| 26: user_ty: Canonical { value: Ty(*mut dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:35:12: 35:25, inferred_ty: *mut dyn std::marker::Send
+| 27: user_ty: Canonical { value: Ty(*mut dyn std::marker::Send), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/address_of.rs:35:12: 35:25, inferred_ty: *mut dyn std::marker::Send
+| 28: user_ty: Canonical { value: Ty(*mut [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:36:12: 36:22, inferred_ty: *mut [i32]
+| 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
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
index af5178d40..4be382fac 100644
--- 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
@@ -38,7 +38,7 @@ fn main() -> () {
_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:16:21: 16:24
+ // + span: $DIR/array_index_is_temporary.rs:17:21: 17:24
// + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/array_index_is_temporary.rs b/tests/mir-opt/array_index_is_temporary.rs
index e7bde81d4..702b9c70e 100644
--- a/tests/mir-opt/array_index_is_temporary.rs
+++ b/tests/mir-opt/array_index_is_temporary.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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 2487ef5c2..f6954ab35 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
@@ -9,7 +9,7 @@ fn main() -> () {
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: bb2]; // 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
}
bb1: {
@@ -17,8 +17,4 @@ fn main() -> () {
_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
}
-
- bb2 (cleanup): {
- abort; // scope 0 at $DIR/asm_unwind_panic_abort.rs:+0:1: +4:2
- }
}
diff --git a/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff b/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff
new file mode 100644
index 000000000..d663c3435
--- /dev/null
+++ b/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff
@@ -0,0 +1,89 @@
+- // MIR for `main` before ElaborateDrops
++ // 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
+ 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
+ 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
+ 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
+ scope 4 {
+ debug drop_y => _5; // in scope 4 at $DIR/basic_assignment.rs:+9:9: +9:15
+ }
+ }
+ }
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ bb6 (cleanup): {
+ drop(_5) -> [return: bb7, unwind terminate]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
+ }
+
+ 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
+ }
+
+ bb8 (cleanup): {
+ resume; // scope 0 at $DIR/basic_assignment.rs:+0:1: +14:2
++ }
++
++ bb9 (cleanup): {
++ unreachable; // scope 0 at $DIR/basic_assignment.rs:+0:1: +14:2
+ }
+ }
+
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 1f099cd5e..d63497e3a 100644
--- a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir
@@ -1,8 +1,8 @@
// MIR for `main` after SimplifyCfg-initial
| User Type Annotations
-| 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option<std::boxed::Box<u32>>) }, span: $DIR/basic_assignment.rs:18:17: 18:33, inferred_ty: std::option::Option<std::boxed::Box<u32>>
-| 1: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option<std::boxed::Box<u32>>) }, span: $DIR/basic_assignment.rs:18:17: 18:33, inferred_ty: std::option::Option<std::boxed::Box<u32>>
+| 0: 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>>
+| 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
@@ -41,41 +41,43 @@ fn main() -> () {
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
- replace(_5 <- move _6) -> [return: bb1, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
+ drop(_5) -> [return: bb1, unwind: bb2]; // scope 4 at $DIR/basic_assignment.rs:+13:5: +13:11
}
bb1: {
- drop(_6) -> [return: bb2, unwind: bb6]; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
+ _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
}
- bb2: {
+ 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
+ }
+
+ 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: bb3, unwind: bb7]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
+ drop(_5) -> [return: bb4, unwind: bb7]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
}
- bb3: {
+ bb4: {
StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
- drop(_4) -> [return: bb4, unwind: bb8]; // scope 2 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
}
- bb4: {
+ 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
}
- bb5 (cleanup): {
- drop(_6) -> bb6; // scope 4 at $DIR/basic_assignment.rs:+13:19: +13:20
- }
-
bb6 (cleanup): {
- drop(_5) -> bb7; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
+ drop(_5) -> [return: bb7, unwind terminate]; // scope 3 at $DIR/basic_assignment.rs:+14:1: +14:2
}
bb7 (cleanup): {
- drop(_4) -> bb8; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
+ drop(_4) -> [return: bb8, unwind terminate]; // scope 2 at $DIR/basic_assignment.rs:+14:1: +14:2
}
bb8 (cleanup): {
diff --git a/tests/mir-opt/basic_assignment.rs b/tests/mir-opt/basic_assignment.rs
index ac350271e..92434e44a 100644
--- a/tests/mir-opt/basic_assignment.rs
+++ b/tests/mir-opt/basic_assignment.rs
@@ -1,5 +1,7 @@
+// needs-unwind
// this tests move up progration, which is not yet implemented
+// EMIT_MIR basic_assignment.main.ElaborateDrops.diff
// EMIT_MIR basic_assignment.main.SimplifyCfg-initial.after.mir
// Check codegen for assignments (`a = b`) where the left-hand-side is
diff --git a/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir b/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir
index 49133138d..bac5b21df 100644
--- a/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir
+++ b/tests/mir-opt/box_expr.main.ElaborateDrops.before.mir
@@ -3,12 +3,12 @@
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:+1:13: +1:25
- let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:+1:13: +1:25
- let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:+1:13: +1:25
- let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+1:13: +1:25
- let _6: (); // in scope 0 at $DIR/box_expr.rs:+2:5: +2:12
- let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+2:10: +2:11
+ 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
}
@@ -17,64 +17,64 @@ fn main() -> () {
bb0: {
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:+1:9: +1:10
- _2 = SizeOf(S); // scope 2 at $DIR/box_expr.rs:+1:13: +1:25
- _3 = AlignOf(S); // scope 2 at $DIR/box_expr.rs:+1:13: +1:25
- _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:+1:13: +1:25
+ _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:7:13: 7:25
+ // + 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:+1:13: +1:25
- _5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:+1:13: +1:25
- (*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:+1:17: +1:25
+ 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:7:17: 7:23
+ // + 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:+1:13: +1:25
- drop(_5) -> bb3; // scope 0 at $DIR/box_expr.rs:+1:24: +1:25
+ _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:+1:24: +1:25
- StorageLive(_6); // scope 1 at $DIR/box_expr.rs:+2:5: +2:12
- StorageLive(_7); // scope 1 at $DIR/box_expr.rs:+2:10: +2:11
- _7 = move _1; // scope 1 at $DIR/box_expr.rs:+2:10: +2:11
- _6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:+2:5: +2:12
+ 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:8:5: 8:9
+ // + 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:+2:11: +2:12
- StorageDead(_6); // scope 1 at $DIR/box_expr.rs:+2:12: +2:13
- _0 = const (); // scope 0 at $DIR/box_expr.rs:+0:11: +3:2
- drop(_1) -> bb5; // scope 0 at $DIR/box_expr.rs:+3:1: +3:2
+ 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:+3:1: +3:2
- return; // scope 0 at $DIR/box_expr.rs:+3:2: +3:2
+ 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) -> bb7; // scope 1 at $DIR/box_expr.rs:+2:11: +2:12
+ drop(_7) -> [return: bb7, unwind terminate]; // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
}
bb7 (cleanup): {
- drop(_1) -> bb9; // scope 0 at $DIR/box_expr.rs:+3:1: +3:2
+ drop(_1) -> [return: bb9, unwind terminate]; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
}
bb8 (cleanup): {
- drop(_5) -> bb9; // scope 0 at $DIR/box_expr.rs:+1:24: +1:25
+ 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: +3:2
+ resume; // scope 0 at $DIR/box_expr.rs:+0:1: +4:2
}
}
diff --git a/tests/mir-opt/box_expr.rs b/tests/mir-opt/box_expr.rs
index a214504f6..ad3670b5d 100644
--- a/tests/mir-opt/box_expr.rs
+++ b/tests/mir-opt/box_expr.rs
@@ -1,17 +1,20 @@
// ignore-wasm32-bare compiled with panic=abort by default
-#![feature(box_syntax)]
+#![feature(rustc_attrs, stmt_expr_attributes)]
// EMIT_MIR box_expr.main.ElaborateDrops.before.mir
fn main() {
- let x = box S::new();
+ let x = #[rustc_box]
+ Box::new(S::new());
drop(x);
}
struct S;
impl S {
- fn new() -> Self { S }
+ fn new() -> Self {
+ S
+ }
}
impl Drop for S {
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 ad4e5c6fc..7cce3415f 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
@@ -4,7 +4,7 @@
_0: GeneratorSavedTy {
ty: impl std::future::Future<Output = ()>,
source_info: SourceInfo {
- span: $DIR/async_await.rs:15:8: 15:14 (#9),
+ span: $DIR/async_await.rs:15:8: 15:14 (#8),
scope: scope[0],
},
ignore_for_traits: false,
@@ -12,7 +12,7 @@
_1: GeneratorSavedTy {
ty: impl std::future::Future<Output = ()>,
source_info: SourceInfo {
- span: $DIR/async_await.rs:16:8: 16:14 (#12),
+ span: $DIR/async_await.rs:16:8: 16:14 (#11),
scope: scope[0],
},
ignore_for_traits: false,
@@ -90,7 +90,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
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: bb29, 3: bb27, 4: bb28, otherwise: bb30]; // 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
}
bb1: {
@@ -98,14 +98,14 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
StorageLive(_3); // scope 0 at $DIR/async_await.rs:+1:5: +1:14
StorageLive(_4); // scope 0 at $DIR/async_await.rs:+1:8: +1:14
StorageLive(_5); // scope 0 at $DIR/async_await.rs:+1:5: +1:8
- _5 = a() -> bb2; // 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>) }
}
bb2: {
- _4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> bb3; // scope 0 at $DIR/async_await.rs:+1:8: +1:14
+ _4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+1:8: +1:14
// mir::Constant
// + span: $DIR/async_await.rs:15:8: 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>) }
@@ -126,7 +126,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
StorageLive(_12); // scope 2 at $DIR/async_await.rs:+1:8: +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:8: +1:14
_11 = &mut (*_12); // scope 2 at $DIR/async_await.rs:+1:8: +1:14
- _10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> bb5; // scope 2 at $DIR/async_await.rs:+1:8: +1:14
+ _10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> [return: bb5, unwind unreachable]; // scope 2 at $DIR/async_await.rs:+1:8: +1:14
// mir::Constant
// + span: $DIR/async_await.rs:15:8: 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>) }
@@ -145,7 +145,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
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) -> bb7; // scope 2 at $DIR/async_await.rs:+1:8: +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:8: +1:14
// mir::Constant
// + span: $DIR/async_await.rs:15:8: 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>) }
@@ -206,14 +206,14 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
StorageDead(_3); // scope 0 at $DIR/async_await.rs:+1:14: +1:15
StorageLive(_21); // scope 0 at $DIR/async_await.rs:+2:8: +2:14
StorageLive(_22); // scope 0 at $DIR/async_await.rs:+2:5: +2:8
- _22 = a() -> bb14; // 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>) }
}
bb14: {
- _21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> bb15; // scope 0 at $DIR/async_await.rs:+2:8: +2:14
+ _21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> [return: bb15, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+2:8: +2:14
// mir::Constant
// + span: $DIR/async_await.rs:16:8: 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>) }
@@ -234,7 +234,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
StorageLive(_28); // scope 5 at $DIR/async_await.rs:+2:8: +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:8: +2:14
_27 = &mut (*_28); // scope 5 at $DIR/async_await.rs:+2:8: +2:14
- _26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> bb17; // scope 5 at $DIR/async_await.rs:+2:8: +2:14
+ _26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> [return: bb17, unwind unreachable]; // scope 5 at $DIR/async_await.rs:+2:8: +2:14
// mir::Constant
// + span: $DIR/async_await.rs:16:8: 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>) }
@@ -253,7 +253,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
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) -> bb19; // scope 5 at $DIR/async_await.rs:+2:8: +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:8: +2:14
// mir::Constant
// + span: $DIR/async_await.rs:16:8: 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>) }
@@ -263,7 +263,7 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
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:8: +2:14
- switchInt(move _32) -> [0: bb22, 1: bb20, otherwise: bb21]; // scope 4 at $DIR/async_await.rs:+2:8: +2:14
+ switchInt(move _32) -> [0: bb21, 1: bb20, otherwise: bb9]; // scope 4 at $DIR/async_await.rs:+2:8: +2:14
}
bb20: {
@@ -281,10 +281,6 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
}
bb21: {
- unreachable; // scope 4 at $DIR/async_await.rs:+2:8: +2:14
- }
-
- bb22: {
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
@@ -293,10 +289,10 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
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 -> bb24; // scope 0 at $DIR/async_await.rs:+2:13: +2:14
+ goto -> bb23; // scope 0 at $DIR/async_await.rs:+2:13: +2:14
}
- 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:8: +2:14
StorageDead(_35); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
@@ -304,23 +300,23 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
goto -> bb16; // scope 4 at $DIR/async_await.rs:+2:8: +2:14
}
- bb24: {
+ bb23: {
nop; // scope 0 at $DIR/async_await.rs:+2:13: +2:14
- goto -> bb25; // scope 0 at $DIR/async_await.rs:+3:1: +3:2
+ goto -> bb24; // scope 0 at $DIR/async_await.rs:+3:1: +3:2
}
- bb25: {
+ bb24: {
StorageDead(_21); // scope 0 at $DIR/async_await.rs:+3:1: +3:2
- goto -> bb26; // scope 0 at $DIR/async_await.rs:+3:1: +3:2
+ goto -> bb25; // scope 0 at $DIR/async_await.rs:+3:1: +3:2
}
- bb26: {
+ 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
}
- bb27: {
+ 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
@@ -329,19 +325,19 @@ fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>,
goto -> bb11; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
}
- bb28: {
+ 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 -> bb23; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ goto -> bb22; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
}
- bb29: {
- assert(const false, "`async fn` resumed after completion") -> bb29; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ bb28: {
+ assert(const false, "`async fn` resumed after completion") -> bb28; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
}
- bb30: {
+ bb29: {
unreachable; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
}
}
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
new file mode 100644
index 000000000..49e8c812c
--- /dev/null
+++ b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+}
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
new file mode 100644
index 000000000..30d128973
--- /dev/null
+++ b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+}
diff --git a/tests/mir-opt/building/custom/aggregate_exprs.rs b/tests/mir-opt/building/custom/aggregate_exprs.rs
new file mode 100644
index 000000000..554c9c03b
--- /dev/null
+++ b/tests/mir-opt/building/custom/aggregate_exprs.rs
@@ -0,0 +1,71 @@
+#![feature(custom_mir, core_intrinsics)]
+
+extern crate core;
+use core::intrinsics::mir::*;
+
+// EMIT_MIR aggregate_exprs.tuple.built.after.mir
+#[custom_mir(dialect = "built")]
+fn tuple() -> (i32, bool) {
+ mir!(
+ {
+ RET = (1, true);
+ Return()
+ }
+ )
+}
+
+// EMIT_MIR aggregate_exprs.array.built.after.mir
+#[custom_mir(dialect = "built")]
+fn array() -> [i32; 2] {
+ mir!(
+ let x: [i32; 2];
+ let one: i32;
+ {
+ x = [42, 43];
+ one = 1;
+ x = [one, 2];
+ RET = Move(x);
+ Return()
+ }
+ )
+}
+
+struct Foo {
+ a: i32,
+ b: i32,
+}
+
+enum Bar {
+ Foo(Foo, i32),
+}
+
+union Onion {
+ neon: i32,
+ noun: f32,
+}
+
+// EMIT_MIR aggregate_exprs.adt.built.after.mir
+#[custom_mir(dialect = "built")]
+fn adt() -> Onion {
+ mir!(
+ let one: i32;
+ let x: Foo;
+ let y: Bar;
+ {
+ one = 1;
+ x = Foo {
+ a: 1,
+ b: 2,
+ };
+ y = Bar::Foo(Move(x), one);
+ RET = Onion { neon: Field(Variant(y, 0), 1) };
+ Return()
+ }
+ )
+}
+
+fn main() {
+ assert_eq!(tuple(), (1, true));
+ assert_eq!(array(), [1, 2]);
+ assert_eq!(unsafe { adt().neon }, 1);
+}
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
new file mode 100644
index 000000000..5fe45ccc9
--- /dev/null
+++ b/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+}
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
new file mode 100644
index 000000000..d0b770783
--- /dev/null
+++ b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+}
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
new file mode 100644
index 000000000..aaebff0d7
--- /dev/null
+++ b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+}
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
new file mode 100644
index 000000000..f040cf53d
--- /dev/null
+++ b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+}
diff --git a/tests/mir-opt/building/custom/as_cast.rs b/tests/mir-opt/building/custom/as_cast.rs
new file mode 100644
index 000000000..b4b5ac6aa
--- /dev/null
+++ b/tests/mir-opt/building/custom/as_cast.rs
@@ -0,0 +1,43 @@
+#![feature(custom_mir, core_intrinsics)]
+
+extern crate core;
+use core::intrinsics::mir::*;
+
+// EMIT_MIR as_cast.int_to_int.built.after.mir
+#[custom_mir(dialect = "built")]
+fn int_to_int(x: u32) -> i32 {
+ mir!(
+ {
+ RET = x as i32;
+ Return()
+ }
+ )
+}
+
+// EMIT_MIR as_cast.float_to_int.built.after.mir
+#[custom_mir(dialect = "built")]
+fn float_to_int(x: f32) -> i32 {
+ mir!(
+ {
+ RET = x as i32;
+ Return()
+ }
+ )
+}
+
+// EMIT_MIR as_cast.int_to_ptr.built.after.mir
+#[custom_mir(dialect = "built")]
+fn int_to_ptr(x: usize) -> *const i32 {
+ mir!(
+ {
+ RET = x as *const i32;
+ Return()
+ }
+ )
+}
+
+fn main() {
+ assert_eq!(int_to_int(5), 5);
+ assert_eq!(float_to_int(5.), 5);
+ assert_eq!(int_to_ptr(0), std::ptr::null());
+}
diff --git a/tests/mir-opt/building/custom/composite_return.rs b/tests/mir-opt/building/custom/composite_return.rs
new file mode 100644
index 000000000..701d6b1ab
--- /dev/null
+++ b/tests/mir-opt/building/custom/composite_return.rs
@@ -0,0 +1,21 @@
+#![feature(custom_mir, core_intrinsics)]
+
+extern crate core;
+use core::intrinsics::mir::*;
+
+// EMIT_MIR composite_return.tuple.built.after.mir
+#[custom_mir(dialect = "runtime", phase = "optimized")]
+fn tuple() -> (i32, bool) {
+ mir!(
+ type RET = (i32, bool);
+ {
+ RET.0 = 1;
+ RET.1 = true;
+ Return()
+ }
+ )
+}
+
+fn main() {
+ assert_eq!(tuple(), (1, true));
+}
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
new file mode 100644
index 000000000..d159c1a65
--- /dev/null
+++ b/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+}
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
new file mode 100644
index 000000000..f614aef40
--- /dev/null
+++ b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+}
diff --git a/tests/mir-opt/building/custom/references.rs b/tests/mir-opt/building/custom/references.rs
index a1c896de0..f87f6664c 100644
--- a/tests/mir-opt/building/custom/references.rs
+++ b/tests/mir-opt/building/custom/references.rs
@@ -45,11 +45,22 @@ pub fn raw_pointer(x: *const i32) -> *const i32 {
})
}
+// EMIT_MIR references.raw_pointer_offset.built.after.mir
+#[custom_mir(dialect = "built")]
+pub fn raw_pointer_offset(x: *const i32) -> *const i32 {
+ mir!({
+ RET = Offset(x, 1_isize);
+ Return()
+ })
+}
+
fn main() {
let mut x = 5;
+ let arr = [1, 2];
assert_eq!(*mut_ref(&mut x), 5);
assert_eq!(*immut_ref(&x), 5);
unsafe {
assert_eq!(*raw_pointer(addr_of!(x)), 5);
+ assert_eq!(*raw_pointer_offset(addr_of!(arr[0])), 2);
}
}
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 c903e5946..ada78c0fc 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
@@ -4,10 +4,11 @@ fn drop_first(_1: WriteOnDrop<'_>, _2: WriteOnDrop<'_>) -> () {
let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:59: +0:59
bb0: {
- replace(_1 <- move _2) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:49
+ drop(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:30
}
bb1: {
- return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21
+ _1 = move _2; // scope 0 at $DIR/terminators.rs:+7:13: +7:24
+ return; // scope 0 at $DIR/terminators.rs:+8:13: +8:21
}
}
diff --git a/tests/mir-opt/building/custom/terminators.rs b/tests/mir-opt/building/custom/terminators.rs
index c23233fcf..f12405661 100644
--- a/tests/mir-opt/building/custom/terminators.rs
+++ b/tests/mir-opt/building/custom/terminators.rs
@@ -48,10 +48,11 @@ impl<'a> Drop for WriteOnDrop<'a> {
fn drop_first<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) {
mir!(
{
- DropAndReplace(a, Move(b), retblock)
+ Drop(a, retblock)
}
retblock = {
+ a = Move(b);
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 5231c2eab..1112177fb 100644
--- a/tests/mir-opt/building/enum_cast.droppy.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.droppy.built.after.mir
@@ -63,7 +63,7 @@ fn droppy() -> () {
}
bb4 (cleanup): {
- drop(_2) -> bb5; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
+ drop(_2) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
}
bb5 (cleanup): {
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 628a33f10..44c25ce67 100644
--- a/tests/mir-opt/building/issue_101867.main.built.after.mir
+++ b/tests/mir-opt/building/issue_101867.main.built.after.mir
@@ -1,8 +1,8 @@
// MIR for `main` after built
| User Type Annotations
-| 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option<u8>) }, span: $DIR/issue_101867.rs:3:12: 3:22, inferred_ty: std::option::Option<u8>
-| 1: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option<u8>) }, span: $DIR/issue_101867.rs:3:12: 3:22, inferred_ty: std::option::Option<u8>
+| 0: 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>
+| 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
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 de5e4c0f6..cc135f417 100644
--- a/tests/mir-opt/building/issue_49232.main.built.after.mir
+++ b/tests/mir-opt/building/issue_49232.main.built.after.mir
@@ -17,7 +17,7 @@ fn main() -> () {
}
bb1: {
- falseUnwind -> [real: bb2, cleanup: bb11]; // scope 0 at $DIR/issue_49232.rs:+1:5: +9:6
+ falseUnwind -> [real: bb2, unwind: bb11]; // scope 0 at $DIR/issue_49232.rs:+1:5: +9:6
}
bb2: {
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 cb36bc64d..0e6de839d 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
@@ -100,6 +100,7 @@ fn full_tested_match() -> () {
}
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
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 7f8755faa..37e6b1cd4 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
@@ -100,6 +100,7 @@ fn full_tested_match2() -> () {
}
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
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 e8b93f437..7b8983138 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
@@ -162,6 +162,7 @@ fn main() -> () {
}
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
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 41eb00363..7a6944dee 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
@@ -1,10 +1,10 @@
// MIR for `main` after built
| User Type Annotations
-| 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut Test) }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test
-| 1: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut Test) }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test
-| 2: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }], value: Ty(&&&&*mut Test) }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test
-| 3: user_ty: Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }], value: Ty(&&&&*mut Test) }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test
+| 0: user_ty: Canonical { value: Ty(*mut Test), max_universe: U0, variables: [] }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test
+| 1: user_ty: Canonical { value: Ty(*mut Test), max_universe: U0, variables: [] }, span: $DIR/receiver_ptr_mutability.rs:14:14: 14:23, inferred_ty: *mut Test
+| 2: 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
+| 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
diff --git a/tests/mir-opt/building/shifts.rs b/tests/mir-opt/building/shifts.rs
new file mode 100644
index 000000000..4b63a00a3
--- /dev/null
+++ b/tests/mir-opt/building/shifts.rs
@@ -0,0 +1,20 @@
+// compile-flags: -C debug-assertions=yes
+
+// EMIT_MIR shifts.shift_signed.built.after.mir
+fn shift_signed(small: i8, big: u128, a: i8, b: i32, c: i128) -> ([i8; 3], [u128; 3]) {
+ (
+ [small >> a, small >> b, small >> c],
+ [big << a, big << b, big << c],
+ )
+}
+
+// EMIT_MIR shifts.shift_unsigned.built.after.mir
+fn shift_unsigned(small: u8, big: i128, a: u8, b: u32, c: u128) -> ([u8; 3], [i128; 3]) {
+ (
+ [small >> a, small >> b, small >> c],
+ [big << a, big << b, big << c],
+ )
+}
+
+fn main() {
+}
diff --git a/tests/mir-opt/building/shifts.shift_signed.built.after.mir b/tests/mir-opt/building/shifts.shift_signed.built.after.mir
new file mode 100644
index 000000000..028777cef
--- /dev/null
+++ b/tests/mir-opt/building/shifts.shift_signed.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ bb7 (cleanup): {
+ resume; // scope 0 at $DIR/shifts.rs:+0:1: +5:2
+ }
+}
diff --git a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir
new file mode 100644
index 000000000..04da2d20d
--- /dev/null
+++ b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir
@@ -0,0 +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
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ bb7 (cleanup): {
+ resume; // scope 0 at $DIR/shifts.rs:+0:1: +5:2
+ }
+}
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 234cd0839..54f0ea2d8 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
@@ -3,21 +3,21 @@
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:+1:14: +1:19
- let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
+ 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
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:+2:10: +2:12
+ let _12: [std::boxed::Box<i32>; 2]; // in scope 1 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
scope 4 {
- debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+2:10: +2:12
+ debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
}
}
scope 2 {
@@ -27,85 +27,86 @@ 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:+1:14: +1:19
- _3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- _4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
+ 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:11:14: 11:19
+ // + 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>) }
}
bb1: {
- StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- _6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- (*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+1:18: +1:19
- _2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:18: +1:19
+ 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
}
bb2: {
- StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+1:18: +1:19
- StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- _8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- _9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
+ 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:11:21: 11:26
+ // + 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>) }
}
bb3: {
- StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- _11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- (*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+1:25: +1:26
- _7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:25: +1:26
+ 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
}
bb4: {
- StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+1:25: +1:26
- _1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:13: +1:27
- drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ 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
}
bb5: {
- StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
- drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ 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
}
bb6: {
- StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ 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
- StorageLive(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+2:10: +2:12
- _12 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:+2:10: +2:12
- _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:+0:27: +3:2
- drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
+ 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
}
bb7: {
- StorageDead(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
- drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
+ 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
}
bb8: {
- StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
- return; // scope 0 at $DIR/uniform_array_move_out.rs:+3:2: +3:2
+ 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
}
bb9 (cleanup): {
- drop(_1) -> bb12; // scope 0 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
+ drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
}
bb10 (cleanup): {
- drop(_7) -> bb11; // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ drop(_7) -> [return: bb11, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
}
bb11 (cleanup): {
- drop(_2) -> bb12; // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ drop(_2) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +3:2
+ resume; // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +8:2
}
}
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 24a189498..5090a4ba6 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
@@ -3,21 +3,21 @@
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:+1:14: +1:19
- let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
+ 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
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:+2:14: +2:16
+ let _12: std::boxed::Box<i32>; // in scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
scope 4 {
- debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+2:14: +2:16
+ debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
}
}
scope 2 {
@@ -27,85 +27,86 @@ 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:+1:14: +1:19
- _3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- _4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
+ 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:5:14: 5:19
+ // + 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>) }
}
bb1: {
- StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- _6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- (*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+1:18: +1:19
- _2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:+1:14: +1:19
- drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:18: +1:19
+ 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
}
bb2: {
- StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+1:18: +1:19
- StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- _8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- _9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
+ 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:5:21: 5:26
+ // + 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>) }
}
bb3: {
- StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- _11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- (*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+1:25: +1:26
- _7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
- drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:25: +1:26
+ 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
}
bb4: {
- StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+1:25: +1:26
- _1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:13: +1:27
- drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ 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
}
bb5: {
- StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
- drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ 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
}
bb6: {
- StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ 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
- StorageLive(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+2:14: +2:16
- _12 = move _1[1 of 2]; // scope 1 at $DIR/uniform_array_move_out.rs:+2:14: +2:16
- _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:+0:24: +3:2
- drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
+ 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
}
bb7: {
- StorageDead(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
- drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
+ 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
}
bb8: {
- StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
- return; // scope 0 at $DIR/uniform_array_move_out.rs:+3:2: +3:2
+ 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
}
bb9 (cleanup): {
- drop(_1) -> bb12; // scope 0 at $DIR/uniform_array_move_out.rs:+3:1: +3:2
+ drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
}
bb10 (cleanup): {
- drop(_7) -> bb11; // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ drop(_7) -> [return: bb11, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
}
bb11 (cleanup): {
- drop(_2) -> bb12; // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
+ drop(_2) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +3:2
+ resume; // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +8:2
}
}
diff --git a/tests/mir-opt/building/uniform_array_move_out.rs b/tests/mir-opt/building/uniform_array_move_out.rs
index e925036ec..4ba107c87 100644
--- a/tests/mir-opt/building/uniform_array_move_out.rs
+++ b/tests/mir-opt/building/uniform_array_move_out.rs
@@ -1,14 +1,24 @@
-#![feature(box_syntax)]
+#![feature(stmt_expr_attributes, rustc_attrs)]
// EMIT_MIR uniform_array_move_out.move_out_from_end.built.after.mir
fn move_out_from_end() {
- let a = [box 1, box 2];
+ let a = [
+ #[rustc_box]
+ Box::new(1),
+ #[rustc_box]
+ Box::new(2),
+ ];
let [.., _y] = a;
}
// EMIT_MIR uniform_array_move_out.move_out_by_subslice.built.after.mir
fn move_out_by_subslice() {
- let a = [box 1, box 2];
+ let a = [
+ #[rustc_box]
+ Box::new(1),
+ #[rustc_box]
+ Box::new(2),
+ ];
let [_y @ ..] = a;
}
diff --git a/tests/mir-opt/combine_array_len.rs b/tests/mir-opt/combine_array_len.rs
index 3ef3bd09a..08c5f1a1f 100644
--- a/tests/mir-opt/combine_array_len.rs
+++ b/tests/mir-opt/combine_array_len.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: InstCombine
// EMIT_MIR combine_array_len.norm2.InstCombine.diff
diff --git a/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff
index 20b0fb964..b715a544f 100644
--- a/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff
+++ b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff
@@ -72,7 +72,7 @@
}
bb4 (cleanup): {
- drop(_2) -> bb5; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
+ drop(_2) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:14: +0:15
}
bb5 (cleanup): {
diff --git a/tests/mir-opt/combine_transmutes.adt_transmutes.InstCombine.diff b/tests/mir-opt/combine_transmutes.adt_transmutes.InstCombine.diff
new file mode 100644
index 000000000..168e8c610
--- /dev/null
+++ b/tests/mir-opt/combine_transmutes.adt_transmutes.InstCombine.diff
@@ -0,0 +1,158 @@
+- // MIR for `adt_transmutes` before InstCombine
++ // MIR for `adt_transmutes` after InstCombine
+
+ 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: EnumNoRepr; // in scope 0 at $DIR/combine_transmutes.rs:+1:28: +1:41
+ let mut _4: EnumNoRepr; // in scope 0 at $DIR/combine_transmutes.rs:+2:28: +2:41
+ let mut _6: EnumReprIsize; // in scope 0 at $DIR/combine_transmutes.rs:+3:31: +3:47
+ let mut _8: EnumReprIsize; // in scope 0 at $DIR/combine_transmutes.rs:+4:31: +4:47
+ let mut _10: std::cmp::Ordering; // in scope 0 at $DIR/combine_transmutes.rs:+5:28: +5:52
+ let mut _12: std::cmp::Ordering; // in scope 0 at $DIR/combine_transmutes.rs:+6:28: +6:52
+ let mut _14: std::option::Option<std::num::NonZeroU8>; // in scope 0 at $DIR/combine_transmutes.rs:+7:28: +7:58
+ let mut _16: std::num::Wrapping<i16>; // in scope 0 at $DIR/combine_transmutes.rs:+8:29: +8:54
+ let mut _18: std::num::Wrapping<i16>; // in scope 0 at $DIR/combine_transmutes.rs:+9:29: +9:54
+ let mut _20: Union32; // in scope 0 at $DIR/combine_transmutes.rs:+10:29: +10:47
+ let mut _22: Union32; // in scope 0 at $DIR/combine_transmutes.rs:+11:29: +11:47
+ let mut _24: std::mem::MaybeUninit<std::string::String>; // in scope 0 at $DIR/combine_transmutes.rs:+12:46: +12:77
+ scope 1 {
+ debug _a => _1; // in scope 1 at $DIR/combine_transmutes.rs:+1:9: +1:11
+ let _3: i8; // in scope 1 at $DIR/combine_transmutes.rs:+2:9: +2:11
+ scope 2 {
+ debug _a => _3; // in scope 2 at $DIR/combine_transmutes.rs:+2:9: +2:11
+ let _5: usize; // in scope 2 at $DIR/combine_transmutes.rs:+3:9: +3:11
+ scope 3 {
+ debug _a => _5; // in scope 3 at $DIR/combine_transmutes.rs:+3:9: +3:11
+ let _7: isize; // in scope 3 at $DIR/combine_transmutes.rs:+4:9: +4:11
+ scope 4 {
+ debug _a => _7; // in scope 4 at $DIR/combine_transmutes.rs:+4:9: +4:11
+ let _9: u8; // in scope 4 at $DIR/combine_transmutes.rs:+5:9: +5:11
+ scope 5 {
+ debug _a => _9; // in scope 5 at $DIR/combine_transmutes.rs:+5:9: +5:11
+ let _11: i8; // in scope 5 at $DIR/combine_transmutes.rs:+6:9: +6:11
+ scope 6 {
+ debug _a => _11; // in scope 6 at $DIR/combine_transmutes.rs:+6:9: +6:11
+ let _13: u8; // in scope 6 at $DIR/combine_transmutes.rs:+7:9: +7:11
+ scope 7 {
+ debug _a => _13; // in scope 7 at $DIR/combine_transmutes.rs:+7:9: +7:11
+ let _15: i16; // in scope 7 at $DIR/combine_transmutes.rs:+8:9: +8:11
+ scope 8 {
+ debug _a => _15; // in scope 8 at $DIR/combine_transmutes.rs:+8:9: +8:11
+ let _17: u16; // in scope 8 at $DIR/combine_transmutes.rs:+9:9: +9:11
+ scope 9 {
+ debug _a => _17; // in scope 9 at $DIR/combine_transmutes.rs:+9:9: +9:11
+ let _19: u32; // in scope 9 at $DIR/combine_transmutes.rs:+10:9: +10:11
+ scope 10 {
+ debug _a => _19; // in scope 10 at $DIR/combine_transmutes.rs:+10:9: +10:11
+ let _21: i32; // in scope 10 at $DIR/combine_transmutes.rs:+11:9: +11:11
+ scope 11 {
+ debug _a => _21; // in scope 11 at $DIR/combine_transmutes.rs:+11:9: +11:11
+ let _23: std::mem::ManuallyDrop<std::string::String>; // in scope 11 at $DIR/combine_transmutes.rs:+12:9: +12:11
+ scope 12 {
+ debug _a => _23; // in scope 12 at $DIR/combine_transmutes.rs:+12:9: +12:11
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ 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:41
+ _2 = EnumNoRepr::A; // scope 0 at $DIR/combine_transmutes.rs:+1:28: +1:41
+ _1 = move _2 as u8 (Transmute); // scope 0 at $DIR/combine_transmutes.rs:+1:18: +1:42
+ StorageDead(_2); // scope 0 at $DIR/combine_transmutes.rs:+1:41: +1:42
+ StorageLive(_3); // scope 1 at $DIR/combine_transmutes.rs:+2:9: +2:11
+ StorageLive(_4); // scope 1 at $DIR/combine_transmutes.rs:+2:28: +2:41
+ _4 = EnumNoRepr::B; // scope 1 at $DIR/combine_transmutes.rs:+2:28: +2:41
+ _3 = move _4 as i8 (Transmute); // scope 1 at $DIR/combine_transmutes.rs:+2:18: +2:42
+ StorageDead(_4); // scope 1 at $DIR/combine_transmutes.rs:+2:41: +2:42
+ StorageLive(_5); // scope 2 at $DIR/combine_transmutes.rs:+3:9: +3:11
+ StorageLive(_6); // scope 2 at $DIR/combine_transmutes.rs:+3:31: +3:47
+ _6 = EnumReprIsize::A; // scope 2 at $DIR/combine_transmutes.rs:+3:31: +3:47
+ _5 = move _6 as usize (Transmute); // scope 2 at $DIR/combine_transmutes.rs:+3:21: +3:48
+ StorageDead(_6); // scope 2 at $DIR/combine_transmutes.rs:+3:47: +3:48
+ StorageLive(_7); // scope 3 at $DIR/combine_transmutes.rs:+4:9: +4:11
+ StorageLive(_8); // scope 3 at $DIR/combine_transmutes.rs:+4:31: +4:47
+ _8 = EnumReprIsize::B; // scope 3 at $DIR/combine_transmutes.rs:+4:31: +4:47
+- _7 = move _8 as isize (Transmute); // scope 3 at $DIR/combine_transmutes.rs:+4:21: +4:48
++ _7 = discriminant(_8); // scope 3 at $DIR/combine_transmutes.rs:+4:21: +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:28: +5:52
+ _10 = Less; // scope 4 at $DIR/combine_transmutes.rs:+5:28: +5:52
+ _9 = move _10 as u8 (Transmute); // scope 4 at $DIR/combine_transmutes.rs:+5:18: +5:53
+ StorageDead(_10); // scope 4 at $DIR/combine_transmutes.rs:+5:52: +5:53
+ StorageLive(_11); // scope 5 at $DIR/combine_transmutes.rs:+6:9: +6:11
+ StorageLive(_12); // scope 5 at $DIR/combine_transmutes.rs:+6:28: +6:52
+ _12 = Less; // scope 5 at $DIR/combine_transmutes.rs:+6:28: +6:52
+- _11 = move _12 as i8 (Transmute); // scope 5 at $DIR/combine_transmutes.rs:+6:18: +6:53
++ _11 = discriminant(_12); // scope 5 at $DIR/combine_transmutes.rs:+6:18: +6:53
+ StorageDead(_12); // scope 5 at $DIR/combine_transmutes.rs:+6:52: +6:53
+ StorageLive(_13); // scope 6 at $DIR/combine_transmutes.rs:+7:9: +7:11
+ StorageLive(_14); // scope 6 at $DIR/combine_transmutes.rs:+7:28: +7:58
+ _14 = Option::<NonZeroU8>::Some(const _); // scope 6 at $DIR/combine_transmutes.rs:+7:28: +7:58
+ // mir::Constant
+ // + span: $DIR/combine_transmutes.rs:41:33: 41:57
+ // + literal: Const { ty: NonZeroU8, val: Unevaluated(NonZeroU8::MAX, [], None) }
+ _13 = move _14 as u8 (Transmute); // scope 6 at $DIR/combine_transmutes.rs:+7:18: +7:59
+ StorageDead(_14); // scope 6 at $DIR/combine_transmutes.rs:+7:58: +7:59
+ StorageLive(_15); // scope 7 at $DIR/combine_transmutes.rs:+8:9: +8:11
+ StorageLive(_16); // scope 7 at $DIR/combine_transmutes.rs:+8:29: +8:54
+ _16 = Wrapping::<i16>(const 0_i16); // scope 7 at $DIR/combine_transmutes.rs:+8:29: +8:54
+- _15 = move _16 as i16 (Transmute); // scope 7 at $DIR/combine_transmutes.rs:+8:19: +8:55
++ _15 = move (_16.0: i16); // scope 7 at $DIR/combine_transmutes.rs:+8:19: +8:55
+ StorageDead(_16); // scope 7 at $DIR/combine_transmutes.rs:+8:54: +8:55
+ StorageLive(_17); // scope 8 at $DIR/combine_transmutes.rs:+9:9: +9:11
+ StorageLive(_18); // scope 8 at $DIR/combine_transmutes.rs:+9:29: +9:54
+ _18 = Wrapping::<i16>(const 0_i16); // scope 8 at $DIR/combine_transmutes.rs:+9:29: +9:54
+ _17 = move _18 as u16 (Transmute); // scope 8 at $DIR/combine_transmutes.rs:+9:19: +9:55
+ StorageDead(_18); // scope 8 at $DIR/combine_transmutes.rs:+9:54: +9:55
+ StorageLive(_19); // scope 9 at $DIR/combine_transmutes.rs:+10:9: +10:11
+ StorageLive(_20); // scope 9 at $DIR/combine_transmutes.rs:+10:29: +10:47
+ _20 = Union32 { u32: const 0_i32 }; // scope 9 at $DIR/combine_transmutes.rs:+10:29: +10:47
+ _19 = move _20 as u32 (Transmute); // scope 9 at $DIR/combine_transmutes.rs:+10:19: +10:48
+ StorageDead(_20); // scope 9 at $DIR/combine_transmutes.rs:+10:47: +10:48
+ StorageLive(_21); // scope 10 at $DIR/combine_transmutes.rs:+11:9: +11:11
+ StorageLive(_22); // scope 10 at $DIR/combine_transmutes.rs:+11:29: +11:47
+ _22 = Union32 { u32: const 0_u32 }; // scope 10 at $DIR/combine_transmutes.rs:+11:29: +11:47
+ _21 = move _22 as i32 (Transmute); // scope 10 at $DIR/combine_transmutes.rs:+11:19: +11:48
+ StorageDead(_22); // scope 10 at $DIR/combine_transmutes.rs:+11:47: +11:48
+ StorageLive(_23); // scope 11 at $DIR/combine_transmutes.rs:+12:9: +12:11
+ StorageLive(_24); // scope 11 at $DIR/combine_transmutes.rs:+12:46: +12:77
+ _24 = MaybeUninit::<String>::uninit() -> [return: bb1, unwind unreachable]; // scope 11 at $DIR/combine_transmutes.rs:+12:46: +12:77
+ // mir::Constant
+ // + span: $DIR/combine_transmutes.rs:46:46: 46:75
+ // + user_ty: UserType(23)
+ // + literal: Const { ty: fn() -> MaybeUninit<String> {MaybeUninit::<String>::uninit}, val: Value(<ZST>) }
+ }
+
+ bb1: {
+- _23 = move _24 as std::mem::ManuallyDrop<std::string::String> (Transmute); // scope 11 at $DIR/combine_transmutes.rs:+12:36: +12:78
++ _23 = move (_24.1: std::mem::ManuallyDrop<std::string::String>); // scope 11 at $DIR/combine_transmutes.rs:+12:36: +12:78
+ StorageDead(_24); // scope 11 at $DIR/combine_transmutes.rs:+12:77: +12:78
+ _0 = const (); // scope 0 at $DIR/combine_transmutes.rs:+0:32: +13:2
+ StorageDead(_23); // scope 11 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_21); // scope 10 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_19); // scope 9 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_17); // scope 8 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_15); // scope 7 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_13); // scope 6 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_11); // scope 5 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_9); // scope 4 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_7); // scope 3 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_5); // scope 2 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_3); // scope 1 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ StorageDead(_1); // scope 0 at $DIR/combine_transmutes.rs:+13:1: +13:2
+ return; // scope 0 at $DIR/combine_transmutes.rs:+13:2: +13:2
+ }
+ }
+
diff --git a/tests/mir-opt/combine_transmutes.identity_transmutes.InstCombine.diff b/tests/mir-opt/combine_transmutes.identity_transmutes.InstCombine.diff
new file mode 100644
index 000000000..ae1185c7f
--- /dev/null
+++ b/tests/mir-opt/combine_transmutes.identity_transmutes.InstCombine.diff
@@ -0,0 +1,43 @@
+- // MIR for `identity_transmutes` before InstCombine
++ // MIR for `identity_transmutes` after InstCombine
+
+ 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
+ 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
+ scope 2 {
+ debug _a => _2; // in scope 2 at $DIR/combine_transmutes.rs:+3:9: +3:11
+ }
+ }
+
+ 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>) }
+ }
+
+ 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
+ }
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/combine_transmutes.integer_transmutes.InstCombine.diff b/tests/mir-opt/combine_transmutes.integer_transmutes.InstCombine.diff
new file mode 100644
index 000000000..8de7c34e6
--- /dev/null
+++ b/tests/mir-opt/combine_transmutes.integer_transmutes.InstCombine.diff
@@ -0,0 +1,24 @@
+- // MIR for `integer_transmutes` before InstCombine
++ // MIR for `integer_transmutes` after InstCombine
+
+ 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
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/combine_transmutes.rs b/tests/mir-opt/combine_transmutes.rs
new file mode 100644
index 000000000..de9b9c35c
--- /dev/null
+++ b/tests/mir-opt/combine_transmutes.rs
@@ -0,0 +1,65 @@
+// unit-test: InstCombine
+// compile-flags: -C panic=abort
+
+#![crate_type = "lib"]
+#![feature(core_intrinsics)]
+#![feature(custom_mir)]
+
+use std::intrinsics::mir::*;
+use std::mem::{MaybeUninit, ManuallyDrop, transmute};
+
+// EMIT_MIR combine_transmutes.identity_transmutes.InstCombine.diff
+pub unsafe fn identity_transmutes() {
+ // These are nops and should be removed
+ let _a = transmute::<i32, i32>(1);
+ let _a = transmute::<Vec<i32>, Vec<i32>>(Vec::new());
+}
+
+#[custom_mir(dialect = "runtime", phase = "initial")]
+// EMIT_MIR combine_transmutes.integer_transmutes.InstCombine.diff
+pub unsafe fn integer_transmutes() {
+ mir! {
+ {
+ let A = CastTransmute::<i32, u32>(1); // Can be a cast
+ let B = CastTransmute::<i32, i64>(1); // UB
+ let C = CastTransmute::<u64, i64>(1); // Can be a cast
+ let D = CastTransmute::<u64, u32>(1); // UB
+ let E = CastTransmute::<isize, usize>(1); // Can be a cast
+ Return()
+ }
+ }
+}
+
+// EMIT_MIR combine_transmutes.adt_transmutes.InstCombine.diff
+pub unsafe fn adt_transmutes() {
+ let _a: u8 = transmute(EnumNoRepr::A);
+ let _a: i8 = transmute(EnumNoRepr::B);
+ let _a: usize = transmute(EnumReprIsize::A);
+ let _a: isize = transmute(EnumReprIsize::B);
+ let _a: u8 = transmute(std::cmp::Ordering::Less);
+ let _a: i8 = transmute(std::cmp::Ordering::Less);
+ let _a: u8 = transmute(Some(std::num::NonZeroU8::MAX));
+ let _a: i16 = transmute(std::num::Wrapping(0_i16));
+ let _a: u16 = transmute(std::num::Wrapping(0_i16));
+ let _a: u32 = transmute(Union32 { i32: 0 });
+ let _a: i32 = transmute(Union32 { u32: 0 });
+ let _a: ManuallyDrop<String> = transmute(MaybeUninit::<String>::uninit());
+}
+
+#[inline(always)]
+#[custom_mir(dialect = "runtime", phase = "initial")]
+const unsafe fn mir_transmute<T, U>(x: T) -> U {
+ mir!{
+ {
+ RET = CastTransmute(x);
+ Return()
+ }
+ }
+}
+
+pub enum EnumNoRepr { A, B, C }
+
+#[repr(isize)]
+pub enum EnumReprIsize { A, B, C }
+
+pub union Union32 { u32: u32, i32: i32 }
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..19daae865 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
@@ -7,10 +7,10 @@ promoted[0] in FOO: &[&i32; 1] = {
let mut _3: *const i32; // in scope 0 at $DIR/const_promotion_extern_static.rs:+0:42: +0:43
bb0: {
- _3 = const {alloc3: *const i32}; // scope 0 at $DIR/const_promotion_extern_static.rs:+0:42: +0:43
+ _3 = const {alloc2: *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)) }
+ // + literal: Const { ty: *const i32, val: Value(Scalar(alloc2)) }
_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
@@ -18,4 +18,4 @@ promoted[0] in FOO: &[&i32; 1] = {
}
}
-alloc3 (extern static: X)
+alloc2 (extern static: X)
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..5b13d6005 100644
--- a/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
+++ b/tests/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
@@ -18,11 +18,11 @@
- 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
+- _5 = const {alloc2: *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)) }
+- // + literal: Const { ty: *const i32, val: Value(Scalar(alloc2)) }
- _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
@@ -50,5 +50,5 @@
}
}
-
-- alloc3 (extern static: X)
+- alloc2 (extern static: X)
diff --git a/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff b/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff
index f6e58955b..041197266 100644
--- a/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/aggregate.main.ConstProp.diff
@@ -29,7 +29,7 @@
+ _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:8:5: 8:8
+ // + span: $DIR/aggregate.rs:9:5: 9:8
// + literal: Const { ty: fn(u8) {foo}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir
index 4706af92c..05d4bf8b5 100644
--- a/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir
+++ b/tests/mir-opt/const_prop/aggregate.main.PreCodegen.after.mir
@@ -25,7 +25,7 @@ fn main() -> () {
_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:8:5: 8:8
+ // + span: $DIR/aggregate.rs:9:5: 9:8
// + literal: Const { ty: fn(u8) {foo}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/const_prop/aggregate.rs b/tests/mir-opt/const_prop/aggregate.rs
index aa123b7a8..ed5a4ab59 100644
--- a/tests/mir-opt/const_prop/aggregate.rs
+++ b/tests/mir-opt/const_prop/aggregate.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: ConstProp
// compile-flags: -O
diff --git a/tests/mir-opt/const_prop/array_index.rs b/tests/mir-opt/const_prop/array_index.rs
index d31c2827b..f36cf2213 100644
--- a/tests/mir-opt/const_prop/array_index.rs
+++ b/tests/mir-opt/const_prop/array_index.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: ConstProp
// EMIT_MIR_FOR_EACH_BIT_WIDTH
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 a6fd325ec..38f1a993d 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,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index ae9ffd519..bedfa5992 100644
--- 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
@@ -27,17 +27,19 @@
}
bb1: {
- _5 = Eq(_1, const -1_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+- _5 = Eq(_1, 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, _1) -> 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, _1) -> bb2; // 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, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
}
bb2: {
- _2 = Rem(const 1_i32, _1); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+- _2 = Rem(const 1_i32, _1); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
++ _2 = Rem(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
StorageDead(_2); // scope 1 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.rs b/tests/mir-opt/const_prop/bad_op_mod_by_zero.rs
index cc16a4a5a..a1078472c 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,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 38d402b8f..e711babf0 100644
--- 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
@@ -25,7 +25,7 @@
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_8 = 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:5:25: 5:35
+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:25: 6:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
_2 = &raw const (*_8); // 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
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
index 38d402b8f..e711babf0 100644
--- 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
@@ -25,7 +25,7 @@
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_8 = 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:5:25: 5:35
+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:25: 6:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
_2 = &raw const (*_8); // 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
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 cf22b06d5..3d252f2d2 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,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR bad_op_unsafe_oob_for_slices.main.ConstProp.diff
#[allow(unconditional_panic)]
diff --git a/tests/mir-opt/const_prop/boxes.main.ConstProp.diff b/tests/mir-opt/const_prop/boxes.main.ConstProp.diff
index 5ec421eb2..b0e86e753 100644
--- a/tests/mir-opt/const_prop/boxes.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/boxes.main.ConstProp.diff
@@ -4,14 +4,14 @@
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: +1:22
- let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
- let mut _4: usize; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
- let mut _5: usize; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
- let mut _6: *mut u8; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
- let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
- let mut _8: *const i32; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
- let mut _9: *const i32; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
+ 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
}
@@ -20,41 +20,41 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/boxes.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/boxes.rs:+1:13: +1:22
- StorageLive(_3); // scope 0 at $DIR/boxes.rs:+1:14: +1:22
-- _4 = SizeOf(i32); // scope 2 at $DIR/boxes.rs:+1:14: +1:22
-- _5 = AlignOf(i32); // scope 2 at $DIR/boxes.rs:+1:14: +1:22
-+ _4 = const 4_usize; // scope 2 at $DIR/boxes.rs:+1:14: +1:22
-+ _5 = const 4_usize; // scope 2 at $DIR/boxes.rs:+1:14: +1:22
- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // scope 2 at $DIR/boxes.rs:+1:14: +1:22
+ 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: 13:22
+ // + 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: +1:22
- _7 = ShallowInitBox(move _6, i32); // scope 0 at $DIR/boxes.rs:+1:14: +1:22
- _8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); // scope 0 at $DIR/boxes.rs:+1:19: +1:21
- (*_8) = const 42_i32; // scope 0 at $DIR/boxes.rs:+1:19: +1:21
- _3 = move _7; // scope 0 at $DIR/boxes.rs:+1:14: +1:22
- StorageDead(_7); // scope 0 at $DIR/boxes.rs:+1:21: +1:22
- _9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); // scope 0 at $DIR/boxes.rs:+1:13: +1:22
- _2 = (*_9); // scope 0 at $DIR/boxes.rs:+1:13: +1:22
- _1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:+1:13: +1:26
- StorageDead(_2); // scope 0 at $DIR/boxes.rs:+1:25: +1:26
- drop(_3) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/boxes.rs:+1:26: +1:27
+ 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:+1:26: +1:27
- _0 = const (); // scope 0 at $DIR/boxes.rs:+0:11: +2:2
- StorageDead(_1); // scope 0 at $DIR/boxes.rs:+2:1: +2:2
- return; // scope 0 at $DIR/boxes.rs:+2:2: +2:2
+ 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: +2:2
+ resume; // scope 0 at $DIR/boxes.rs:+0:1: +4:2
}
}
diff --git a/tests/mir-opt/const_prop/boxes.rs b/tests/mir-opt/const_prop/boxes.rs
index d287830db..66e8c24d4 100644
--- a/tests/mir-opt/const_prop/boxes.rs
+++ b/tests/mir-opt/const_prop/boxes.rs
@@ -4,11 +4,13 @@
// ignore-wasm32
// ignore-wasm64
-#![feature(box_syntax)]
+#![feature(rustc_attrs, stmt_expr_attributes)]
-// Note: this test verifies that we, in fact, do not const prop `box`
+// Note: this test verifies that we, in fact, do not const prop `#[rustc_box]`
// EMIT_MIR boxes.main.ConstProp.diff
fn main() {
- let x = *(box 42) + 0;
+ let x = *(#[rustc_box]
+ Box::new(42))
+ + 0;
}
diff --git a/tests/mir-opt/const_prop/checked_add.rs b/tests/mir-opt/const_prop/checked_add.rs
index b9860da4c..007defd10 100644
--- a/tests/mir-opt/const_prop/checked_add.rs
+++ b/tests/mir-opt/const_prop/checked_add.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index bea7114c7..d75fae30b 100644
--- 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
@@ -18,7 +18,7 @@
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:8:13: 8:16
+ // + 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
@@ -29,7 +29,7 @@
_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:9:5: 9:9
+ // + span: $DIR/const_prop_fails_gracefully.rs:10:5: 10:9
// + literal: Const { ty: fn(usize) {read}, val: Value(<ZST>) }
}
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 0a3dcbd38..44d487842 100644
--- a/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs
+++ b/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index f270ab8b6..7e77c18d5 100644
--- a/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
+++ b/tests/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
@@ -14,7 +14,6 @@
}
bb1: {
- StorageLive(_2); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
_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
diff --git a/tests/mir-opt/const_prop/control_flow_simplification.rs b/tests/mir-opt/const_prop/control_flow_simplification.rs
index 7dbe8e734..b2ca045e8 100644
--- a/tests/mir-opt/const_prop/control_flow_simplification.rs
+++ b/tests/mir-opt/const_prop/control_flow_simplification.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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 b9a10704b..6d8738aa6 100644
--- a/tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff
@@ -22,7 +22,7 @@
- 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: $DIR/discriminant.rs:12:34: 12:44
++ // + 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
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 b9a10704b..6d8738aa6 100644
--- a/tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
@@ -22,7 +22,7 @@
- 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: $DIR/discriminant.rs:12:34: 12:44
++ // + 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
diff --git a/tests/mir-opt/const_prop/indirect.rs b/tests/mir-opt/const_prop/indirect.rs
index 44916cbfe..46fd8082d 100644
--- a/tests/mir-opt/const_prop/indirect.rs
+++ b/tests/mir-opt/const_prop/indirect.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index d03c23a3f..0ac7fa43d 100644
--- a/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.diff
@@ -8,7 +8,7 @@
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:8:13: 8:47
+ 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
diff --git a/tests/mir-opt/const_prop/inherit_overflow.rs b/tests/mir-opt/const_prop/inherit_overflow.rs
index 541a8c5c3..4e905d00d 100644
--- a/tests/mir-opt/const_prop/inherit_overflow.rs
+++ b/tests/mir-opt/const_prop/inherit_overflow.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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 4f056dd85..85dedf68c 100644
--- a/tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
@@ -12,12 +12,10 @@
let _3: [E; 1]; // in scope 1 at $DIR/invalid_constant.rs:+13:9: +13:21
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
scope 5 {
- debug _enum_without_variants => _6; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31
- let _7: main::Str<"���">; // in scope 5 at $DIR/invalid_constant.rs:+24:9: +24:22
+ debug _enum_without_variants => const [ZeroSized: Empty]; // in scope 5 at $DIR/invalid_constant.rs:+20:9: +20:31
scope 7 {
- debug _non_utf8_str => _7; // 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
}
}
scope 6 {
@@ -44,18 +42,14 @@
- _3 = [move _4]; // scope 1 at $DIR/invalid_constant.rs:+13:24: +13:60
+ _4 = const Scalar(0x00000004): E; // scope 4 at $DIR/invalid_constant.rs:+13:34: +13:57
+ // mir::Constant
-+ // + span: $DIR/invalid_constant.rs:28:34: 28:57
++ // + span: no-location
+ // + literal: Const { ty: E, val: Value(Scalar(0x00000004)) }
+ _3 = [const Scalar(0x00000004): E]; // scope 1 at $DIR/invalid_constant.rs:+13:24: +13:60
+ // mir::Constant
-+ // + span: $DIR/invalid_constant.rs:28:24: 28:60
++ // + span: no-location
+ // + literal: Const { ty: E, val: Value(Scalar(0x00000004)) }
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 5 at $DIR/invalid_constant.rs:+24:9: +24:22
- StorageDead(_7); // scope 5 at $DIR/invalid_constant.rs:+27:1: +27:2
- StorageDead(_6); // 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
diff --git a/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff
new file mode 100644
index 000000000..e31c2bc39
--- /dev/null
+++ b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff
@@ -0,0 +1,76 @@
+- // MIR for `main` before RemoveZsts
++ // 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
+ 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
+ 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
+ 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
+ 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
+ }
+ }
+ scope 6 {
+ }
+ }
+ scope 4 {
+ }
+ }
+ scope 2 {
+ }
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/invalid_constant.rs b/tests/mir-opt/const_prop/invalid_constant.rs
index 0337a7ca8..eb6172cdf 100644
--- a/tests/mir-opt/const_prop/invalid_constant.rs
+++ b/tests/mir-opt/const_prop/invalid_constant.rs
@@ -11,6 +11,7 @@ enum E { A, B, C }
#[derive(Copy, Clone)]
enum Empty {}
+// EMIT_MIR invalid_constant.main.RemoveZsts.diff
// EMIT_MIR invalid_constant.main.ConstProp.diff
fn main() {
// An invalid char.
diff --git a/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff
index 964dd3080..265269409 100644
--- a/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/issue_66971.main.ConstProp.diff
@@ -5,23 +5,18 @@
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
- let mut _3: (); // in scope 0 at $DIR/issue_66971.rs:+1:13: +1:15
bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_66971.rs:+1:5: +1:23
StorageLive(_2); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
- StorageLive(_3); // scope 0 at $DIR/issue_66971.rs:+1:13: +1:15
- _2 = (move _3, const 0_u8, const 0_u8); // scope 0 at $DIR/issue_66971.rs:+1:12: +1:22
- StorageDead(_3); // scope 0 at $DIR/issue_66971.rs:+1:21: +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:17:5: 17:11
+ // + 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
- StorageDead(_1); // scope 0 at $DIR/issue_66971.rs:+1:23: +1:24
return; // scope 0 at $DIR/issue_66971.rs:+2:2: +2:2
}
}
diff --git a/tests/mir-opt/const_prop/issue_66971.rs b/tests/mir-opt/const_prop/issue_66971.rs
index 6ca03438e..af95c9ca2 100644
--- a/tests/mir-opt/const_prop/issue_66971.rs
+++ b/tests/mir-opt/const_prop/issue_66971.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index a631cb310..54c9200d6 100644
--- a/tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/issue_67019.main.ConstProp.diff
@@ -8,7 +8,6 @@
let mut _3: (u8, u8); // in scope 0 at $DIR/issue_67019.rs:+1:11: +1:17
bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_67019.rs:+1:5: +1:20
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
@@ -17,13 +16,12 @@
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:12:5: 12:9
+ // + 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
- StorageDead(_1); // scope 0 at $DIR/issue_67019.rs:+1:20: +1:21
return; // scope 0 at $DIR/issue_67019.rs:+2:2: +2:2
}
}
diff --git a/tests/mir-opt/const_prop/issue_67019.rs b/tests/mir-opt/const_prop/issue_67019.rs
index ffc6fa1f2..08c7d4805 100644
--- a/tests/mir-opt/const_prop/issue_67019.rs
+++ b/tests/mir-opt/const_prop/issue_67019.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: ConstProp
// compile-flags: -Z mir-opt-level=3
diff --git a/tests/mir-opt/const_prop/large_array_index.rs b/tests/mir-opt/const_prop/large_array_index.rs
index 48d134376..073f98495 100644
--- a/tests/mir-opt/const_prop/large_array_index.rs
+++ b/tests/mir-opt/const_prop/large_array_index.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR large_array_index.main.ConstProp.diff
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
index 149aa6290..75f6ebc58 100644
--- 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
@@ -16,7 +16,7 @@
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
+ // + span: $DIR/mutable_variable_aggregate_partial_read.rs:7:29: 7:32
// + literal: Const { ty: fn() -> (i32, i32) {foo}, val: Value(<ZST>) }
}
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 cb59509ff..70a287cf3 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,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test
// compile-flags: -O
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
index 4010dd6c6..9582504b2 100644
--- 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
@@ -26,7 +26,7 @@
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
+ // + span: $DIR/mutable_variable_unprop_assign.rs:7:13: 7:16
// + literal: Const { ty: fn() -> i32 {foo}, val: Value(<ZST>) }
}
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 b077cfd3e..fabd04e9b 100644
--- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs
+++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test
// compile-flags: -O
diff --git a/tests/mir-opt/const_prop/optimizes_into_variable.rs b/tests/mir-opt/const_prop/optimizes_into_variable.rs
index abea07e20..5ffa15347 100644
--- a/tests/mir-opt/const_prop/optimizes_into_variable.rs
+++ b/tests/mir-opt/const_prop/optimizes_into_variable.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test
// compile-flags: -C overflow-checks=on
diff --git a/tests/mir-opt/const_prop/repeat.rs b/tests/mir-opt/const_prop/repeat.rs
index 36d9b9fc6..2f3b7d2c5 100644
--- a/tests/mir-opt/const_prop/repeat.rs
+++ b/tests/mir-opt/const_prop/repeat.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// compile-flags: -O
// EMIT_MIR_FOR_EACH_BIT_WIDTH
diff --git a/tests/mir-opt/const_prop/return_place.rs b/tests/mir-opt/const_prop/return_place.rs
index 06a853696..ae119df85 100644
--- a/tests/mir-opt/const_prop/return_place.rs
+++ b/tests/mir-opt/const_prop/return_place.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 22f710387..a091b4ace 100644
--- a/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff
@@ -12,16 +12,14 @@
bb0: {
_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
- _2 = consume(_1) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
+ _2 = consume(const 1_u32) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
// mir::Constant
- // + span: $DIR/scalar_literal_propagation.rs:4:5: 4:12
+ // + span: $DIR/scalar_literal_propagation.rs:5:5: 5:12
// + literal: Const { ty: fn(u32) {consume}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:15: +2:16
return; // scope 0 at $DIR/scalar_literal_propagation.rs:+3:2: +3:2
}
}
diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.rs b/tests/mir-opt/const_prop/scalar_literal_propagation.rs
index 8724e4d57..e13e352f8 100644
--- a/tests/mir-opt/const_prop/scalar_literal_propagation.rs
+++ b/tests/mir-opt/const_prop/scalar_literal_propagation.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index b99b83b0c..8bd2b48d6 100644
--- a/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
+++ b/tests/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
@@ -20,7 +20,7 @@
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:7:6: 7:19
+ // + 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
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
index b99b83b0c..8bd2b48d6 100644
--- a/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
+++ b/tests/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
@@ -20,7 +20,7 @@
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:7:6: 7:19
+ // + 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
diff --git a/tests/mir-opt/const_prop/slice_len.rs b/tests/mir-opt/const_prop/slice_len.rs
index 8183def0c..4499c54f2 100644
--- a/tests/mir-opt/const_prop/slice_len.rs
+++ b/tests/mir-opt/const_prop/slice_len.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: ConstProp
// compile-flags: -Zmir-enable-passes=+InstCombine
// 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
index ddc1a4493..85704c48a 100644
--- a/tests/mir-opt/const_prop/switch_int.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/switch_int.main.ConstProp.diff
@@ -15,14 +15,14 @@
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:9:14: 9:17
+ // + span: $DIR/switch_int.rs:10:14: 10: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:8:14: 8:17
+ // + span: $DIR/switch_int.rs:9:14: 9:17
// + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
}
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
index 09c47ee6e..0864db225 100644
--- 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
@@ -15,14 +15,14 @@
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:9:14: 9:17
+ // + span: $DIR/switch_int.rs:10:14: 10: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:8:14: 8:17
+ // + span: $DIR/switch_int.rs:9:14: 9:17
// + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/const_prop/switch_int.rs b/tests/mir-opt/const_prop/switch_int.rs
index d7319eca1..2a2322e43 100644
--- a/tests/mir-opt/const_prop/switch_int.rs
+++ b/tests/mir-opt/const_prop/switch_int.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
#[inline(never)]
fn foo(_: i32) { }
diff --git a/tests/mir-opt/const_prop/transmute.from_char.ConstProp.diff b/tests/mir-opt/const_prop/transmute.from_char.ConstProp.diff
new file mode 100644
index 000000000..933dfbb51
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.from_char.ConstProp.diff
@@ -0,0 +1,15 @@
+- // MIR for `from_char` before ConstProp
++ // 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
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.diff b/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.diff
new file mode 100644
index 000000000..f3474855f
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.invalid_bool.ConstProp.diff
@@ -0,0 +1,14 @@
+- // MIR for `invalid_bool` before ConstProp
++ // 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
+ scope 1 {
+ }
+
+ bb0: {
+ _0 = const -1_i8 as bool (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:30
+ return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.diff b/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.diff
new file mode 100644
index 000000000..ba087e226
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.invalid_char.ConstProp.diff
@@ -0,0 +1,14 @@
+- // MIR for `invalid_char` before ConstProp
++ // 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
+ scope 1 {
+ }
+
+ bb0: {
+ _0 = const _ as char (Transmute); // scope 1 at $DIR/transmute.rs:+1:14: +1:33
+ return; // scope 0 at $DIR/transmute.rs:+2:2: +2:2
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.diff b/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.diff
new file mode 100644
index 000000000..76d464789
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.less_as_i8.ConstProp.diff
@@ -0,0 +1,23 @@
+- // MIR for `less_as_i8` before ConstProp
++ // 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
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.rs b/tests/mir-opt/const_prop/transmute.rs
new file mode 100644
index 000000000..b753cdccd
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.rs
@@ -0,0 +1,61 @@
+// unit-test: ConstProp
+// compile-flags: -O --crate-type=lib
+
+use std::mem::transmute;
+
+// EMIT_MIR transmute.less_as_i8.ConstProp.diff
+pub fn less_as_i8() -> i8 {
+ unsafe { transmute(std::cmp::Ordering::Less) }
+}
+
+// EMIT_MIR transmute.from_char.ConstProp.diff
+pub fn from_char() -> i32 {
+ unsafe { transmute('R') }
+}
+
+// EMIT_MIR transmute.valid_char.ConstProp.diff
+pub fn valid_char() -> char {
+ unsafe { transmute(0x52_u32) }
+}
+
+// EMIT_MIR transmute.invalid_char.ConstProp.diff
+pub unsafe fn invalid_char() -> char {
+ unsafe { transmute(i32::MAX) }
+}
+
+// EMIT_MIR transmute.invalid_bool.ConstProp.diff
+pub unsafe fn invalid_bool() -> bool {
+ unsafe { transmute(-1_i8) }
+}
+
+// EMIT_MIR transmute.undef_union_as_integer.ConstProp.diff
+pub unsafe fn undef_union_as_integer() -> u32 {
+ union Union32 { value: u32, unit: () }
+ unsafe { transmute(Union32 { unit: () }) }
+}
+
+// EMIT_MIR transmute.unreachable_direct.ConstProp.diff
+pub unsafe fn unreachable_direct() -> ! {
+ let x: Never = unsafe { transmute(()) };
+ match x {}
+}
+
+// EMIT_MIR transmute.unreachable_ref.ConstProp.diff
+pub unsafe fn unreachable_ref() -> ! {
+ let x: &Never = unsafe { transmute(1_usize) };
+ match *x {}
+}
+
+// EMIT_MIR transmute.unreachable_mut.ConstProp.diff
+pub unsafe fn unreachable_mut() -> ! {
+ let x: &mut Never = unsafe { transmute(1_usize) };
+ match *x {}
+}
+
+// EMIT_MIR transmute.unreachable_box.ConstProp.diff
+pub unsafe fn unreachable_box() -> ! {
+ let x: Box<Never> = unsafe { transmute(1_usize) };
+ match *x {}
+}
+
+enum Never {}
diff --git a/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.diff b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.diff
new file mode 100644
index 000000000..538b1f26e
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.diff
@@ -0,0 +1,22 @@
+- // MIR for `undef_union_as_integer` before ConstProp
++ // 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
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.diff
new file mode 100644
index 000000000..8bf97996a
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.unreachable_box.ConstProp.diff
@@ -0,0 +1,23 @@
+- // MIR for `unreachable_box` before ConstProp
++ // 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 mut _1: !; // in scope 0 at $DIR/transmute.rs:+0:38: +3:2
+ let _2: std::boxed::Box<Never>; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ let mut _3: !; // in scope 0 at $DIR/transmute.rs:+2:5: +2:16
+ scope 1 {
+ debug x => _2; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ }
+ scope 2 {
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/transmute.rs:+0:38: +3:2
+ StorageLive(_2); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ _2 = const 1_usize as std::boxed::Box<Never> (Transmute); // scope 2 at $DIR/transmute.rs:+1:34: +1:52
+ StorageLive(_3); // scope 1 at $DIR/transmute.rs:+2:5: +2:16
+ unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.diff b/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.diff
new file mode 100644
index 000000000..81b7b3689
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.unreachable_direct.ConstProp.diff
@@ -0,0 +1,25 @@
+- // MIR for `unreachable_direct` before ConstProp
++ // 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 mut _1: !; // in scope 0 at $DIR/transmute.rs:+0:41: +3:2
+ let _2: Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ let mut _3: (); // in scope 0 at $DIR/transmute.rs:+1:39: +1:41
+ let mut _4: !; // in scope 0 at $DIR/transmute.rs:+2:5: +2:15
+ scope 1 {
+ debug x => _2; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ }
+ scope 2 {
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/transmute.rs:+0:41: +3:2
+ StorageLive(_2); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ StorageLive(_3); // scope 2 at $DIR/transmute.rs:+1:39: +1:41
+ _3 = (); // scope 2 at $DIR/transmute.rs:+1:39: +1:41
+ _2 = move _3 as Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:29: +1:42
+ unreachable; // scope 2 at $DIR/transmute.rs:+1:29: +1:42
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.diff b/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.diff
new file mode 100644
index 000000000..34f7aea8e
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.unreachable_mut.ConstProp.diff
@@ -0,0 +1,27 @@
+- // MIR for `unreachable_mut` before ConstProp
++ // 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 mut _1: !; // in scope 0 at $DIR/transmute.rs:+0:38: +3:2
+ let _2: &mut Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ let mut _3: &mut Never; // in scope 0 at $DIR/transmute.rs:+1:34: +1:52
+ let mut _4: !; // in scope 0 at $DIR/transmute.rs:+2:5: +2:16
+ scope 1 {
+ debug x => _2; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ }
+ scope 2 {
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/transmute.rs:+0:38: +3:2
+ StorageLive(_2); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ StorageLive(_3); // scope 0 at $DIR/transmute.rs:+1:34: +1:52
+ _3 = const 1_usize as &mut Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:34: +1:52
+ _2 = &mut (*_3); // scope 0 at $DIR/transmute.rs:+1:34: +1:52
+ StorageDead(_3); // scope 0 at $DIR/transmute.rs:+1:54: +1:55
+ StorageLive(_4); // scope 1 at $DIR/transmute.rs:+2:5: +2:16
+ unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.diff b/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.diff
new file mode 100644
index 000000000..ff95f2a0b
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.unreachable_ref.ConstProp.diff
@@ -0,0 +1,23 @@
+- // MIR for `unreachable_ref` before ConstProp
++ // 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 mut _1: !; // in scope 0 at $DIR/transmute.rs:+0:38: +3:2
+ let _2: &Never; // in scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ let mut _3: !; // in scope 0 at $DIR/transmute.rs:+2:5: +2:16
+ scope 1 {
+ debug x => _2; // in scope 1 at $DIR/transmute.rs:+1:9: +1:10
+ }
+ scope 2 {
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/transmute.rs:+0:38: +3:2
+ StorageLive(_2); // scope 0 at $DIR/transmute.rs:+1:9: +1:10
+ _2 = const 1_usize as &Never (Transmute); // scope 2 at $DIR/transmute.rs:+1:30: +1:48
+ StorageLive(_3); // scope 1 at $DIR/transmute.rs:+2:5: +2:16
+ unreachable; // scope 1 at $DIR/transmute.rs:+2:11: +2:13
+ }
+ }
+
diff --git a/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.diff b/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.diff
new file mode 100644
index 000000000..eac33b730
--- /dev/null
+++ b/tests/mir-opt/const_prop/transmute.valid_char.ConstProp.diff
@@ -0,0 +1,15 @@
+- // MIR for `valid_char` before ConstProp
++ // 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
+ 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
+ }
+ }
+
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
index 270a1ccf5..12313b6c5 100644
--- a/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.ConstProp.diff
@@ -13,15 +13,13 @@
bb0: {
- _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
_2 = consume(_1) -> bb1; // scope 1 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
// mir::Constant
- // + span: $DIR/tuple_literal_propagation.rs:5:5: 5:12
+ // + span: $DIR/tuple_literal_propagation.rs:6:5: 6:12
// + literal: Const { ty: fn((u32, u32)) {consume}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:15: +3:16
return; // scope 0 at $DIR/tuple_literal_propagation.rs:+4:2: +4:2
}
}
diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.rs b/tests/mir-opt/const_prop/tuple_literal_propagation.rs
index e644baec4..edd748d00 100644
--- a/tests/mir-opt/const_prop/tuple_literal_propagation.rs
+++ b/tests/mir-opt/const_prop/tuple_literal_propagation.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// EMIT_MIR tuple_literal_propagation.main.ConstProp.diff
fn main() {
let x = (1, 2);
diff --git a/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff
index b183865a9..2a0bff57d 100644
--- a/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff
@@ -15,7 +15,7 @@
_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:23:29: 23:36
+ // + 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>) }
}
@@ -23,7 +23,7 @@
- _0 = opaque::<u8>(_3) -> bb2; // scope 0 at $DIR/borrowed_local.rs:+12:13: +12:38
+ _0 = opaque::<u8>(_1) -> bb2; // scope 0 at $DIR/borrowed_local.rs:+12:13: +12:38
// mir::Constant
- // + span: $DIR/borrowed_local.rs:27:28: 27:34
+ // + span: $DIR/borrowed_local.rs:28:28: 28:34
// + literal: Const { ty: fn(u8) -> bool {opaque::<u8>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/borrowed_local.rs b/tests/mir-opt/copy-prop/borrowed_local.rs
index c4b980e2b..9186da5af 100644
--- a/tests/mir-opt/copy-prop/borrowed_local.rs
+++ b/tests/mir-opt/copy-prop/borrowed_local.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 8b116532d..b78c19d78 100644
--- a/tests/mir-opt/copy-prop/branch.foo.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/branch.foo.CopyProp.diff
@@ -18,7 +18,7 @@
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:13:13: 13:16
+ // + span: $DIR/branch.rs:14:13: 14:16
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
}
@@ -27,7 +27,7 @@
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:15:16: 15:20
+ // + span: $DIR/branch.rs:16:16: 16:20
// + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
}
@@ -44,7 +44,7 @@
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:18:9: 18:12
+ // + span: $DIR/branch.rs:19:9: 19:12
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/branch.rs b/tests/mir-opt/copy-prop/branch.rs
index 50b1e00fa..0a2e16946 100644
--- a/tests/mir-opt/copy-prop/branch.rs
+++ b/tests/mir-opt/copy-prop/branch.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
//! 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.bar.CopyProp.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.diff
index ac4e9a2bf..24bca3220 100644
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.diff
@@ -13,7 +13,7 @@
_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:16:5: 16:10
+ // + span: $DIR/copy_propagation_arg.rs:17:5: 17:10
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
}
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
index 0a3e985e7..87708f340 100644
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.diff
@@ -13,7 +13,7 @@
_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:11:9: 11:14
+ // + span: $DIR/copy_propagation_arg.rs:12:9: 12:14
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.rs b/tests/mir-opt/copy-prop/copy_propagation_arg.rs
index cc98985f1..1b65dcb01 100644
--- a/tests/mir-opt/copy-prop/copy_propagation_arg.rs
+++ b/tests/mir-opt/copy-prop/copy_propagation_arg.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 6ca73ffdd..160f47bdd 100644
--- a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff
@@ -11,7 +11,7 @@
- _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:15:24: 15:30
+ // + span: $DIR/custom_move_arg.rs:16:24: 16:30
// + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }
}
@@ -20,7 +20,7 @@
- _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:19:24: 19:30
+ // + span: $DIR/custom_move_arg.rs:20:24: 20:30
// + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.rs b/tests/mir-opt/copy-prop/custom_move_arg.rs
index 4a591146e..29c368df8 100644
--- a/tests/mir-opt/copy-prop/custom_move_arg.rs
+++ b/tests/mir-opt/copy-prop/custom_move_arg.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 3e61869e8..23d92ed1a 100644
--- a/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff
@@ -24,7 +24,7 @@
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:9:17: 9:20
+ // + span: $DIR/cycle.rs:10:17: 10:20
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
}
@@ -43,7 +43,7 @@
_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:14:5: 14:9
+ // + span: $DIR/cycle.rs:15:5: 15:9
// + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/cycle.rs b/tests/mir-opt/copy-prop/cycle.rs
index b74c39726..da70f6bec 100644
--- a/tests/mir-opt/copy-prop/cycle.rs
+++ b/tests/mir-opt/copy-prop/cycle.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
//! 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
index d48b04e2d..c56418d88 100644
--- 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
@@ -18,7 +18,7 @@ fn f(_1: usize) -> usize {
_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:12:5: 12:7
+ // + span: $DIR/dead_stores_79191.rs:13:5: 13:7
// + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.rs b/tests/mir-opt/copy-prop/dead_stores_79191.rs
index e3493b8b7..84453c55e 100644
--- a/tests/mir-opt/copy-prop/dead_stores_79191.rs
+++ b/tests/mir-opt/copy-prop/dead_stores_79191.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 727791f50..f35542173 100644
--- 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
@@ -18,7 +18,7 @@ fn f(_1: usize) -> usize {
_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:16:5: 16:7
+ // + span: $DIR/dead_stores_better.rs:17:5: 17:7
// + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.rs b/tests/mir-opt/copy-prop/dead_stores_better.rs
index 8465b3c98..87b916fd3 100644
--- a/tests/mir-opt/copy-prop/dead_stores_better.rs
+++ b/tests/mir-opt/copy-prop/dead_stores_better.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 97d0a01e0..e09ccb831 100644
--- a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.diff
@@ -51,7 +51,7 @@
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:10:19: 10:22
+ // + 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>) }
}
@@ -61,7 +61,7 @@
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:10:14: 10:24
+ // + 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>) }
}
@@ -81,7 +81,7 @@
_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:10:14: 10:24
+ // + 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>) }
}
diff --git a/tests/mir-opt/copy-prop/issue_107511.rs b/tests/mir-opt/copy-prop/issue_107511.rs
index d593f2872..2b00ff155 100644
--- a/tests/mir-opt/copy-prop/issue_107511.rs
+++ b/tests/mir-opt/copy-prop/issue_107511.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index d76bf1cfe..650bd66a7 100644
--- a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.diff
@@ -24,7 +24,7 @@
- _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:7:5: 7:6
+ // + span: $DIR/move_arg.rs:8:5: 8:6
// + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/move_arg.rs b/tests/mir-opt/copy-prop/move_arg.rs
index 40ae1d8f4..f88d9a9e7 100644
--- a/tests/mir-opt/copy-prop/move_arg.rs
+++ b/tests/mir-opt/copy-prop/move_arg.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 02308beb8..beb85d68a 100644
--- a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.diff
@@ -13,14 +13,14 @@
+ _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:19:28: 19:34
+ // + 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:22:28: 22:34
+ // + span: $DIR/move_projection.rs:23:28: 23:34
// + literal: Const { ty: fn(u8) -> bool {opaque::<u8>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/copy-prop/move_projection.rs b/tests/mir-opt/copy-prop/move_projection.rs
index 2a1bbae99..c158c69e0 100644
--- a/tests/mir-opt/copy-prop/move_projection.rs
+++ b/tests/mir-opt/copy-prop/move_projection.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: CopyProp
#![feature(custom_mir, core_intrinsics)]
diff --git a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.diff b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.diff
new file mode 100644
index 000000000..b4a248245
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.diff
@@ -0,0 +1,56 @@
+- // 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.miraw.CopyProp.diff b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.diff
new file mode 100644
index 000000000..a6a6c05b2
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.diff
@@ -0,0 +1,52 @@
+- // 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.remut.CopyProp.diff b/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.diff
new file mode 100644
index 000000000..f3d26cc6e
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.remut.CopyProp.diff
@@ -0,0 +1,50 @@
+- // 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.reraw.CopyProp.diff b/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.diff
new file mode 100644
index 000000000..63e42b4dc
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.reraw.CopyProp.diff
@@ -0,0 +1,50 @@
+- // 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.rs b/tests/mir-opt/copy-prop/reborrow.rs
new file mode 100644
index 000000000..91b77966b
--- /dev/null
+++ b/tests/mir-opt/copy-prop/reborrow.rs
@@ -0,0 +1,47 @@
+// ignore-wasm32 compiled with panic=abort by default
+// Check that CopyProp considers reborrows as not mutating the pointer.
+// unit-test: CopyProp
+
+#![feature(raw_ref_op)]
+
+#[inline(never)]
+fn opaque(_: impl Sized) {}
+
+// EMIT_MIR reborrow.remut.CopyProp.diff
+fn remut(mut x: u8) {
+ let a = &mut x;
+ let b = &mut *a; //< this cannot mutate a.
+ let c = a; //< so `c` and `a` can be merged.
+ opaque(c);
+}
+
+// EMIT_MIR reborrow.reraw.CopyProp.diff
+fn reraw(mut x: u8) {
+ let a = &mut x;
+ let b = &raw mut *a; //< this cannot mutate a.
+ let c = a; //< so `c` and `a` can be merged.
+ opaque(c);
+}
+
+// EMIT_MIR reborrow.miraw.CopyProp.diff
+fn miraw(mut x: u8) {
+ let a = &raw mut x;
+ let b = unsafe { &raw mut *a }; //< this cannot mutate a.
+ let c = a; //< so `c` and `a` can be merged.
+ opaque(c);
+}
+
+// EMIT_MIR reborrow.demiraw.CopyProp.diff
+fn demiraw(mut x: u8) {
+ let a = &raw mut x;
+ let b = unsafe { &mut *a }; //< this cannot mutate a.
+ let c = a; //< so `c` and `a` can be merged.
+ opaque(c);
+}
+
+fn main() {
+ remut(0);
+ reraw(0);
+ miraw(0);
+ demiraw(0);
+}
diff --git a/tests/mir-opt/dataflow-const-prop/checked.rs b/tests/mir-opt/dataflow-const-prop/checked.rs
index 0738a4ee5..0f9f5a97f 100644
--- a/tests/mir-opt/dataflow-const-prop/checked.rs
+++ b/tests/mir-opt/dataflow-const-prop/checked.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: DataflowConstProp
// compile-flags: -Coverflow-checks=on
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
index 29781e9ce..1edcc28e6 100644
--- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
@@ -8,7 +8,7 @@
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:8:13: 8:47
+ 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
diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs b/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs
index f4aba60f0..90349d527 100644
--- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs
+++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: DataflowConstProp
// compile-flags: -Zmir-enable-passes=+Inline
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
index 158f187f1..70ef17afd 100644
--- 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
@@ -26,7 +26,7 @@
_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:12:5: 12:11
+ // + span: $DIR/ref_without_sb.rs:13:5: 13:11
// + literal: Const { ty: for<'a> fn(&'a i32) {escape::<i32>}, val: Value(<ZST>) }
}
@@ -38,7 +38,7 @@
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:14:5: 14:18
+ // + span: $DIR/ref_without_sb.rs:15:5: 15:18
// + literal: Const { ty: fn() {some_function}, val: Value(<ZST>) }
}
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 2fd480b09..f53de3cf2 100644
--- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs
+++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: DataflowConstProp
#[inline(never)]
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
index 004643e36..6ca569f3d 100644
--- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
@@ -32,7 +32,7 @@
_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:15:12: 15:15
+ // + 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>) }
}
diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
index 6dfb3a4ed..81fc3c2f4 100644
--- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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/terminator.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff
index 8018400e7..9854beaeb 100644
--- a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff
@@ -25,7 +25,7 @@
- _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:9:5: 9:8
+ // + span: $DIR/terminator.rs:10:5: 10:8
// + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dataflow-const-prop/terminator.rs b/tests/mir-opt/dataflow-const-prop/terminator.rs
index d151f666a..4f001df35 100644
--- a/tests/mir-opt/dataflow-const-prop/terminator.rs
+++ b/tests/mir-opt/dataflow-const-prop/terminator.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: DataflowConstProp
fn foo(n: i32) {}
diff --git a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff
index cd3b792fb..2776ff51d 100644
--- a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff
+++ b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination.diff
@@ -32,7 +32,7 @@
+ 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:12:11: 12:15
+ // + span: $DIR/cycle.rs:13:11: 13:15
// + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dead-store-elimination/cycle.rs b/tests/mir-opt/dead-store-elimination/cycle.rs
index b35ce0bcb..570bfe84d 100644
--- a/tests/mir-opt/dead-store-elimination/cycle.rs
+++ b/tests/mir-opt/dead-store-elimination/cycle.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: DeadStoreElimination
#[inline(never)]
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
index 3b1f81175..c4ebf1ca8 100644
--- 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
@@ -19,7 +19,7 @@
_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:5:13: 5:21
+ // + 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>) }
}
diff --git a/tests/mir-opt/deduplicate_blocks.rs b/tests/mir-opt/deduplicate_blocks.rs
index 2b9eed99e..46012e19a 100644
--- a/tests/mir-opt/deduplicate_blocks.rs
+++ b/tests/mir-opt/deduplicate_blocks.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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 9597a0c83..97826ed19 100644
--- a/tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir
+++ b/tests/mir-opt/deref-patterns/string.foo.PreCodegen.after.mir
@@ -25,19 +25,19 @@ fn foo(_1: Option<String>) -> i32 {
_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) -> bb6; // scope 0 at $DIR/string.rs:+3:17: +3:18
+ drop(_6) -> [return: bb6, unwind unreachable]; // scope 0 at $DIR/string.rs:+3:17: +3:18
}
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) -> bb3; // 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>) }
}
bb3: {
- _4 = <str as PartialEq>::eq(_3, const "a") -> bb4; // scope 0 at $DIR/string.rs:+2:14: +2:17
+ _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>) }
@@ -65,7 +65,7 @@ fn foo(_1: Option<String>) -> i32 {
}
bb8: {
- drop(_1) -> bb7; // scope 0 at $DIR/string.rs:+5:1: +5:2
+ drop(_1) -> [return: bb7, unwind unreachable]; // scope 0 at $DIR/string.rs:+5:1: +5:2
}
bb9: {
diff --git a/tests/mir-opt/derefer_inline_test.main.Derefer.diff b/tests/mir-opt/derefer_inline_test.main.Derefer.diff
index 3540df308..426d4fb21 100644
--- a/tests/mir-opt/derefer_inline_test.main.Derefer.diff
+++ b/tests/mir-opt/derefer_inline_test.main.Derefer.diff
@@ -3,58 +3,42 @@
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:12
- let mut _2: usize; // in scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- let mut _3: usize; // in scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- let mut _4: *mut u8; // in scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- let mut _5: std::boxed::Box<std::boxed::Box<u32>>; // in scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- scope 1 {
- }
+ 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:12
- _2 = SizeOf(std::boxed::Box<u32>); // scope 1 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- _3 = AlignOf(std::boxed::Box<u32>); // scope 1 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/derefer_inline_test.rs:+1:5: +1:12
+ 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:11:5: 11:12
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ // + span: $DIR/derefer_inline_test.rs:10:14: 10:15
+ // + literal: Const { ty: fn() -> Box<u32> {f}, val: Value(<ZST>) }
}
bb1: {
- StorageLive(_5); // scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- _5 = ShallowInitBox(move _4, std::boxed::Box<u32>); // scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- (*_5) = f() -> [return: bb2, unwind: bb6]; // scope 0 at $DIR/derefer_inline_test.rs:+1:9: +1:12
+ _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:11:9: 11:10
- // + literal: Const { ty: fn() -> Box<u32> {f}, val: Value(<ZST>) }
+ // + 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: {
- _1 = move _5; // scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
- drop(_5) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/derefer_inline_test.rs:+1:11: +1:12
+ 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(_5); // scope 0 at $DIR/derefer_inline_test.rs:+1:11: +1:12
- drop(_1) -> bb4; // scope 0 at $DIR/derefer_inline_test.rs:+1:12: +1:13
- }
-
- bb4: {
- StorageDead(_1); // scope 0 at $DIR/derefer_inline_test.rs:+1:12: +1:13
+ 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
}
- bb5 (cleanup): {
- drop(_1) -> bb7; // scope 0 at $DIR/derefer_inline_test.rs:+1:12: +1:13
- }
-
- bb6 (cleanup): {
- drop(_5) -> bb7; // scope 0 at $DIR/derefer_inline_test.rs:+1:11: +1:12
+ bb4 (cleanup): {
+ drop(_2) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/derefer_inline_test.rs:+1:17: +1:18
}
- bb7 (cleanup): {
+ bb5 (cleanup): {
resume; // scope 0 at $DIR/derefer_inline_test.rs:+0:1: +2:2
}
}
diff --git a/tests/mir-opt/derefer_inline_test.rs b/tests/mir-opt/derefer_inline_test.rs
index cc06a7dd8..38311d4d0 100644
--- a/tests/mir-opt/derefer_inline_test.rs
+++ b/tests/mir-opt/derefer_inline_test.rs
@@ -2,11 +2,10 @@
// EMIT_MIR derefer_inline_test.main.Derefer.diff
// ignore-wasm32 compiled with panic=abort by default
-#![feature(box_syntax)]
#[inline]
fn f() -> Box<u32> {
- box 0
+ Box::new(0)
}
fn main() {
- box f();
+ Box::new(f());
}
diff --git a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff
index 9c7296632..b7416d389 100644
--- a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff
+++ b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff
@@ -22,7 +22,7 @@
+ 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:13:13: 13:16
+ // + span: $DIR/branch.rs:14:13: 14:16
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
}
@@ -32,7 +32,7 @@
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:15:16: 15:20
+ // + span: $DIR/branch.rs:16:16: 16:20
// + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
}
@@ -50,7 +50,7 @@
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:18:9: 18:12
+ // + span: $DIR/branch.rs:19:9: 19:12
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dest-prop/branch.rs b/tests/mir-opt/dest-prop/branch.rs
index 898c908b1..7e4276e66 100644
--- a/tests/mir-opt/dest-prop/branch.rs
+++ b/tests/mir-opt/dest-prop/branch.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
//! 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.bar.DestinationPropagation.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff
index 298991b5a..a61e741f7 100644
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.diff
@@ -16,7 +16,7 @@
+ 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:16:5: 16:10
+ // + span: $DIR/copy_propagation_arg.rs:17:5: 17:10
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
}
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
index d37a9f71d..c7fbecac5 100644
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.diff
@@ -15,7 +15,7 @@
- _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:11:9: 11:14
+ // + span: $DIR/copy_propagation_arg.rs:12:9: 12:14
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.rs b/tests/mir-opt/dest-prop/copy_propagation_arg.rs
index 31be6c931..57cb328c2 100644
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.rs
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index cfc203c5f..b06f069a2 100644
--- a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff
+++ b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.diff
@@ -28,7 +28,7 @@
+ 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:9:17: 9:20
+ // + span: $DIR/cycle.rs:10:17: 10:20
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
}
@@ -56,7 +56,7 @@
+ 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:14:5: 14:9
+ // + span: $DIR/cycle.rs:15:5: 15:9
// + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dest-prop/cycle.rs b/tests/mir-opt/dest-prop/cycle.rs
index 6182878f3..3aea19d80 100644
--- a/tests/mir-opt/dest-prop/cycle.rs
+++ b/tests/mir-opt/dest-prop/cycle.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
//! 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
index 63cac133b..b9d4b59d2 100644
--- 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
@@ -22,7 +22,7 @@ fn f(_1: usize) -> usize {
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:12:5: 12:7
+ // + span: $DIR/dead_stores_79191.rs:13:5: 13:7
// + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.rs b/tests/mir-opt/dest-prop/dead_stores_79191.rs
index 43e0bf664..9d4814838 100644
--- a/tests/mir-opt/dest-prop/dead_stores_79191.rs
+++ b/tests/mir-opt/dest-prop/dead_stores_79191.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 26068931a..9eb0e09bf 100644
--- 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
@@ -21,7 +21,7 @@ fn f(_1: usize) -> usize {
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:16:5: 16:7
+ // + span: $DIR/dead_stores_better.rs:17:5: 17:7
// + literal: Const { ty: fn(usize) -> usize {id::<usize>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dest-prop/dead_stores_better.rs b/tests/mir-opt/dest-prop/dead_stores_better.rs
index 003ad57d8..72d406bfd 100644
--- a/tests/mir-opt/dest-prop/dead_stores_better.rs
+++ b/tests/mir-opt/dest-prop/dead_stores_better.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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.rs b/tests/mir-opt/dest-prop/simple.rs
index d4c27228f..3a4aec34e 100644
--- a/tests/mir-opt/dest-prop/simple.rs
+++ b/tests/mir-opt/dest-prop/simple.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
//! 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
index fbed31788..457fc8308 100644
--- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff
+++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.diff
@@ -10,7 +10,7 @@
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:15:5: 15:27
+ 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
}
}
@@ -20,7 +20,7 @@
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:13:23: 13:26
+ // + span: $DIR/union.rs:14:23: 14:26
// + literal: Const { ty: fn() -> u32 {val}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dest-prop/union.rs b/tests/mir-opt/dest-prop/union.rs
index eb6cb09fc..062d02d06 100644
--- a/tests/mir-opt/dest-prop/union.rs
+++ b/tests/mir-opt/dest-prop/union.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
//! 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
index 9ea756c27..ae63d724d 100644
--- a/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff
+++ b/tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.diff
@@ -36,7 +36,7 @@
- _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:11:9: 11:10
+- // + span: $DIR/unreachable.rs:12:9: 12:10
- // + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) }
- }
-
@@ -60,7 +60,7 @@
+ _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:13:9: 13:10
+ // + span: $DIR/unreachable.rs:14:9: 14:10
// + literal: Const { ty: fn(T, T) {g::<T>}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/dest-prop/unreachable.rs b/tests/mir-opt/dest-prop/unreachable.rs
index 32b5def98..c73d11ae3 100644
--- a/tests/mir-opt/dest-prop/unreachable.rs
+++ b/tests/mir-opt/dest-prop/unreachable.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// Check that unreachable code is removed after the destination propagation.
// Regression test for issue #105428.
//
diff --git a/tests/mir-opt/div_overflow.const_dividend.PreCodegen.after.mir b/tests/mir-opt/div_overflow.const_dividend.PreCodegen.after.mir
deleted file mode 100644
index 1a7fb916e..000000000
--- a/tests/mir-opt/div_overflow.const_dividend.PreCodegen.after.mir
+++ /dev/null
@@ -1,17 +0,0 @@
-// MIR for `const_dividend` after PreCodegen
-
-fn const_dividend(_1: i32) -> i32 {
- debug a => _1; // in scope 0 at $DIR/div_overflow.rs:+0:23: +0:24
- let mut _0: i32; // return place in scope 0 at $DIR/div_overflow.rs:+0:34: +0:37
- let mut _2: bool; // in scope 0 at $DIR/div_overflow.rs:+1:5: +1:12
-
- bb0: {
- _2 = Eq(_1, const 0_i32); // scope 0 at $DIR/div_overflow.rs:+1:5: +1:12
- assert(!move _2, "attempt to divide `{}` by zero", const 256_i32) -> bb1; // scope 0 at $DIR/div_overflow.rs:+1:5: +1:12
- }
-
- bb1: {
- _0 = Div(const 256_i32, _1); // scope 0 at $DIR/div_overflow.rs:+1:5: +1:12
- return; // scope 0 at $DIR/div_overflow.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/div_overflow.const_divisor.PreCodegen.after.mir b/tests/mir-opt/div_overflow.const_divisor.PreCodegen.after.mir
deleted file mode 100644
index 5526a194b..000000000
--- a/tests/mir-opt/div_overflow.const_divisor.PreCodegen.after.mir
+++ /dev/null
@@ -1,11 +0,0 @@
-// MIR for `const_divisor` after PreCodegen
-
-fn const_divisor(_1: i32) -> i32 {
- debug a => _1; // in scope 0 at $DIR/div_overflow.rs:+0:22: +0:23
- let mut _0: i32; // return place in scope 0 at $DIR/div_overflow.rs:+0:33: +0:36
-
- bb0: {
- _0 = Div(_1, const 256_i32); // scope 0 at $DIR/div_overflow.rs:+1:5: +1:12
- return; // scope 0 at $DIR/div_overflow.rs:+2:2: +2:2
- }
-}
diff --git a/tests/mir-opt/div_overflow.rs b/tests/mir-opt/div_overflow.rs
deleted file mode 100644
index 10ce5bc0f..000000000
--- a/tests/mir-opt/div_overflow.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// compile-flags: -Copt-level=0 -Coverflow-checks=yes
-
-// Tests that division with a const does not emit a panicking branch for overflow
-
-// EMIT_MIR div_overflow.const_divisor.PreCodegen.after.mir
-pub fn const_divisor(a: i32) -> i32 {
- a / 256
-}
-
-// EMIT_MIR div_overflow.const_dividend.PreCodegen.after.mir
-pub fn const_dividend(a: i32) -> i32 {
- 256 / a
-}
-
-fn main() {
- const_divisor(123);
- const_dividend(123);
-}
diff --git a/tests/mir-opt/dont_yeet_assert.generic.InstCombine.diff b/tests/mir-opt/dont_yeet_assert.generic.InstCombine.diff
index c1a42a47e..c0fc1fb1d 100644
--- a/tests/mir-opt/dont_yeet_assert.generic.InstCombine.diff
+++ b/tests/mir-opt/dont_yeet_assert.generic.InstCombine.diff
@@ -7,7 +7,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/dont_yeet_assert.rs:+1:5: +1:61
- _1 = assert_mem_uninitialized_valid::<&T>() -> bb1; // 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)
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
index 1f5c53381..8a4a16825 100644
--- a/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
+++ b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
@@ -40,7 +40,7 @@
_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:15:26: 15:35
+ // + span: $DIR/funky_arms.rs:16:26: 16:35
// + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> bool {Formatter::<'_>::sign_plus}, val: Value(<ZST>) }
}
@@ -54,7 +54,7 @@
- _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: $DIR/funky_arms.rs:21:17: 21:41
++ // + span: no-location
+ // + literal: Const { ty: Sign, val: Value(Scalar(0x01)) }
goto -> bb4; // scope 1 at $DIR/funky_arms.rs:+10:17: +10:41
}
@@ -63,7 +63,7 @@
- _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: $DIR/funky_arms.rs:20:18: 20:38
++ // + span: no-location
+ // + literal: Const { ty: Sign, val: Value(Scalar(0x00)) }
goto -> bb4; // scope 1 at $DIR/funky_arms.rs:+9:18: +9:38
}
@@ -74,7 +74,7 @@
_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:24:34: 24:43
+ // + span: $DIR/funky_arms.rs:25:34: 25:43
// + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> Option<usize> {Formatter::<'_>::precision}, val: Value(<ZST>) }
}
@@ -95,7 +95,7 @@
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:26:9: 26:42
+ // + 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>) }
}
@@ -110,7 +110,7 @@
_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:28:9: 28:45
+ // + 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>) }
}
diff --git a/tests/mir-opt/funky_arms.rs b/tests/mir-opt/funky_arms.rs
index 3e70d85e0..c4f75b5df 100644
--- a/tests/mir-opt/funky_arms.rs
+++ b/tests/mir-opt/funky_arms.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// compile-flags: --crate-type lib -Cdebug-assertions=no
#![feature(flt2dec)]
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
index cfbe0aaf2..32b472ebe 100644
--- 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
@@ -110,7 +110,7 @@ yields ()
bb13 (cleanup): {
StorageDead(_3); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- drop(_1) -> bb14; // 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): {
@@ -119,6 +119,6 @@ yields ()
bb15 (cleanup): {
StorageDead(_3); // scope 0 at $DIR/generator_storage_dead_unwind.rs:+6:5: +6:6
- drop(_1) -> bb14; // 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_tiny.main-{closure#0}.generator_resume.0.mir b/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir
index 7efda05d2..dc9bb533f 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
@@ -63,7 +63,7 @@ fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator_tiny.rs:19:16: 19:24
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() -> bb4; // 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>) }
diff --git a/tests/mir-opt/inline/asm_unwind.main.Inline.diff b/tests/mir-opt/inline/asm_unwind.main.Inline.diff
index f1b62ac38..ba1bfec05 100644
--- a/tests/mir-opt/inline/asm_unwind.main.Inline.diff
+++ b/tests/mir-opt/inline/asm_unwind.main.Inline.diff
@@ -7,7 +7,7 @@
+ 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 => _2; // in scope 2 at $DIR/asm_unwind.rs:15:9: 15:11
++ debug _d => const D; // in scope 2 at $DIR/asm_unwind.rs:15:9: 15:11
+ scope 3 {
+ }
+ }
@@ -19,23 +19,23 @@
- // mir::Constant
- // + span: $DIR/asm_unwind.rs:21:5: 21:8
- // + literal: Const { ty: fn() {foo}, val: Value(<ZST>) }
-+ StorageLive(_2); // scope 1 at $DIR/asm_unwind.rs:15:9: 15:11
-+ asm!("", options(MAY_UNWIND)) -> [return: bb1, unwind: bb3]; // scope 3 at $DIR/asm_unwind.rs:16:14: 16:54
++ 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: {
-+ drop(_2) -> bb2; // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2
-+ }
-+
-+ bb2: {
-+ StorageDead(_2); // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2
++ 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) -> bb4; // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2
++ drop(_2) -> [return: bb4, unwind terminate]; // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2
+ }
+
+ bb4 (cleanup): {
diff --git a/tests/mir-opt/inline/cycle.f.Inline.diff b/tests/mir-opt/inline/cycle.f.Inline.diff
index 501390c3b..8da597577 100644
--- a/tests/mir-opt/inline/cycle.f.Inline.diff
+++ b/tests/mir-opt/inline/cycle.f.Inline.diff
@@ -33,7 +33,7 @@
}
bb3 (cleanup): {
- drop(_1) -> bb4; // scope 0 at $DIR/cycle.rs:+2:1: +2:2
+ drop(_1) -> [return: bb4, unwind terminate]; // scope 0 at $DIR/cycle.rs:+2:1: +2:2
}
bb4 (cleanup): {
diff --git a/tests/mir-opt/inline/cycle.g.Inline.diff b/tests/mir-opt/inline/cycle.g.Inline.diff
index 5f3ee467c..1e6e30f9e 100644
--- a/tests/mir-opt/inline/cycle.g.Inline.diff
+++ b/tests/mir-opt/inline/cycle.g.Inline.diff
@@ -5,11 +5,11 @@
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
-+ let mut _5: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
+ scope 2 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8
+ }
+ }
@@ -25,14 +25,16 @@
- // mir::Constant
// + span: $DIR/cycle.rs:12:7: 12:11
// + literal: Const { ty: fn() {main}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8
++ 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
@@ -40,7 +42,7 @@
+ }
+
+ bb2 (cleanup): {
-+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2
++ drop(_2) -> [return: bb3, unwind terminate]; // scope 1 at $DIR/cycle.rs:7:1: 7:2
+ }
+
+ bb3 (cleanup): {
@@ -48,9 +50,8 @@
+ }
+
+ bb4: {
-+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 6:8
++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8
-+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9
+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2
}
}
diff --git a/tests/mir-opt/inline/cycle.main.Inline.diff b/tests/mir-opt/inline/cycle.main.Inline.diff
index 6b4c63bbd..315634945 100644
--- a/tests/mir-opt/inline/cycle.main.Inline.diff
+++ b/tests/mir-opt/inline/cycle.main.Inline.diff
@@ -5,11 +5,11 @@
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
-+ let mut _5: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
+ scope 2 (inlined <fn() {g} as Fn<()>>::call - shim(fn() {g})) { // at $DIR/cycle.rs:6:5: 6:8
+ }
+ }
@@ -25,14 +25,16 @@
- // mir::Constant
// + span: $DIR/cycle.rs:17:7: 17:8
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8
++ 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
@@ -40,7 +42,7 @@
+ }
+
+ bb2 (cleanup): {
-+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2
++ drop(_2) -> [return: bb3, unwind terminate]; // scope 1 at $DIR/cycle.rs:7:1: 7:2
+ }
+
+ bb3 (cleanup): {
@@ -48,9 +50,8 @@
+ }
+
+ bb4: {
-+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 6:8
++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8
-+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9
+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2
}
}
diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff
index 64c3e47ff..75d9bd54d 100644
--- a/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff
+++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.diff
@@ -9,11 +9,11 @@
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:34:5: 34:25
-+ debug c => _4; // in scope 2 at $DIR/dyn_trait.rs:26:36: 26:37
-+ let mut _5: &dyn Cache<V = <Q as Query>::V>; // in scope 2 at $DIR/dyn_trait.rs:27:14: 27:15
-+ scope 3 (inlined mk_cycle::<<Q as Query>::V>) { // at $DIR/dyn_trait.rs:27:5: 27:16
-+ debug c => _5; // in scope 3 at $DIR/dyn_trait.rs:20:27: 20:28
++ 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
+ }
+ }
}
@@ -24,7 +24,7 @@
_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:33:13: 33:21
+ // + 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>) }
}
@@ -34,18 +34,18 @@
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:27:14: 27:15
-+ _5 = _4 as &dyn Cache<V = <Q as Query>::V> (Pointer(Unsize)); // scope 2 at $DIR/dyn_trait.rs:27:14: 27:15
-+ _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(_5) -> bb2; // scope 3 at $DIR/dyn_trait.rs:21:5: 21:22
++ 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:34:5: 34:22
+- // + 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:21:7: 21:20
++ // + 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:27:15: 27:16
++ 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.mk_cycle.Inline.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff
index 7653a5ded..925c95988 100644
--- a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff
+++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff
@@ -11,7 +11,7 @@
_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:21:7: 21:20
+ // + 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>) }
}
diff --git a/tests/mir-opt/inline/dyn_trait.rs b/tests/mir-opt/inline/dyn_trait.rs
index 6a46e1e07..2af81f825 100644
--- a/tests/mir-opt/inline/dyn_trait.rs
+++ b/tests/mir-opt/inline/dyn_trait.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
#![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
index 3fa9c3e88..f4e5272ab 100644
--- a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
+++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
@@ -6,8 +6,8 @@
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:27:5: 27:16
-+ debug c => _2; // in scope 1 at $DIR/dyn_trait.rs:20:27: 20:28
++ 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: {
@@ -17,11 +17,11 @@
_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:21:5: 21:22
++ _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:27:5: 27:13
+- // + 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:21:7: 21:20
++ // + 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>) }
}
diff --git a/tests/mir-opt/inline/exponential_runtime.main.Inline.diff b/tests/mir-opt/inline/exponential_runtime.main.Inline.diff
index 7fd62be7a..30af8661d 100644
--- a/tests/mir-opt/inline/exponential_runtime.main.Inline.diff
+++ b/tests/mir-opt/inline/exponential_runtime.main.Inline.diff
@@ -4,72 +4,72 @@
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:86:5: 86:22
-+ let _2: (); // in scope 1 at $DIR/exponential_runtime.rs:73:9: 73:25
-+ let _3: (); // in scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ let _4: (); // in scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25
-+ scope 2 (inlined <() as F>::call) { // at $DIR/exponential_runtime.rs:73:9: 73:25
-+ let _5: (); // in scope 2 at $DIR/exponential_runtime.rs:61:9: 61:25
-+ let _6: (); // in scope 2 at $DIR/exponential_runtime.rs:62:9: 62:25
-+ let _7: (); // in scope 2 at $DIR/exponential_runtime.rs:63:9: 63:25
++ 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 1 at $DIR/exponential_runtime.rs:73:9: 73:25
-+ StorageLive(_5); // scope 2 at $DIR/exponential_runtime.rs:61:9: 61:25
-+ _5 = <() as E>::call() -> bb3; // scope 2 at $DIR/exponential_runtime.rs:61:9: 61:25
++ 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:86:5: 86:20
+- // + span: $DIR/exponential_runtime.rs:87:5: 87:20
- // + literal: Const { ty: fn() {<() as G>::call}, val: Value(<ZST>) }
-+ // + span: $DIR/exponential_runtime.rs:61:9: 61:23
++ // + span: $DIR/exponential_runtime.rs:62:9: 62:23
+ // + literal: Const { ty: fn() {<() as E>::call}, val: Value(<ZST>) }
}
bb1: {
-+ StorageDead(_3); // scope 1 at $DIR/exponential_runtime.rs:74:25: 74:26
-+ StorageLive(_4); // scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25
-+ _4 = <() as F>::call() -> bb2; // 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>) }
-+ }
-+
-+ bb2: {
-+ StorageDead(_4); // scope 1 at $DIR/exponential_runtime.rs:75:25: 75:26
++ 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: {
-+ StorageDead(_5); // scope 2 at $DIR/exponential_runtime.rs:61:25: 61:26
-+ StorageLive(_6); // scope 2 at $DIR/exponential_runtime.rs:62:9: 62:25
-+ _6 = <() as E>::call() -> bb4; // scope 2 at $DIR/exponential_runtime.rs:62:9: 62:25
++ _4 = <() as F>::call() -> bb1; // scope 1 at $DIR/exponential_runtime.rs:76:9: 76:25
+ // mir::Constant
-+ // + span: $DIR/exponential_runtime.rs:62:9: 62:23
-+ // + literal: Const { ty: fn() {<() as E>::call}, val: Value(<ZST>) }
++ // + span: $DIR/exponential_runtime.rs:76:9: 76:23
++ // + literal: Const { ty: fn() {<() as F>::call}, val: Value(<ZST>) }
+ }
+
+ bb4: {
-+ StorageDead(_6); // scope 2 at $DIR/exponential_runtime.rs:62:25: 62:26
-+ StorageLive(_7); // scope 2 at $DIR/exponential_runtime.rs:63:9: 63:25
-+ _7 = <() as E>::call() -> bb5; // scope 2 at $DIR/exponential_runtime.rs:63:9: 63:25
++ _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: {
-+ StorageDead(_7); // scope 2 at $DIR/exponential_runtime.rs:63:25: 63:26
-+ StorageDead(_2); // scope 1 at $DIR/exponential_runtime.rs:73:25: 73:26
-+ StorageLive(_3); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
-+ _3 = <() as F>::call() -> bb1; // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25
++ _7 = <() as E>::call() -> bb2; // scope 2 at $DIR/exponential_runtime.rs:64:9: 64:25
+ // mir::Constant
-+ // + span: $DIR/exponential_runtime.rs:74:9: 74:23
-+ // + literal: Const { ty: fn() {<() as F>::call}, val: Value(<ZST>) }
++ // + 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.rs b/tests/mir-opt/inline/exponential_runtime.rs
index d9219d76a..39985528f 100644
--- a/tests/mir-opt/inline/exponential_runtime.rs
+++ b/tests/mir-opt/inline/exponential_runtime.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// Checks that code with exponential runtime does not have exponential behavior in inlining.
trait A {
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 fff8d0171..1d2f99cbe 100644
--- a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir
@@ -23,7 +23,7 @@ fn foo(_1: T, _2: i32) -> i32 {
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[92ba]::foo::{closure#0})
+ // + def_id: DefId(0:6 ~ inline_closure[8f32]::foo::{closure#0})
// + substs: [
// T,
// i8,
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 dab204306..80274bb7e 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
@@ -26,7 +26,7 @@ fn foo(_1: T, _2: &i32) -> i32 {
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[96e9]::foo::{closure#0})
+ // + def_id: DefId(0:6 ~ inline_closure_borrows_arg[f89f]::foo::{closure#0})
// + substs: [
// T,
// i8,
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 84fd051e0..b36711f82 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
@@ -32,7 +32,7 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
_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[8bc0]::foo::{closure#0})
+ // + def_id: DefId(0:6 ~ inline_closure_captures[63a5]::foo::{closure#0})
// + substs: [
// T,
// i8,
diff --git a/tests/mir-opt/inline/inline_cycle.one.Inline.diff b/tests/mir-opt/inline/inline_cycle.one.Inline.diff
index 5510cd7bc..f6ba69a1d 100644
--- a/tests/mir-opt/inline/inline_cycle.one.Inline.diff
+++ b/tests/mir-opt/inline/inline_cycle.one.Inline.diff
@@ -4,9 +4,9 @@
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:14:5: 14:24
-+ scope 2 (inlined <A<C> as Call>::call) { // at $DIR/inline_cycle.rs:43:9: 43:23
-+ scope 3 (inlined <B<C> as Call>::call) { // at $DIR/inline_cycle.rs:28:9: 28:31
++ 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
+ }
+ }
+ }
@@ -14,10 +14,10 @@
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:36:9: 36:28
++ _1 = <C as Call>::call() -> bb1; // scope 3 at $DIR/inline_cycle.rs:37:9: 37:28
// mir::Constant
-- // + span: $DIR/inline_cycle.rs:14:5: 14:22
-+ // + span: $DIR/inline_cycle.rs:36:9: 36:26
+- // + 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>) }
}
diff --git a/tests/mir-opt/inline/inline_cycle.rs b/tests/mir-opt/inline/inline_cycle.rs
index 63ad57de1..2f81696cf 100644
--- a/tests/mir-opt/inline/inline_cycle.rs
+++ b/tests/mir-opt/inline/inline_cycle.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 64c0065b5..c8f58111d 100644
--- a/tests/mir-opt/inline/inline_cycle.two.Inline.diff
+++ b/tests/mir-opt/inline/inline_cycle.two.Inline.diff
@@ -5,11 +5,11 @@
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
-+ scope 1 (inlined call::<fn() {f}>) { // at $DIR/inline_cycle.rs:49:5: 49:12
-+ debug f => _2; // in scope 1 at $DIR/inline_cycle.rs:53:22: 53:23
-+ let _3: (); // in scope 1 at $DIR/inline_cycle.rs:54:5: 54:8
-+ let mut _4: (); // in scope 1 at $DIR/inline_cycle.rs:54:5: 54:8
-+ scope 2 (inlined <fn() {f} as FnOnce<()>>::call_once - shim(fn() {f})) { // at $DIR/inline_cycle.rs:54:5: 54:8
++ 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
+ }
+ }
@@ -19,19 +19,20 @@
+ 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:49:5: 49:9
+- // + 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:49:10: 49:11
+ // + span: $DIR/inline_cycle.rs:50:10: 50:11
// + literal: Const { ty: fn() {f}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/inline_cycle.rs:54:5: 54:8
-+ StorageLive(_4); // scope 1 at $DIR/inline_cycle.rs:54:5: 54:8
++ 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:54:7: 54:8
-+ StorageDead(_3); // scope 1 at $DIR/inline_cycle.rs:54:8: 54:9
++ 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
diff --git a/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff
index 52debab4d..9429ca593 100644
--- a/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff
+++ b/tests/mir-opt/inline/inline_cycle_generic.main.Inline.diff
@@ -4,23 +4,20 @@
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:9:5: 9:24
-+ scope 2 (inlined <B<A> as Call>::call) { // at $DIR/inline_cycle_generic.rs:38:9: 38:31
-+ scope 3 (inlined <A as Call>::call) { // at $DIR/inline_cycle_generic.rs:31:9: 31:28
-+ scope 4 (inlined <B<C> as Call>::call) { // at $DIR/inline_cycle_generic.rs:23:9: 23:31
-+ }
-+ }
++ 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 = <C as Call>::call() -> bb1; // scope 4 at $DIR/inline_cycle_generic.rs:31:9: 31:28
++ _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:9:5: 9:22
-+ // + span: $DIR/inline_cycle_generic.rs:31:9: 31:26
- // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(<ZST>) }
+- // + 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: {
diff --git a/tests/mir-opt/inline/inline_cycle_generic.rs b/tests/mir-opt/inline/inline_cycle_generic.rs
index 24b4f3793..84e6e4005 100644
--- a/tests/mir-opt/inline/inline_cycle_generic.rs
+++ b/tests/mir-opt/inline/inline_cycle_generic.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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.g.Inline.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.diff
index b787a19f4..4f22ad437 100644
--- a/tests/mir-opt/inline/inline_diverging.g.Inline.diff
+++ b/tests/mir-opt/inline/inline_diverging.g.Inline.diff
@@ -34,7 +34,7 @@
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 1 at $SRC_DIR/std/src/panic.rs:LL:COL
++ 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
diff --git a/tests/mir-opt/inline/inline_diverging.h.Inline.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.diff
index e1b2f7dbf..d501b6ca8 100644
--- a/tests/mir-opt/inline/inline_diverging.h.Inline.diff
+++ b/tests/mir-opt/inline/inline_diverging.h.Inline.diff
@@ -5,19 +5,18 @@
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: (); // in scope 1 at $DIR/inline_diverging.rs:27:13: 27:16
-+ let mut _6: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline_diverging.rs:28:13: 28:14
-+ let mut _7: (); // in scope 1 at $DIR/inline_diverging.rs:28:13: 28:16
-+ let mut _8: !; // in scope 1 at $DIR/inline_diverging.rs:29:6: 29:7
-+ let mut _9: !; // in scope 1 at $DIR/inline_diverging.rs:29:9: 29:10
++ 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 => _9; // in scope 3 at $DIR/inline_diverging.rs:28:9: 28:10
++ 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
@@ -35,21 +34,21 @@
- // mir::Constant
// + span: $DIR/inline_diverging.rs:22:16: 22:21
// + literal: Const { ty: fn() -> ! {sleep}, val: Value(<ZST>) }
-+ StorageLive(_9); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22
++ 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(_5); // scope 1 at $DIR/inline_diverging.rs:27:13: 27:16
++ 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(_7); // scope 2 at $DIR/inline_diverging.rs:28:15: 28:16
-+ StorageDead(_6); // scope 2 at $DIR/inline_diverging.rs:28:15: 28:16
-+ StorageLive(_8); // scope 3 at $DIR/inline_diverging.rs:29:6: 29:7
-+ _8 = move _3; // scope 3 at $DIR/inline_diverging.rs:29:6: 29:7
-+ _1 = (move _8, move _9); // scope 3 at $DIR/inline_diverging.rs:29:5: 29:11
-+ StorageDead(_8); // scope 3 at $DIR/inline_diverging.rs:29:10: 29:11
++ 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
+ }
@@ -59,11 +58,11 @@
+ }
+
+ bb3 (cleanup): {
-+ drop(_3) -> bb4; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2
++ drop(_3) -> [return: bb4, unwind terminate]; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2
+ }
+
+ bb4 (cleanup): {
-+ drop(_2) -> bb5; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2
++ drop(_2) -> [return: bb5, unwind terminate]; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2
+ }
+
+ bb5 (cleanup): {
@@ -71,12 +70,11 @@
+ }
+
+ bb6: {
-+ StorageDead(_5); // scope 1 at $DIR/inline_diverging.rs:27:15: 27:16
++ 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(_6); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14
-+ _6 = &_2; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14
-+ StorageLive(_7); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:16
-+ _9 = <fn() -> ! {sleep} as Fn<()>>::call(move _6, move _7) -> [return: bb1, unwind: bb3]; // scope 2 at $DIR/inline_diverging.rs:28:13: 28: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_generator.main.Inline.diff b/tests/mir-opt/inline/inline_generator.main.Inline.diff
index 01f5052b6..c3ca2d7d4 100644
--- a/tests/mir-opt/inline/inline_generator.main.Inline.diff
+++ b/tests/mir-opt/inline/inline_generator.main.Inline.diff
@@ -44,7 +44,7 @@
- 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[ea31]::g::{closure#0})
++ // + def_id: DefId(0:7 ~ inline_generator[e37e]::g::{closure#0})
+ // + substs: [
+ // bool,
+ // i32,
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 f1988ea4b..a1d2423ae 100644
--- a/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff
+++ b/tests/mir-opt/inline/inline_instruction_set.default.Inline.diff
@@ -16,7 +16,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline_instruction_set.rs:+1:5: +1:26
- _1 = instruction_set_a32() -> bb1; // 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>) }
@@ -25,7 +25,7 @@
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() -> bb2; // 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>) }
@@ -34,7 +34,7 @@
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() -> bb3; // 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>) }
@@ -43,11 +43,11 @@
- 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() -> bb4; // 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))) -> bb3; // scope 3 at $DIR/inline_instruction_set.rs:43:14: 43:38
++ asm!("/* do nothing */", options((empty))) -> [return: bb3, unwind unreachable]; // scope 3 at $DIR/inline_instruction_set.rs:43:14: 43:38
}
- bb4: {
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 e777b2cc2..36aec4f47 100644
--- a/tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff
+++ b/tests/mir-opt/inline/inline_instruction_set.t32.Inline.diff
@@ -14,7 +14,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline_instruction_set.rs:+1:5: +1:26
- _1 = instruction_set_a32() -> bb1; // 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>) }
@@ -23,7 +23,7 @@
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() -> bb2; // 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>) }
@@ -32,7 +32,7 @@
- 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() -> bb3; // 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>) }
@@ -41,8 +41,8 @@
- 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() -> bb4; // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41
-+ _4 = inline_always_and_using_inline_asm() -> bb2; // 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>) }
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
index a1cbf0d3e..a5129e0e8 100644
--- a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff
+++ b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff
@@ -4,81 +4,78 @@
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: usize; // in scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- let mut _3: usize; // in scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- let mut _4: *mut u8; // in scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- let mut _6: (); // in scope 0 at $DIR/inline_into_box_place.rs:+1:42: +1:43
- let mut _7: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43
-+ let mut _8: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
-+ let mut _9: std::vec::Vec<u32>; // in scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
+ 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 {
- }
-+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline_into_box_place.rs:8:33: 8:43
-+ let mut _10: alloc::raw_vec::RawVec<u32>; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ 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
- _2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- _3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline_into_box_place.rs:+1:29: +1:43
+ 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:29: 8:43
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+- // + 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: {
- StorageLive(_5); // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- _5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- _7 = (((_5.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
-- (*_7) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
-+ StorageLive(_8); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
-+ _8 = &mut (*_7); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
-+ StorageLive(_9); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
-+ StorageLive(_10); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ _10 = const _; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
- // mir::Constant
-- // + span: $DIR/inline_into_box_place.rs:8:33: 8:41
+- _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> {Vec::<u32>::new}, val: Value(<ZST>) }
-- }
--
+- // + 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: {
-+ // + 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) }
-+ _9 = Vec::<u32> { buf: move _10, len: const 0_usize }; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ StorageDead(_10); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ (*_8) = move _9; // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
-+ StorageDead(_9); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
-+ StorageDead(_8); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43
- _1 = move _5; // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43
- StorageDead(_5); // scope 0 at $DIR/inline_into_box_place.rs:+1:42: +1:43
- _0 = const (); // scope 0 at $DIR/inline_into_box_place.rs:+0:11: +2:2
+- 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
-+ drop(_1) -> [return: bb2, unwind: bb3]; // 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: {
-+ bb2: {
- 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
+ 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): {
-+ bb3 (cleanup): {
- resume; // scope 0 at $DIR/inline_into_box_place.rs:+0:1: +2:2
-- }
--
-- bb5 (cleanup): {
-- _6 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4; // scope 0 at $DIR/inline_into_box_place.rs:+1:42: +1:43
-- // mir::Constant
-- // + span: $DIR/inline_into_box_place.rs:8:42: 8:43
-- // + literal: Const { ty: unsafe fn(Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>}, val: Value(<ZST>) }
+ 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.rs b/tests/mir-opt/inline/inline_into_box_place.rs
index 232bcc7b2..02823e4e1 100644
--- a/tests/mir-opt/inline/inline_into_box_place.rs
+++ b/tests/mir-opt/inline/inline_into_box_place.rs
@@ -1,9 +1,9 @@
// ignore-endian-big
// ignore-wasm32-bare compiled with panic=abort by default
+// ignore-debug MIR alignment checks in std alter the diff, breaking the test
// compile-flags: -Z mir-opt-level=4
-#![feature(box_syntax)]
// EMIT_MIR inline_into_box_place.main.Inline.diff
fn main() {
- let _x: Box<Vec<u32>> = box Vec::new();
+ let _x: Box<Vec<u32>> = Box::new(Vec::new());
}
diff --git a/tests/mir-opt/inline/inline_options.main.Inline.after.mir b/tests/mir-opt/inline/inline_options.main.Inline.after.mir
index 1c590be94..a2938ead0 100644
--- a/tests/mir-opt/inline/inline_options.main.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_options.main.Inline.after.mir
@@ -4,52 +4,52 @@ 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:10:5: 10:21
- let _3: (); // in scope 1 at $DIR/inline_options.rs:16:23: 16:26
- let _4: (); // in scope 1 at $DIR/inline_options.rs:16:28: 16:31
- let _5: (); // in scope 1 at $DIR/inline_options.rs:16:33: 16:36
+ 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:9:5: 9:16
+ // + 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 1 at $DIR/inline_options.rs:16:23: 16:26
- _3 = g() -> bb2; // scope 1 at $DIR/inline_options.rs:16:23: 16:26
+ 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:16:23: 16:24
+ // + span: $DIR/inline_options.rs:17:23: 17:24
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
}
bb2: {
- StorageDead(_3); // scope 1 at $DIR/inline_options.rs:16:26: 16:27
- StorageLive(_4); // scope 1 at $DIR/inline_options.rs:16:28: 16:31
- _4 = g() -> bb3; // scope 1 at $DIR/inline_options.rs:16:28: 16:31
- // mir::Constant
- // + span: $DIR/inline_options.rs:16:28: 16:29
- // + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
+ 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: {
- StorageDead(_4); // scope 1 at $DIR/inline_options.rs:16:31: 16:32
- StorageLive(_5); // scope 1 at $DIR/inline_options.rs:16:33: 16:36
- _5 = g() -> bb4; // scope 1 at $DIR/inline_options.rs:16:33: 16:36
+ _4 = g() -> bb4; // scope 1 at $DIR/inline_options.rs:17:28: 17:31
// mir::Constant
- // + span: $DIR/inline_options.rs:16:33: 16:34
+ // + span: $DIR/inline_options.rs:17:28: 17:29
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
}
bb4: {
- StorageDead(_5); // scope 1 at $DIR/inline_options.rs:16:36: 16:37
- 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
+ _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.rs b/tests/mir-opt/inline/inline_options.rs
index 477f050b6..f0a898832 100644
--- a/tests/mir-opt/inline/inline_options.rs
+++ b/tests/mir-opt/inline/inline_options.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// Checks that inlining threshold can be controlled with
// inline-mir-threshold and inline-hint-threshold options.
//
diff --git a/tests/mir-opt/inline/inline_specialization.main.Inline.diff b/tests/mir-opt/inline/inline_specialization.main.Inline.diff
index af08296ed..9dde9994d 100644
--- a/tests/mir-opt/inline/inline_specialization.main.Inline.diff
+++ b/tests/mir-opt/inline/inline_specialization.main.Inline.diff
@@ -7,19 +7,19 @@
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:5:13: 5:38
++ 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:5:13: 5:36
+- // + 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:14:31: 14:34
++ _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.rs b/tests/mir-opt/inline/inline_specialization.rs
index 87275b4e5..c24795e05 100644
--- a/tests/mir-opt/inline/inline_specialization.rs
+++ b/tests/mir-opt/inline/inline_specialization.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
#![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 74be53f55..6aa957eb5 100644
--- a/tests/mir-opt/inline/inline_trait_method.rs
+++ b/tests/mir-opt/inline/inline_trait_method.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 637bf282a..a9020a5bb 100644
--- a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.mir
@@ -10,7 +10,7 @@ fn test(_1: &dyn X) -> u32 {
_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:9:7: 9:8
+ // + 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>) }
}
diff --git a/tests/mir-opt/inline/inline_trait_method_2.rs b/tests/mir-opt/inline/inline_trait_method_2.rs
index 378e71a25..07a601908 100644
--- a/tests/mir-opt/inline/inline_trait_method_2.rs
+++ b/tests/mir-opt/inline/inline_trait_method_2.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index b7c5bbecb..a4bbecf3b 100644
--- 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
@@ -5,8 +5,8 @@ fn test2(_1: &dyn X) -> bool {
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:5:5: 5:12
- debug x => _2; // in scope 1 at $DIR/inline_trait_method_2.rs:9:9: 9:10
+ 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: {
@@ -15,9 +15,9 @@ fn test2(_1: &dyn X) -> bool {
_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:10:5: 10:10
+ _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:10:7: 10:8
+ // + 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>) }
}
diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.diff
index 97361fa5f..18df6f9af 100644
--- a/tests/mir-opt/inline/issue_106141.outer.Inline.diff
+++ b/tests/mir-opt/inline/issue_106141.outer.Inline.diff
@@ -3,14 +3,14 @@
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:2:5: 2:12
-+ let mut _1: bool; // in scope 1 at $DIR/issue_106141.rs:13:8: 13:21
-+ let mut _2: bool; // in scope 1 at $DIR/issue_106141.rs:13:8: 13:21
-+ let mut _3: &[bool; 1]; // in scope 1 at $DIR/issue_106141.rs:11:18: 11:25
++ 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 => _3; // in scope 2 at $DIR/issue_106141.rs:11:9: 11:15
++ debug buffer => _3; // 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:12:9: 12:14
++ debug index => _0; // in scope 3 at $DIR/issue_106141.rs:13:9: 13:14
+ }
+ }
+ }
@@ -18,36 +18,36 @@
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:11:18: 11:25
++ _3 = const _; // scope 1 at $DIR/issue_106141.rs:12:18: 12:25
// mir::Constant
-- // + span: $DIR/issue_106141.rs:2:5: 2:10
+- // + span: $DIR/issue_106141.rs:3:5: 3:10
- // + literal: Const { ty: fn() -> usize {inner}, val: Value(<ZST>) }
-+ // + span: $DIR/issue_106141.rs:11:18: 11:25
++ // + 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:12:17: 12:24
++ _0 = index() -> bb1; // scope 2 at $DIR/issue_106141.rs:13:17: 13:24
+ // mir::Constant
-+ // + span: $DIR/issue_106141.rs:12:17: 12:22
++ // + 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:13:8: 13:21
-+ _2 = Lt(_0, const 1_usize); // scope 3 at $DIR/issue_106141.rs:13:8: 13: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:13:8: 13:21
++ 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:13:8: 13:21
-+ switchInt(move _1) -> [0: bb3, otherwise: bb4]; // scope 3 at $DIR/issue_106141.rs:13:8: 13:21
++ _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:16:9: 16:10
-+ goto -> bb4; // scope 3 at $DIR/issue_106141.rs:13:5: 17:6
++ _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:17:5: 17:6
++ 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.rs b/tests/mir-opt/inline/issue_106141.rs
index c8288b7f3..b6bd806e6 100644
--- a/tests/mir-opt/inline/issue_106141.rs
+++ b/tests/mir-opt/inline/issue_106141.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
pub fn outer() -> usize {
inner()
}
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 4dd1aad48..1da3c8bb7 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
@@ -10,10 +10,9 @@ fn main() -> () {
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 => _5; // in scope 2 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:14: +1:15
- let _6: (); // in scope 2 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:23: +1:24
+ debug x => const (); // in scope 2 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:14: +1:15
scope 3 {
- debug y => _6; // in scope 3 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:23: +1:24
+ debug y => const (); // in scope 3 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:23: +1:24
}
}
}
@@ -22,7 +21,7 @@ fn main() -> () {
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[bc59]::main::{closure#0})
+ // + def_id: DefId(0:4 ~ issue_76997_inline_scopes_parenting[5cd2]::main::{closure#0})
// + substs: [
// i8,
// extern "rust-call" fn(((),)),
@@ -36,8 +35,6 @@ fn main() -> () {
_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
- StorageLive(_6); // scope 2 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:23: +1:24
- StorageDead(_6); // scope 2 at $DIR/issue_76997_inline_scopes_parenting.rs:+1:32: +1:33
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
diff --git a/tests/mir-opt/inline/issue_78442.bar.Inline.diff b/tests/mir-opt/inline/issue_78442.bar.Inline.diff
index aa62e4a16..dc3fe7555 100644
--- a/tests/mir-opt/inline/issue_78442.bar.Inline.diff
+++ b/tests/mir-opt/inline/issue_78442.bar.Inline.diff
@@ -46,11 +46,11 @@
- bb3: {
- return; // scope 0 at $DIR/issue_78442.rs:+5:2: +5:2
+ bb3 (cleanup): {
-+ drop(_1) -> bb4; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
++ drop(_1) -> [return: bb4, unwind terminate]; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
}
bb4 (cleanup): {
-- drop(_1) -> bb5; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
+- 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
}
diff --git a/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff b/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff
index 21055c6bf..8f56ef258 100644
--- a/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff
+++ b/tests/mir-opt/inline/issue_78442.bar.RevealAll.diff
@@ -47,7 +47,7 @@
}
bb4 (cleanup): {
- drop(_1) -> bb5; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
+ drop(_1) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2
}
bb5 (cleanup): {
diff --git a/tests/mir-opt/inline/unchecked_shifts.rs b/tests/mir-opt/inline/unchecked_shifts.rs
new file mode 100644
index 000000000..17724530d
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.rs
@@ -0,0 +1,18 @@
+// ignore-wasm32 compiled with panic=abort by default
+#![crate_type = "lib"]
+#![feature(unchecked_math)]
+
+// ignore-debug: the debug assertions prevent the inlining we are testing for
+// compile-flags: -Zmir-opt-level=2 -Zinline-mir
+
+// EMIT_MIR unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff
+// EMIT_MIR unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
+pub unsafe fn unchecked_shl_unsigned_smaller(a: u16, b: u32) -> u16 {
+ a.unchecked_shl(b)
+}
+
+// EMIT_MIR unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff
+// EMIT_MIR unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir
+pub unsafe fn unchecked_shr_signed_smaller(a: i16, b: u32) -> i16 {
+ a.unchecked_shr(b)
+}
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
new file mode 100644
index 000000000..6184a0acd
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff
@@ -0,0 +1,144 @@
+- // 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/uint_macros.rs:LL:COL
++ let mut _6: std::option::Option<u16>; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ let mut _7: std::result::Result<u16, std::num::TryFromIntError>; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ scope 2 {
++ scope 3 (inlined <u32 as TryInto<u16>>::try_into) { // at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ debug self => _4; // in scope 3 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
++ scope 4 (inlined convert::num::<impl TryFrom<u32> for u16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
++ debug u => _4; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ let mut _8: bool; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ let mut _9: u32; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ let mut _10: u16; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ }
++ }
++ scope 5 (inlined Result::<u16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ debug self => _7; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ let mut _11: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ let _12: u16; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ scope 6 {
++ debug x => _12; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++ scope 7 {
++ scope 8 {
++ debug x => const TryFromIntError(()); // 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/uint_macros.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 => _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 => _13; // 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/uint_macros.rs:LL:COL
++ StorageLive(_6); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ StorageLive(_7); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ StorageLive(_8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ StorageLive(_9); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _9 = const 65535_u32; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _8 = Gt(_4, move _9); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ StorageDead(_9); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ switchInt(move _8) -> [0: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+
+ bb1: {
++ StorageDead(_12); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ StorageDead(_7); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ StorageLive(_13); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ _14 = discriminant(_6); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
++ switchInt(move _14) -> [1: bb9, otherwise: bb7]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
++ }
++
++ bb2: {
++ 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
++ }
++
++ bb3: {
++ _7 = Result::<u16, TryFromIntError>::Err(const TryFromIntError(())); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ // mir::Constant
++ // + span: no-location
++ // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
++ goto -> bb5; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ }
++
++ bb4: {
++ StorageLive(_10); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _10 = _4 as u16 (IntToInt); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _7 = Result::<u16, TryFromIntError>::Ok(move _10); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ StorageDead(_10); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ goto -> bb5; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ }
++
++ bb5: {
++ StorageDead(_8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ StorageLive(_12); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ _11 = discriminant(_7); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ switchInt(move _11) -> [0: bb8, 1: bb6, otherwise: bb7]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++
++ bb6: {
++ _6 = Option::<u16>::None; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
++ goto -> bb1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++
++ bb7: {
++ unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++
++ bb8: {
++ _12 = move ((_7 as Ok).0: u16); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ _6 = Option::<u16>::Some(move _12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
++ goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++
++ bb9: {
++ _5 = move ((_6 as Some).0: u16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
++ StorageDead(_13); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
++ _0 = unchecked_shl::<u16>(_3, move _5) -> [return: bb2, 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.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
new file mode 100644
index 000000000..726b6bbf9
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
@@ -0,0 +1,130 @@
+// 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/uint_macros.rs:LL:COL
+ let mut _4: std::option::Option<u16>; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ let mut _5: std::result::Result<u16, std::num::TryFromIntError>; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ scope 2 {
+ scope 3 (inlined <u32 as TryInto<u16>>::try_into) { // at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ debug self => _2; // in scope 3 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ scope 4 (inlined convert::num::<impl TryFrom<u32> for u16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ debug u => _2; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ let mut _6: bool; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ let mut _7: u32; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ let mut _8: u16; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+ }
+ scope 5 (inlined Result::<u16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ debug self => _5; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ let mut _9: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ let _10: u16; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ scope 6 {
+ debug x => _10; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+ scope 7 {
+ scope 8 {
+ debug x => const TryFromIntError(()); // 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/uint_macros.rs:LL:COL
+ debug self => _4; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ let mut _11: &std::option::Option<u16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ let mut _12: 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 => _11; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageLive(_4); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageLive(_6); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ StorageLive(_7); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _7 = const 65535_u32; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _6 = Gt(_2, move _7); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ StorageDead(_7); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+
+ bb1: {
+ StorageDead(_10); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageLive(_11); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ _12 = discriminant(_4); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ switchInt(move _12) -> [1: bb9, otherwise: bb7]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ }
+
+ bb2: {
+ 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
+ }
+
+ bb3: {
+ _5 = Result::<u16, TryFromIntError>::Err(const TryFromIntError(())); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ // mir::Constant
+ // + span: no-location
+ // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
+ goto -> bb5; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+
+ bb4: {
+ StorageLive(_8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _8 = _2 as u16 (IntToInt); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _5 = Result::<u16, TryFromIntError>::Ok(move _8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ StorageDead(_8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ goto -> bb5; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+
+ bb5: {
+ StorageDead(_6); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ StorageLive(_10); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ _9 = discriminant(_5); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ switchInt(move _9) -> [0: bb8, 1: bb6, otherwise: bb7]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+
+ bb6: {
+ _4 = Option::<u16>::None; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+ goto -> bb1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+
+ bb7: {
+ unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+
+ bb8: {
+ _10 = move ((_5 as Ok).0: u16); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ _4 = Option::<u16>::Some(move _10); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
+ goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+
+ bb9: {
+ _3 = move ((_4 as Some).0: u16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ StorageDead(_11); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageDead(_4); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ _0 = unchecked_shl::<u16>(_1, move _3) -> [return: bb2, 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_shr_signed_smaller.Inline.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff
new file mode 100644
index 000000000..35d5b6e72
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.diff
@@ -0,0 +1,144 @@
+- // 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/int_macros.rs:LL:COL
++ let mut _6: std::option::Option<i16>; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ let mut _7: std::result::Result<i16, std::num::TryFromIntError>; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ scope 2 {
++ scope 3 (inlined <u32 as TryInto<i16>>::try_into) { // at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ debug self => _4; // in scope 3 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
++ scope 4 (inlined convert::num::<impl TryFrom<u32> for i16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
++ debug u => _4; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ let mut _8: bool; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ let mut _9: u32; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ let mut _10: i16; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ }
++ }
++ scope 5 (inlined Result::<i16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ debug self => _7; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ let mut _11: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ let _12: i16; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ scope 6 {
++ debug x => _12; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++ scope 7 {
++ scope 8 {
++ debug x => const TryFromIntError(()); // 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/int_macros.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 => _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 => _13; // 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/int_macros.rs:LL:COL
++ StorageLive(_6); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ StorageLive(_7); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ StorageLive(_8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ StorageLive(_9); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _9 = const 32767_u32; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _8 = Gt(_4, move _9); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ StorageDead(_9); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ switchInt(move _8) -> [0: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+
+ bb1: {
++ StorageDead(_12); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ StorageDead(_7); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ StorageLive(_13); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ _14 = discriminant(_6); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
++ switchInt(move _14) -> [1: bb9, otherwise: bb7]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
++ }
++
++ bb2: {
++ 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
++ }
++
++ bb3: {
++ _7 = Result::<i16, TryFromIntError>::Err(const TryFromIntError(())); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ // mir::Constant
++ // + span: no-location
++ // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
++ goto -> bb5; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ }
++
++ bb4: {
++ StorageLive(_10); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _10 = _4 as i16 (IntToInt); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ _7 = Result::<i16, TryFromIntError>::Ok(move _10); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ StorageDead(_10); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ goto -> bb5; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ }
++
++ bb5: {
++ StorageDead(_8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
++ StorageLive(_12); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ _11 = discriminant(_7); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ switchInt(move _11) -> [0: bb8, 1: bb6, otherwise: bb7]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++
++ bb6: {
++ _6 = Option::<i16>::None; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
++ goto -> bb1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++
++ bb7: {
++ unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++
++ bb8: {
++ _12 = move ((_7 as Ok).0: i16); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ _6 = Option::<i16>::Some(move _12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
++ goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ }
++
++ bb9: {
++ _5 = move ((_6 as Some).0: i16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
++ StorageDead(_13); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ StorageDead(_6); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
++ _0 = unchecked_shr::<i16>(_3, move _5) -> [return: bb2, 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.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir
new file mode 100644
index 000000000..b006085b5
--- /dev/null
+++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.mir
@@ -0,0 +1,130 @@
+// 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/int_macros.rs:LL:COL
+ let mut _4: std::option::Option<i16>; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ let mut _5: std::result::Result<i16, std::num::TryFromIntError>; // in scope 1 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ scope 2 {
+ scope 3 (inlined <u32 as TryInto<i16>>::try_into) { // at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ debug self => _2; // in scope 3 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ scope 4 (inlined convert::num::<impl TryFrom<u32> for i16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ debug u => _2; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ let mut _6: bool; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ let mut _7: u32; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ let mut _8: i16; // in scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+ }
+ scope 5 (inlined Result::<i16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ debug self => _5; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ let mut _9: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ let _10: i16; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ scope 6 {
+ debug x => _10; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+ scope 7 {
+ scope 8 {
+ debug x => const TryFromIntError(()); // 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/int_macros.rs:LL:COL
+ debug self => _4; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ let mut _11: &std::option::Option<i16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ let mut _12: 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 => _11; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
+ }
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_3); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ StorageLive(_4); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ StorageLive(_6); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ StorageLive(_7); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _7 = const 32767_u32; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _6 = Gt(_2, move _7); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ StorageDead(_7); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ switchInt(move _6) -> [0: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+
+ bb1: {
+ StorageDead(_10); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ StorageLive(_11); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ _12 = discriminant(_4); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ switchInt(move _12) -> [1: bb9, otherwise: bb7]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ }
+
+ bb2: {
+ 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
+ }
+
+ bb3: {
+ _5 = Result::<i16, TryFromIntError>::Err(const TryFromIntError(())); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ // mir::Constant
+ // + span: no-location
+ // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
+ goto -> bb5; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+
+ bb4: {
+ StorageLive(_8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _8 = _2 as i16 (IntToInt); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ _5 = Result::<i16, TryFromIntError>::Ok(move _8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ StorageDead(_8); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ goto -> bb5; // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ }
+
+ bb5: {
+ StorageDead(_6); // scope 4 at $SRC_DIR/core/src/convert/num.rs:LL:COL
+ StorageLive(_10); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ _9 = discriminant(_5); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ switchInt(move _9) -> [0: bb8, 1: bb6, otherwise: bb7]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+
+ bb6: {
+ _4 = Option::<i16>::None; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+ goto -> bb1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+
+ bb7: {
+ unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+
+ bb8: {
+ _10 = move ((_5 as Ok).0: i16); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ _4 = Option::<i16>::Some(move _10); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
+ goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
+
+ bb9: {
+ _3 = move ((_4 as Some).0: i16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
+ StorageDead(_11); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ StorageDead(_4); // scope 2 at $SRC_DIR/core/src/num/int_macros.rs:LL:COL
+ _0 = unchecked_shr::<i16>(_1, move _3) -> [return: bb2, 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/unwrap_unchecked.rs b/tests/mir-opt/inline/unwrap_unchecked.rs
new file mode 100644
index 000000000..5856f1479
--- /dev/null
+++ b/tests/mir-opt/inline/unwrap_unchecked.rs
@@ -0,0 +1,11 @@
+#![crate_type = "lib"]
+
+// ignore-wasm32-bare compiled with panic=abort by default
+// ignore-debug: the debug assertions prevent the inlining we are testing for
+// compile-flags: -Zmir-opt-level=2 -Zinline-mir
+
+// EMIT_MIR unwrap_unchecked.unwrap_unchecked.Inline.diff
+// EMIT_MIR unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir
+pub unsafe fn unwrap_unchecked<T>(slf: Option<T>) -> T {
+ slf.unwrap_unchecked()
+}
diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff
new file mode 100644
index 000000000..543ddcfc4
--- /dev/null
+++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.diff
@@ -0,0 +1,55 @@
+- // 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) -> [0: bb1, 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.PreCodegen.after.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir
new file mode 100644
index 000000000..c5e2469fc
--- /dev/null
+++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir
@@ -0,0 +1,41 @@
+// 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/instcombine_duplicate_switch_targets.assert_zero.InstCombine.diff b/tests/mir-opt/instcombine_duplicate_switch_targets.assert_zero.InstCombine.diff
new file mode 100644
index 000000000..e04079453
--- /dev/null
+++ b/tests/mir-opt/instcombine_duplicate_switch_targets.assert_zero.InstCombine.diff
@@ -0,0 +1,21 @@
+- // MIR for `assert_zero` before InstCombine
++ // MIR for `assert_zero` after InstCombine
+
+ fn assert_zero(_1: u8) -> u8 {
+ let mut _0: u8; // return place in scope 0 at $DIR/instcombine_duplicate_switch_targets.rs:+0:37: +0:39
+
+ bb0: {
+- switchInt(_1) -> [0: bb2, 1: bb1, otherwise: bb1]; // scope 0 at $DIR/instcombine_duplicate_switch_targets.rs:+3:13: +7:14
++ switchInt(_1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/instcombine_duplicate_switch_targets.rs:+3:13: +7:14
+ }
+
+ bb1: {
+ unreachable; // scope 0 at $DIR/instcombine_duplicate_switch_targets.rs:+10:13: +10:26
+ }
+
+ bb2: {
+ _0 = _1; // scope 0 at $DIR/instcombine_duplicate_switch_targets.rs:+13:13: +13:20
+ return; // scope 0 at $DIR/instcombine_duplicate_switch_targets.rs:+14:13: +14:21
+ }
+ }
+
diff --git a/tests/mir-opt/instcombine_duplicate_switch_targets.rs b/tests/mir-opt/instcombine_duplicate_switch_targets.rs
new file mode 100644
index 000000000..ef3b487af
--- /dev/null
+++ b/tests/mir-opt/instcombine_duplicate_switch_targets.rs
@@ -0,0 +1,27 @@
+#![feature(custom_mir, core_intrinsics)]
+#![crate_type = "lib"]
+
+use std::intrinsics::mir::*;
+
+// unit-test: InstCombine
+
+// EMIT_MIR instcombine_duplicate_switch_targets.assert_zero.InstCombine.diff
+#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
+pub unsafe fn assert_zero(x: u8) -> u8 {
+ mir!(
+ {
+ match x {
+ 0 => retblock,
+ 1 => unreachable,
+ _ => unreachable,
+ }
+ }
+ unreachable = {
+ Unreachable()
+ }
+ retblock = {
+ RET = x;
+ Return()
+ }
+ )
+}
diff --git a/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff b/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
index 2f6f5f87e..49006e012 100644
--- a/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
+++ b/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
@@ -14,7 +14,7 @@
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, cleanup: bb6]; // 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
}
bb2: {
diff --git a/tests/mir-opt/intrinsic_asserts.generic.InstCombine.diff b/tests/mir-opt/intrinsic_asserts.generic.InstCombine.diff
index 8ff64c1ea..09fc145e7 100644
--- a/tests/mir-opt/intrinsic_asserts.generic.InstCombine.diff
+++ b/tests/mir-opt/intrinsic_asserts.generic.InstCombine.diff
@@ -8,33 +8,33 @@
let _3: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:60
bb0: {
- StorageLive(_1); // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:46
- _1 = assert_inhabited::<T>() -> bb1; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:46
+ 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>) }
}
bb1: {
- StorageDead(_1); // scope 0 at $DIR/intrinsic_asserts.rs:+1:46: +1:47
- StorageLive(_2); // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:47
- _2 = assert_zero_valid::<T>() -> bb2; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:47
+ 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>) }
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/intrinsic_asserts.rs:+2:47: +2:48
- StorageLive(_3); // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:60
- _3 = assert_mem_uninitialized_valid::<T>() -> bb3; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:60
+ 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>) }
}
bb3: {
- StorageDead(_3); // scope 0 at $DIR/intrinsic_asserts.rs:+3:60: +3:61
+ 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
}
diff --git a/tests/mir-opt/intrinsic_asserts.panics.InstCombine.diff b/tests/mir-opt/intrinsic_asserts.panics.InstCombine.diff
index ddc015903..c52174ef5 100644
--- a/tests/mir-opt/intrinsic_asserts.panics.InstCombine.diff
+++ b/tests/mir-opt/intrinsic_asserts.panics.InstCombine.diff
@@ -8,19 +8,19 @@
let _3: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:62
bb0: {
- StorageLive(_1); // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:50
-- _1 = assert_inhabited::<Never>() -> bb1; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:50
-+ _1 = assert_inhabited::<Never>(); // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:50
+ 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>) }
}
bb1: {
- StorageDead(_1); // scope 0 at $DIR/intrinsic_asserts.rs:+1:50: +1:51
- StorageLive(_2); // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:49
-- _2 = assert_zero_valid::<&u8>() -> bb2; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:49
-+ _2 = assert_zero_valid::<&u8>(); // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:49
+ 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)
@@ -28,10 +28,10 @@
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/intrinsic_asserts.rs:+2:49: +2:50
- StorageLive(_3); // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:62
-- _3 = assert_mem_uninitialized_valid::<&u8>() -> bb3; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:62
-+ _3 = assert_mem_uninitialized_valid::<&u8>(); // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:62
+ 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)
@@ -39,7 +39,7 @@
}
bb3: {
- StorageDead(_3); // scope 0 at $DIR/intrinsic_asserts.rs:+3:62: +3:63
+ 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
}
diff --git a/tests/mir-opt/intrinsic_asserts.removable.InstCombine.diff b/tests/mir-opt/intrinsic_asserts.removable.InstCombine.diff
index 568fbf1a0..d059d47ee 100644
--- a/tests/mir-opt/intrinsic_asserts.removable.InstCombine.diff
+++ b/tests/mir-opt/intrinsic_asserts.removable.InstCombine.diff
@@ -8,8 +8,8 @@
let _3: (); // in scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:61
bb0: {
- StorageLive(_1); // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:47
-- _1 = assert_inhabited::<()>() -> bb1; // scope 0 at $DIR/intrinsic_asserts.rs:+1:5: +1:47
+ 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>) }
@@ -17,9 +17,9 @@
}
bb1: {
- StorageDead(_1); // scope 0 at $DIR/intrinsic_asserts.rs:+1:47: +1:48
- StorageLive(_2); // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:48
-- _2 = assert_zero_valid::<u8>() -> bb2; // scope 0 at $DIR/intrinsic_asserts.rs:+2:5: +2:48
+ 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>) }
@@ -27,9 +27,9 @@
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/intrinsic_asserts.rs:+2:48: +2:49
- StorageLive(_3); // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:61
-- _3 = assert_mem_uninitialized_valid::<u8>() -> bb3; // scope 0 at $DIR/intrinsic_asserts.rs:+3:5: +3:61
+ 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>) }
@@ -37,7 +37,7 @@
}
bb3: {
- StorageDead(_3); // scope 0 at $DIR/intrinsic_asserts.rs:+3:61: +3:62
+ 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
}
diff --git a/tests/mir-opt/issue_101973.inner.ConstProp.diff b/tests/mir-opt/issue_101973.inner.ConstProp.diff
index 6db8e4d26..d048b9e65 100644
--- a/tests/mir-opt/issue_101973.inner.ConstProp.diff
+++ b/tests/mir-opt/issue_101973.inner.ConstProp.diff
@@ -12,18 +12,19 @@
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, bool); // in scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
- let mut _11: (u32, bool); // in scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
- scope 1 (inlined imm8) { // at $DIR/issue_101973.rs:14:5: 14:17
- debug x => _1; // in scope 1 at $DIR/issue_101973.rs:5:13: 5:14
- let mut _12: u32; // in scope 1 at $DIR/issue_101973.rs:7:12: 7:27
- let mut _13: u32; // in scope 1 at $DIR/issue_101973.rs:7:12: 7:20
- let mut _14: (u32, bool); // in scope 1 at $DIR/issue_101973.rs:7:12: 7:20
+ 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:6:9: 6:16
+ 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:14:18: 14:58
+ 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
}
@@ -32,43 +33,46 @@
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(_12); // scope 2 at $DIR/issue_101973.rs:7:12: 7:27
- StorageLive(_13); // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
- _14 = CheckedShr(_1, const 0_i32); // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
- assert(!move (_14.1: bool), "attempt to shift right by `{}`, which would overflow", const 0_i32) -> bb3; // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
+ 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 = move (_10.0: u32); // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
+ _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
- _11 = CheckedShl(_7, const 1_i32); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
- assert(!move (_11.1: bool), "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_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 = move (_11.0: u32); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
+ _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) -> bb4; // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ _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: {
- _13 = move (_14.0: u32); // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
- _12 = BitAnd(move _13, const 255_u32); // scope 2 at $DIR/issue_101973.rs:7:12: 7:27
- StorageDead(_13); // scope 2 at $DIR/issue_101973.rs:7:26: 7:27
- _4 = BitOr(const 0_u32, move _12); // scope 2 at $DIR/issue_101973.rs:7:5: 7:27
- StorageDead(_12); // scope 2 at $DIR/issue_101973.rs:7:26: 7: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 = CheckedShr(_1, const 8_i32); // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
- assert(!move (_10.1: bool), "attempt to shift right by `{}`, which would overflow", const 8_i32) -> bb1; // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
- }
-
- bb4: {
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
diff --git a/tests/mir-opt/issue_101973.rs b/tests/mir-opt/issue_101973.rs
index 216659a23..da388f149 100644
--- a/tests/mir-opt/issue_101973.rs
+++ b/tests/mir-opt/issue_101973.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
new file mode 100644
index 000000000..f50c0eb47
--- /dev/null
+++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir
@@ -0,0 +1,25 @@
+// 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.rs b/tests/mir-opt/issue_104451_unwindable_intrinsics.rs
new file mode 100644
index 000000000..9babd4aae
--- /dev/null
+++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.rs
@@ -0,0 +1,14 @@
+// Check that `UnwindAction::Unreachable` is not generated for unwindable intrinsics.
+// ignore-wasm32 compiled with panic=abort by default
+#![feature(core_intrinsics)]
+
+// EMIT_MIR issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir
+fn main() {
+ unsafe {
+ core::intrinsics::const_eval_select((), ow_ct, ow_ct)
+ }
+}
+
+const fn ow_ct() -> ! {
+ panic!();
+}
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 b0d5b291b..ccaa508c1 100644
--- a/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir
@@ -19,7 +19,7 @@ fn main() -> () {
}
bb1: {
- falseUnwind -> [real: bb2, cleanup: bb5]; // scope 1 at $DIR/issue_38669.rs:+2:5: +7:6
+ falseUnwind -> [real: bb2, unwind: bb5]; // scope 1 at $DIR/issue_38669.rs:+2:5: +7:6
}
bb2: {
diff --git a/tests/mir-opt/issue_41110.main.ElaborateDrops.diff b/tests/mir-opt/issue_41110.main.ElaborateDrops.diff
index 7ac75b51a..ac2520249 100644
--- a/tests/mir-opt/issue_41110.main.ElaborateDrops.diff
+++ b/tests/mir-opt/issue_41110.main.ElaborateDrops.diff
@@ -46,17 +46,17 @@
}
bb3 (cleanup): {
-- drop(_3) -> bb5; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
+- 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) -> bb5; // scope 0 at $DIR/issue_41110.rs:+1:26: +1:27
+- 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) -> bb6; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
+- 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
}
@@ -65,7 +65,7 @@
+ }
+
+ bb7 (cleanup): {
-+ drop(_2) -> bb6; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
++ drop(_2) -> [return: bb6, unwind terminate]; // scope 0 at $DIR/issue_41110.rs:+1:27: +1:28
+ }
+
+ bb8 (cleanup): {
diff --git a/tests/mir-opt/issue_41110.test.ElaborateDrops.diff b/tests/mir-opt/issue_41110.test.ElaborateDrops.diff
index 79e3d073b..a4a07ad12 100644
--- a/tests/mir-opt/issue_41110.test.ElaborateDrops.diff
+++ b/tests/mir-opt/issue_41110.test.ElaborateDrops.diff
@@ -38,50 +38,52 @@
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
-- replace(_2 <- move _5) -> [return: bb2, unwind: bb6]; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
-+ goto -> bb12; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
+- 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: {
-- drop(_5) -> [return: bb3, unwind: bb8]; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
-+ goto -> bb3; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
+ _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
}
- bb3: {
+ 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: bb4, unwind: bb9]; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
+ drop(_2) -> [return: bb5, unwind: bb9]; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
}
- bb4: {
+ bb5: {
StorageDead(_2); // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
-- drop(_1) -> bb5; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
-+ goto -> bb5; // scope 0 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
}
- bb5: {
+ 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
}
- bb6 (cleanup): {
- drop(_5) -> bb8; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
- }
-
bb7 (cleanup): {
-- drop(_4) -> bb8; // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12
+- 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) -> bb9; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
+- 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) -> bb10; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
-+ goto -> bb14; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
+- 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): {
@@ -89,21 +91,15 @@
+ }
+
+ bb11 (cleanup): {
-+ _2 = move _5; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
-+ goto -> bb10; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
++ unreachable; // scope 0 at $DIR/issue_41110.rs:+0:1: +5:2
+ }
+
-+ bb12: {
-+ _2 = move _5; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
-+ goto -> bb2; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
++ bb12 (cleanup): {
++ drop(_1) -> [return: bb10, unwind terminate]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
+ }
+
+ bb13 (cleanup): {
-+ drop(_1) -> bb10; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
-+ }
-+
-+ bb14 (cleanup): {
-+ switchInt(_6) -> [0: bb10, otherwise: bb13]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
++ switchInt(_6) -> [0: bb10, otherwise: bb12]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
}
}
diff --git a/tests/mir-opt/issue_41888.main.ElaborateDrops.diff b/tests/mir-opt/issue_41888.main.ElaborateDrops.diff
index 257f0b1e6..d98f75e75 100644
--- a/tests/mir-opt/issue_41888.main.ElaborateDrops.diff
+++ b/tests/mir-opt/issue_41888.main.ElaborateDrops.diff
@@ -34,7 +34,7 @@
}
bb1: {
- switchInt(move _2) -> [0: bb7, otherwise: bb2]; // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14
+ switchInt(move _2) -> [0: bb8, otherwise: bb2]; // scope 1 at $DIR/issue_41888.rs:+2:8: +2:14
}
bb2: {
@@ -43,47 +43,56 @@
_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
-- replace(_1 <- move _3) -> [return: bb3, unwind: bb10]; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
-+ goto -> bb14; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
+- 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: {
-- drop(_3) -> [return: bb4, unwind: bb11]; // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
-+ goto -> bb4; // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
++ _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: {
+ 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: bb5, otherwise: bb6]; // 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
}
- bb5: {
+ 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 -> bb8; // scope 1 at $DIR/issue_41888.rs:+4:9: +7:10
+ goto -> bb9; // scope 1 at $DIR/issue_41888.rs:+4:9: +7:10
}
- bb6: {
+ bb7: {
_0 = const (); // scope 1 at $DIR/issue_41888.rs:+7:10: +7:10
- goto -> bb8; // scope 1 at $DIR/issue_41888.rs:+4:9: +7:10
+ goto -> bb9; // scope 1 at $DIR/issue_41888.rs:+4:9: +7:10
}
- bb7: {
+ bb8: {
_0 = const (); // scope 1 at $DIR/issue_41888.rs:+8:6: +8:6
- goto -> bb8; // scope 1 at $DIR/issue_41888.rs:+2:5: +8:6
+ goto -> bb9; // scope 1 at $DIR/issue_41888.rs:+2:5: +8:6
}
- bb8: {
+ bb9: {
StorageDead(_2); // scope 1 at $DIR/issue_41888.rs:+8:5: +8:6
-- drop(_1) -> bb9; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ goto -> bb20; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
+- 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
}
- bb9: {
+ 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
@@ -91,12 +100,8 @@
return; // scope 0 at $DIR/issue_41888.rs:+9:2: +9:2
}
- bb10 (cleanup): {
- drop(_3) -> bb11; // scope 1 at $DIR/issue_41888.rs:+3:19: +3:20
- }
-
bb11 (cleanup): {
-- drop(_1) -> bb12; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
+- 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
}
@@ -105,54 +110,42 @@
+ }
+
+ bb13 (cleanup): {
-+ _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
-+ goto -> bb12; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
++ unreachable; // scope 0 at $DIR/issue_41888.rs:+0:1: +9:2
+ }
+
+ bb14: {
-+ _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
-+ goto -> bb3; // scope 1 at $DIR/issue_41888.rs:+3:9: +3:10
-+ }
-+
-+ bb15: {
+ _7 = const false; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ goto -> bb9; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
++ goto -> bb10; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
+ }
+
-+ bb16 (cleanup): {
++ bb15 (cleanup): {
+ goto -> bb12; // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
+ }
+
-+ bb17: {
-+ drop(_1) -> [return: bb15, unwind: 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
+ }
+
-+ bb18 (cleanup): {
-+ drop(_1) -> 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
+ }
+
-+ bb19: {
++ bb18: {
+ _10 = discriminant(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ switchInt(move _10) -> [0: bb15, otherwise: bb17]; // 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
+ }
+
-+ bb20: {
-+ switchInt(_7) -> [0: bb15, otherwise: bb19]; // 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
+ }
+
-+ bb21 (cleanup): {
++ bb20 (cleanup): {
+ _11 = discriminant(_1); // scope 0 at $DIR/issue_41888.rs:+9:1: +9:2
-+ switchInt(move _11) -> [0: bb16, otherwise: bb18]; // 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
+ }
+
-+ bb22 (cleanup): {
-+ switchInt(_7) -> [0: bb12, otherwise: bb21]; // 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_62289.rs b/tests/mir-opt/issue_62289.rs
index 37e3390d5..af1bfea3f 100644
--- a/tests/mir-opt/issue_62289.rs
+++ b/tests/mir-opt/issue_62289.rs
@@ -2,11 +2,14 @@
// initializing it
// ignore-wasm32-bare compiled with panic=abort by default
-#![feature(box_syntax)]
+#![feature(rustc_attrs)]
// EMIT_MIR issue_62289.test.ElaborateDrops.before.mir
fn test() -> Option<Box<u32>> {
- Some(box (None?))
+ Some(
+ #[rustc_box]
+ Box::new(None?),
+ )
}
fn main() {
diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir
index adfa3a773..8ed910150 100644
--- a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir
+++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir
@@ -2,121 +2,121 @@
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:+1:10: +1:21
- let mut _2: usize; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
- let mut _3: usize; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
- let mut _4: *mut u8; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
- let mut _5: std::boxed::Box<u32>; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
- let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // in scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
- let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/issue_62289.rs:+1:15: +1:19
- let mut _8: isize; // in scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
- let _9: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
- let mut _10: !; // in scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
- let mut _11: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
- let _12: u32; // in scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
+ 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:+1:19: +1:20
+ 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:+1:15: +1:20
+ 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:+1:10: +1:21
- _2 = SizeOf(u32); // scope 1 at $DIR/issue_62289.rs:+1:10: +1:21
- _3 = AlignOf(u32); // scope 1 at $DIR/issue_62289.rs:+1:10: +1:21
- _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/issue_62289.rs:+1:10: +1:21
+ 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:9:10: 9:21
+ // + 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:+1:10: +1:21
- _5 = ShallowInitBox(move _4, u32); // scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
- StorageLive(_6); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
- StorageLive(_7); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:19
- _7 = Option::<u32>::None; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:19
- _6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12]; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
+ 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:9:15: 9:20
+ // + 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:+1:19: +1:20
- _8 = discriminant(_6); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
- switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4]; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
+ 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:+1:15: +1:20
- _12 = ((_6 as Continue).0: u32); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
- (*_5) = _12; // scope 5 at $DIR/issue_62289.rs:+1:15: +1:20
- StorageDead(_12); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
- _1 = move _5; // scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
- drop(_5) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/issue_62289.rs:+1:20: +1:21
+ 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:+1:15: +1:20
+ unreachable; // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
}
bb5: {
- StorageLive(_9); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
- _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
- StorageLive(_11); // scope 3 at $DIR/issue_62289.rs:+1:19: +1:20
- _11 = _9; // scope 3 at $DIR/issue_62289.rs:+1:19: +1:20
- _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; // scope 3 at $DIR/issue_62289.rs:+1:15: +1:20
+ 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:9:19: 9:20
+ // + 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:+1:19: +1:20
- StorageDead(_9); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
- drop(_5) -> bb9; // scope 0 at $DIR/issue_62289.rs:+1:20: +1:21
+ 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:+1:20: +1:21
- _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue_62289.rs:+1:5: +1:22
- drop(_1) -> bb8; // scope 0 at $DIR/issue_62289.rs:+1:21: +1:22
+ 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:+1:21: +1:22
- StorageDead(_6); // scope 0 at $DIR/issue_62289.rs:+2:1: +2:2
- goto -> bb10; // scope 0 at $DIR/issue_62289.rs:+2:2: +2:2
+ 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:+1:20: +1:21
- StorageDead(_1); // scope 0 at $DIR/issue_62289.rs:+1:21: +1:22
- StorageDead(_6); // scope 0 at $DIR/issue_62289.rs:+2:1: +2:2
- goto -> bb10; // scope 0 at $DIR/issue_62289.rs:+2:2: +2:2
+ 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:+2:2: +2:2
+ return; // scope 0 at $DIR/issue_62289.rs:+5:2: +5:2
}
bb11 (cleanup): {
- drop(_1) -> bb13; // scope 0 at $DIR/issue_62289.rs:+1:21: +1:22
+ drop(_1) -> [return: bb13, unwind terminate]; // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
}
bb12 (cleanup): {
- drop(_5) -> bb13; // scope 0 at $DIR/issue_62289.rs:+1:20: +1:21
+ 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: +2:2
+ resume; // scope 0 at $DIR/issue_62289.rs:+0:1: +5:2
}
}
diff --git a/tests/mir-opt/issue_72181.main.built.after.mir b/tests/mir-opt/issue_72181.main.built.after.mir
index e86836927..724e55e17 100644
--- a/tests/mir-opt/issue_72181.main.built.after.mir
+++ b/tests/mir-opt/issue_72181.main.built.after.mir
@@ -29,6 +29,7 @@ fn main() -> () {
}
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
@@ -49,6 +50,7 @@ fn main() -> () {
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
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 2172f3aa9..e1d896cbc 100644
--- a/tests/mir-opt/issue_72181_1.main.built.after.mir
+++ b/tests/mir-opt/issue_72181_1.main.built.after.mir
@@ -1,8 +1,8 @@
// MIR for `main` after built
| User Type Annotations
-| 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(Void) }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void
-| 1: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(Void) }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void
+| 0: user_ty: Canonical { value: Ty(Void), max_universe: U0, variables: [] }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void
+| 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
diff --git a/tests/mir-opt/issue_76432.rs b/tests/mir-opt/issue_76432.rs
index fbbfd4ceb..76bb11aae 100644
--- a/tests/mir-opt/issue_76432.rs
+++ b/tests/mir-opt/issue_76432.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index cc4f7cc06..abb89b91d 100644
--- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
@@ -42,7 +42,6 @@
}
bb1: {
- StorageLive(_15); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL
_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
diff --git a/tests/mir-opt/issue_91633.bar.built.after.mir b/tests/mir-opt/issue_91633.bar.built.after.mir
index c3fb90e84..88a383015 100644
--- a/tests/mir-opt/issue_91633.bar.built.after.mir
+++ b/tests/mir-opt/issue_91633.bar.built.after.mir
@@ -20,6 +20,7 @@ fn bar(_1: Box<[T]>) -> () {
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
@@ -30,7 +31,7 @@ fn bar(_1: Box<[T]>) -> () {
}
bb3 (cleanup): {
- drop(_1) -> bb4; // scope 0 at $DIR/issue_91633.rs:+5:2: +5:3
+ drop(_1) -> [return: bb4, unwind terminate]; // scope 0 at $DIR/issue_91633.rs:+5:2: +5:3
}
bb4 (cleanup): {
diff --git a/tests/mir-opt/issue_91633.foo.built.after.mir b/tests/mir-opt/issue_91633.foo.built.after.mir
index 4e3dd365e..569135803 100644
--- a/tests/mir-opt/issue_91633.foo.built.after.mir
+++ b/tests/mir-opt/issue_91633.foo.built.after.mir
@@ -48,7 +48,7 @@ fn foo(_1: Box<[T]>) -> T {
}
bb5 (cleanup): {
- drop(_1) -> bb6; // scope 0 at $DIR/issue_91633.rs:+4:2: +4:3
+ drop(_1) -> [return: bb6, unwind terminate]; // scope 0 at $DIR/issue_91633.rs:+4:2: +4:3
}
bb6 (cleanup): {
diff --git a/tests/mir-opt/issue_91633.hey.built.after.mir b/tests/mir-opt/issue_91633.hey.built.after.mir
index ccb06dd59..19f0c133e 100644
--- a/tests/mir-opt/issue_91633.hey.built.after.mir
+++ b/tests/mir-opt/issue_91633.hey.built.after.mir
@@ -23,6 +23,7 @@ fn hey(_1: &[T]) -> () {
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
diff --git a/tests/mir-opt/issue_99325.main.built.after.mir b/tests/mir-opt/issue_99325.main.built.after.mir
index 3e035c18d..2324f5356 100644
--- a/tests/mir-opt/issue_99325.main.built.after.mir
+++ b/tests/mir-opt/issue_99325.main.built.after.mir
@@ -1,8 +1,8 @@
// MIR for `main` after built
| User Type Annotations
-| 0: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Value(Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)])) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:10:16: 10:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
-| 1: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Unevaluated(UnevaluatedConst { def: WithOptConstParam { did: DefId(0:8 ~ issue_99325[8f58]::main::{constant#1}), const_param_did: Some(DefId(0:4 ~ issue_99325[8f58]::function_with_bytes::BYTES)) }, substs: [] }) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:11:16: 11:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
+| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Value(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(UnevaluatedConst { def: WithOptConstParam { did: DefId(0:8 ~ issue_99325[22bb]::main::{constant#1}), const_param_did: Some(DefId(0:4 ~ issue_99325[22bb]::function_with_bytes::BYTES)) }, 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
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
index 291fc5063..42b605326 100644
--- 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
@@ -5,7 +5,7 @@ fn num_to_digit(_1: char) -> u32 {
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
let mut _3: u32; // in scope 0 at $DIR/issue_59352.rs:+2:12: +2:23
- scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue_59352.rs:14:12: 14:23
+ 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 => _3; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
let mut _4: &std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
@@ -15,7 +15,7 @@ fn num_to_digit(_1: char) -> u32 {
let mut _6: 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:14:42: 14:50
+ 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 _7: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
let mut _8: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
@@ -38,7 +38,7 @@ fn num_to_digit(_1: char) -> u32 {
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:14:30: 14:38
+ // + 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>) }
}
@@ -66,7 +66,6 @@ fn num_to_digit(_1: char) -> u32 {
}
bb6: {
- StorageLive(_8); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
_8 = 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
diff --git a/tests/mir-opt/issues/issue_59352.rs b/tests/mir-opt/issues/issue_59352.rs
index 1e0045555..92011bd65 100644
--- a/tests/mir-opt/issues/issue_59352.rs
+++ b/tests/mir-opt/issues/issue_59352.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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 bcda12880..8e6e6fc0e 100644
--- a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
+++ b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
@@ -24,61 +24,49 @@
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 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue_75439.rs:+2:37: +2:53
- // mir::Constant
- // + span: $DIR/issue_75439.rs:8:37: 8:46
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn([u8; 16]) -> [u32; 4] {transmute::<[u8; 16], [u32; 4]>}, val: Value(<ZST>) }
+ _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
}
bb1: {
- StorageDead(_3); // scope 2 at $DIR/issue_75439.rs:+2:52: +2:53
- switchInt(_2[0 of 4]) -> [0: bb2, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb6]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
}
bb2: {
- switchInt(_2[1 of 4]) -> [0: bb3, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ switchInt(_2[2 of 4]) -> [0: bb4, 4294901760: bb5, otherwise: bb6]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
}
bb3: {
- switchInt(_2[2 of 4]) -> [0: bb5, 4294901760: bb6, otherwise: bb8]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
- }
-
- bb4: {
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 = transmute::<u32, [u8; 4]>(move _6) -> bb7; // scope 4 at $DIR/issue_75439.rs:+5:23: +5:36
- // mir::Constant
- // + span: $DIR/issue_75439.rs:11:23: 11:32
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32) -> [u8; 4] {transmute::<u32, [u8; 4]>}, val: Value(<ZST>) }
+ _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
}
- bb5: {
+ 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 -> bb4; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ goto -> bb3; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
}
- bb6: {
+ 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 -> bb4; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
+ goto -> bb3; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30
}
- bb7: {
- 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 -> bb9; // scope 1 at $DIR/issue_75439.rs:+4:5: +8:6
- }
-
- bb8: {
+ bb6: {
_0 = Option::<[u8; 4]>::None; // scope 1 at $DIR/issue_75439.rs:+7:9: +7:13
- goto -> bb9; // scope 1 at $DIR/issue_75439.rs:+4:5: +8:6
+ goto -> bb7; // scope 1 at $DIR/issue_75439.rs:+4:5: +8:6
}
- bb9: {
+ 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
}
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 4ee2dae49..43d00b29e 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
@@ -35,7 +35,7 @@ fn main() -> () {
}
bb3: {
- falseUnwind -> [real: bb4, cleanup: bb5]; // scope 0 at $DIR/loop_test.rs:+7:5: +10:6
+ falseUnwind -> [real: bb4, unwind: bb5]; // scope 0 at $DIR/loop_test.rs:+7:5: +10:6
}
bb4: {
diff --git a/tests/mir-opt/lower_array_len.rs b/tests/mir-opt/lower_array_len.rs
index 972d46cb8..e1bb51f2d 100644
--- a/tests/mir-opt/lower_array_len.rs
+++ b/tests/mir-opt/lower_array_len.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 3389db733..dd742d87a 100644
--- a/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
@@ -5,7 +5,7 @@
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>() -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:42
+- _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>) }
diff --git a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff
index d9898d8e0..e95c3f9bc 100644
--- a/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff
@@ -9,9 +9,9 @@
bb0: {
StorageLive(_1); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
-- _1 = std::intrinsics::assume(const true) -> bb1; // 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:72:9: 72:32
+- // + 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
diff --git a/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
index d962ef8cb..1f03b7b0b 100644
--- a/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
@@ -29,9 +29,9 @@
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) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:45
+- _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:49:5: 49:41
+- // + 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
@@ -46,13 +46,13 @@
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:50:42: 50:44
+ // + 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) -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45
+- _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:50:5: 50:41
+- // + 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
@@ -67,13 +67,13 @@
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:51:42: 51:45
+ // + 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) -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46
+- _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:51:5: 51:41
+- // + 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
@@ -88,13 +88,13 @@
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:52:42: 52:47
+ // + 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) -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48
+- _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:52:5: 52:41
+- // + 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
diff --git a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
index 5c972a00e..a54e9a932 100644
--- a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
@@ -47,9 +47,9 @@
_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) -> bb1; // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
+- _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:65:9: 65:28
+- // + 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
diff --git a/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
index 4cbbc02c9..bfb000ccd 100644
--- a/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
@@ -9,7 +9,7 @@
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) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:32
+- _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>) }
diff --git a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
index d8cd5f59a..64d82907c 100644
--- a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
@@ -17,7 +17,7 @@
// + 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() -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+3:5: +3:16
+- _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
}
diff --git a/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.diff
new file mode 100644
index 000000000..cc5079af7
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.diff
@@ -0,0 +1,54 @@
+- // 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:133:18: 133: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:134:18: 134: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.read_via_copy_primitive.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.diff
new file mode 100644
index 000000000..5805df48f
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.diff
@@ -0,0 +1,27 @@
+- // 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_uninhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.diff
new file mode 100644
index 000000000..95b2ec49d
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.diff
@@ -0,0 +1,21 @@
+- // 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.rs b/tests/mir-opt/lower_intrinsics.rs
index 7147be43c..33fef930a 100644
--- a/tests/mir-opt/lower_intrinsics.rs
+++ b/tests/mir-opt/lower_intrinsics.rs
@@ -1,7 +1,7 @@
// unit-test: LowerIntrinsics
// ignore-wasm32 compiled with panic=abort by default
-#![feature(core_intrinsics, intrinsics)]
+#![feature(core_intrinsics, intrinsics, rustc_attrs)]
#![crate_type = "lib"]
// EMIT_MIR lower_intrinsics.wrapping.LowerIntrinsics.diff
@@ -38,6 +38,39 @@ pub fn non_const<T>() -> usize {
size_of_t()
}
+// EMIT_MIR lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff
+pub fn transmute_inhabited(c: std::cmp::Ordering) -> i8 {
+ unsafe { std::mem::transmute(c) }
+}
+
+// EMIT_MIR lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff
+pub unsafe fn transmute_uninhabited(u: ()) -> Never {
+ unsafe { std::mem::transmute::<(), Never>(u) }
+}
+
+// EMIT_MIR lower_intrinsics.transmute_ref_dst.LowerIntrinsics.diff
+pub unsafe fn transmute_ref_dst<T: ?Sized>(u: &T) -> *const T {
+ unsafe { std::mem::transmute(u) }
+}
+
+// EMIT_MIR lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.diff
+pub unsafe fn transmute_to_ref_uninhabited() -> ! {
+ let x: &Never = std::mem::transmute(1usize);
+ match *x {}
+}
+
+// EMIT_MIR lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.diff
+pub unsafe fn transmute_to_mut_uninhabited() -> ! {
+ let x: &mut Never = std::mem::transmute(1usize);
+ match *x {}
+}
+
+// EMIT_MIR lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.diff
+pub unsafe fn transmute_to_box_uninhabited() -> ! {
+ let x: Box<Never> = std::mem::transmute(1usize);
+ match *x {}
+}
+
pub enum E {
A,
B,
@@ -54,6 +87,7 @@ pub fn discriminant<T>(t: T) {
extern "rust-intrinsic" {
// Cannot use `std::intrinsics::copy_nonoverlapping` as that is a wrapper function
+ #[rustc_nounwind]
fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
}
@@ -79,3 +113,24 @@ pub fn with_overflow(a: i32, b: i32) {
let _y = core::intrinsics::sub_with_overflow(a, b);
let _z = core::intrinsics::mul_with_overflow(a, b);
}
+
+// EMIT_MIR lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.diff
+pub fn read_via_copy_primitive(r: &i32) -> i32 {
+ unsafe { core::intrinsics::read_via_copy(r) }
+}
+
+// EMIT_MIR lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.diff
+pub fn read_via_copy_uninhabited(r: &Never) -> Never {
+ unsafe { core::intrinsics::read_via_copy(r) }
+}
+
+pub enum Never {}
+
+// EMIT_MIR lower_intrinsics.option_payload.LowerIntrinsics.diff
+#[cfg(not(bootstrap))]
+pub fn option_payload(o: &Option<usize>, p: &Option<String>) {
+ unsafe {
+ let _x = core::intrinsics::option_payload_ptr(o);
+ let _y = core::intrinsics::option_payload_ptr(p);
+ }
+}
diff --git a/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff
index cf0ab73a5..27e8accea 100644
--- a/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff
@@ -5,7 +5,7 @@
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>() -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:37
+- _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>) }
diff --git a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff
new file mode 100644
index 000000000..1b3b76851
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.diff
@@ -0,0 +1,27 @@
+- // 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_ref_dst.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.diff
new file mode 100644
index 000000000..c6a7d2287
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.diff
@@ -0,0 +1,27 @@
+- // 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_to_box_uninhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.diff
new file mode 100644
index 000000000..8735a7500
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.diff
@@ -0,0 +1,29 @@
+- // 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 mut _1: !; // in scope 0 at $DIR/lower_intrinsics.rs:+0:51: +3:2
+ let _2: std::boxed::Box<Never>; // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+ let mut _3: !; // in scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:16
+ scope 1 {
+ debug x => _2; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+0:51: +3:2
+ StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+- _2 = 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>) }
++ _2 = 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: {
+ StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:+2:5: +2:16
+ 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.diff b/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.diff
new file mode 100644
index 000000000..a77213277
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_mut_uninhabited.LowerIntrinsics.diff
@@ -0,0 +1,29 @@
+- // 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 mut _1: !; // in scope 0 at $DIR/lower_intrinsics.rs:+0:51: +3:2
+ let _2: &mut Never; // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+ let mut _3: !; // in scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:16
+ scope 1 {
+ debug x => _2; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+0:51: +3:2
+ StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+- _2 = 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>) }
++ _2 = 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: {
+ StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:+2:5: +2:16
+ 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.diff b/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.diff
new file mode 100644
index 000000000..c4d53d4e8
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_to_ref_uninhabited.LowerIntrinsics.diff
@@ -0,0 +1,29 @@
+- // 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 mut _1: !; // in scope 0 at $DIR/lower_intrinsics.rs:+0:51: +3:2
+ let _2: &Never; // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+ let mut _3: !; // in scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:16
+ scope 1 {
+ debug x => _2; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+0:51: +3:2
+ StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:10
+- _2 = 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>) }
++ _2 = 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: {
+ StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:+2:5: +2:16
+ unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+2:11: +2:13
+ }
+ }
+
diff --git a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff
new file mode 100644
index 000000000..f0b76127d
--- /dev/null
+++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.diff
@@ -0,0 +1,22 @@
+- // 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.unreachable.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
index 6f17d4451..c0cc698c4 100644
--- a/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
@@ -12,7 +12,7 @@
bb0: {
StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:47
StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:45
-- _3 = std::intrinsics::unreachable(); // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:45
+- _3 = 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>) }
diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff
index 9870a70de..9cf4fbb88 100644
--- a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.diff
@@ -30,9 +30,9 @@
_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) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:55
+- _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:78:14: 78:49
+- // + 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
@@ -46,9 +46,9 @@
_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) -> bb2; // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:55
+- _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:79:14: 79:49
+- // + 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
@@ -62,9 +62,9 @@
_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) -> bb3; // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:55
+- _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:80:14: 80:49
+- // + 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
diff --git a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
index 22ef75fd8..0bfb34aca 100644
--- a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
+++ b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
@@ -30,7 +30,7 @@
_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 = wrapping_add::<i32>(move _4, move _5) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:50
+- _3 = 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 {wrapping_add::<i32>}, val: Value(<ZST>) }
@@ -46,7 +46,7 @@
_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 = wrapping_sub::<i32>(move _7, move _8) -> bb2; // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:50
+- _6 = 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 {wrapping_sub::<i32>}, val: Value(<ZST>) }
@@ -62,7 +62,7 @@
_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) -> bb3; // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:50
+- _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>) }
diff --git a/tests/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir b/tests/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir
index f6d8bdd74..4f5df1331 100644
--- a/tests/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir
+++ b/tests/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir
@@ -12,15 +12,13 @@ fn f_u64() -> () {
bb0: {
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics_e2e.rs:+1:5: +1:21
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics_e2e.rs:23:9: 23:21
- _2 = f_non_zst::<u64>(const 0_u64) -> bb1; // scope 1 at $DIR/lower_intrinsics_e2e.rs:23:9: 23:21
+ _2 = f_non_zst::<u64>(const 0_u64) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics_e2e.rs:23:9: 23:21
// mir::Constant
// + span: $DIR/lower_intrinsics_e2e.rs:23:9: 23:18
// + literal: Const { ty: fn(u64) {f_non_zst::<u64>}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics_e2e.rs:23:21: 23:22
StorageDead(_1); // scope 0 at $DIR/lower_intrinsics_e2e.rs:+1:5: +1:21
return; // scope 0 at $DIR/lower_intrinsics_e2e.rs:+2:2: +2:2
}
diff --git a/tests/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir b/tests/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir
index b672e1a6e..8654e80cd 100644
--- a/tests/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir
+++ b/tests/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir
@@ -2,26 +2,21 @@
fn f_unit() -> () {
let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics_e2e.rs:+0:17: +0:17
- let mut _1: (); // in scope 0 at $DIR/lower_intrinsics_e2e.rs:+1:16: +1:18
scope 1 (inlined f_dispatch::<()>) { // at $DIR/lower_intrinsics_e2e.rs:9:5: 9:19
- debug t => _1; // in scope 1 at $DIR/lower_intrinsics_e2e.rs:19:22: 19:23
- let _2: (); // in scope 1 at $DIR/lower_intrinsics_e2e.rs:21:9: 21:17
+ debug t => const (); // in scope 1 at $DIR/lower_intrinsics_e2e.rs:19:22: 19:23
+ let _1: (); // in scope 1 at $DIR/lower_intrinsics_e2e.rs:21:9: 21:17
scope 2 (inlined std::mem::size_of::<()>) { // at $DIR/lower_intrinsics_e2e.rs:20:8: 20:32
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/lower_intrinsics_e2e.rs:+1:16: +1:18
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics_e2e.rs:21:9: 21:17
- _2 = f_zst::<()>(move _1) -> bb1; // scope 1 at $DIR/lower_intrinsics_e2e.rs:21:9: 21:17
+ _1 = f_zst::<()>(const ()) -> [return: bb1, unwind unreachable]; // scope 1 at $DIR/lower_intrinsics_e2e.rs:21:9: 21:17
// mir::Constant
// + span: $DIR/lower_intrinsics_e2e.rs:21:9: 21:14
// + literal: Const { ty: fn(()) {f_zst::<()>}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics_e2e.rs:21:17: 21:18
- StorageDead(_1); // scope 0 at $DIR/lower_intrinsics_e2e.rs:+1:18: +1:19
return; // scope 0 at $DIR/lower_intrinsics_e2e.rs:+2:2: +2:2
}
}
diff --git a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
index 2b0370cf3..67918e62b 100644
--- a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
+++ b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
@@ -22,7 +22,7 @@
_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:5:22: 5:25
+- // + 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
diff --git a/tests/mir-opt/lower_slice_len.rs b/tests/mir-opt/lower_slice_len.rs
index 12955aed1..9c39c29fc 100644
--- a/tests/mir-opt/lower_slice_len.rs
+++ b/tests/mir-opt/lower_slice_len.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 84e4d35f9..3081e78f2 100644
--- 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
@@ -243,7 +243,7 @@
}
- bb25 (cleanup): {
-- drop(_2) -> bb26; // scope 0 at $DIR/match_arm_scopes.rs:+5:1: +5:2
+- 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
}
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
index 0cb34a2f2..950f8758e 100644
--- 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
@@ -40,7 +40,7 @@ fn main() -> () {
}
bb3 (cleanup): {
- drop(_2) -> bb4; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:34: +1:35
+ drop(_2) -> [return: bb4, unwind terminate]; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:34: +1:35
}
bb4 (cleanup): {
diff --git a/tests/mir-opt/nrvo_simple.rs b/tests/mir-opt/nrvo_simple.rs
index 5786ae621..525dfe426 100644
--- a/tests/mir-opt/nrvo_simple.rs
+++ b/tests/mir-opt/nrvo_simple.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 210f178a0..81b96e3b6 100644
--- 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
@@ -28,21 +28,21 @@ fn main() -> () {
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: bb3]; // 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: {
- 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
+ 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 (cleanup): {
- resume; // scope 0 at $DIR/packed_struct_drop_aligned.rs:+0: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): {
- (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed_struct_drop_aligned.rs:+2:5: +2:8
- drop(_1) -> bb2; // scope 0 at $DIR/packed_struct_drop_aligned.rs:+3:1: +3:2
+ resume; // scope 0 at $DIR/packed_struct_drop_aligned.rs:+0:1: +3:2
}
bb4: {
@@ -50,6 +50,6 @@ fn main() -> () {
(_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: bb1, unwind: bb2]; // scope 0 at $DIR/packed_struct_drop_aligned.rs:+3:1: +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/remove_storage_markers.main.RemoveStorageMarkers.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
index a8dd91efc..0e8309532 100644
--- a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
+++ b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
@@ -34,7 +34,7 @@
_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:10:14: 10:19
+ // + 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>) }
}
@@ -54,7 +54,7 @@
_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:10:14: 10:19
+ // + 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>) }
}
diff --git a/tests/mir-opt/remove_storage_markers.rs b/tests/mir-opt/remove_storage_markers.rs
index f00b82691..480db8ac1 100644
--- a/tests/mir-opt/remove_storage_markers.rs
+++ b/tests/mir-opt/remove_storage_markers.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 07e4dd418..7713649c5 100644
--- a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff
+++ b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.diff
@@ -11,7 +11,7 @@
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
+ 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
@@ -23,7 +23,7 @@
bb2: {
StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:11: +1:12
- StorageDead(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:12: +1:13
+ 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.dont_opt.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff
index e809ca4e9..533db4051 100644
--- a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff
+++ b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.diff
@@ -11,7 +11,7 @@
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
+ 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
@@ -23,7 +23,7 @@
bb2: {
StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:11: +1:12
- StorageDead(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:12: +1:13
+ 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.opt.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff
index 087f76dbd..04a2d54e9 100644
--- a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff
+++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.diff
@@ -11,7 +11,7 @@
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
+- 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
@@ -19,7 +19,7 @@
-
- bb1: {
StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:11: +1:12
- StorageDead(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:12: +1:13
+- 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_generic_copy.RemoveUnneededDrops.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff
index 933d6895f..782d0c6c5 100644
--- a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff
+++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.diff
@@ -11,7 +11,7 @@
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:5: +1:12
+- 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
@@ -19,7 +19,7 @@
-
- bb1: {
StorageDead(_3); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:11: +1:12
- StorageDead(_2); // scope 0 at $DIR/remove_unneeded_drops.rs:+1:12: +1:13
+- 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_zsts.get_union.PreCodegen.after.mir b/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir
index af34bc5ed..7ac9ef3d4 100644
--- a/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir
+++ b/tests/mir-opt/remove_zsts.get_union.PreCodegen.after.mir
@@ -2,12 +2,9 @@
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
bb0: {
- StorageLive(_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
+ _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
}
}
diff --git a/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff b/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff
index 0af29b2ba..edd86ef0a 100644
--- a/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff
+++ b/tests/mir-opt/remove_zsts.get_union.RemoveZsts.diff
@@ -6,11 +6,14 @@
let mut _1: (); // in scope 0 at $DIR/remove_zsts.rs:+1:14: +1:16
bb0: {
- StorageLive(_1); // scope 0 at $DIR/remove_zsts.rs:+1:14: +1:16
+- 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
- _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
++ _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
}
}
diff --git a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
index d7b6d64b6..4eef028e1 100644
--- a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
+++ b/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
@@ -108,7 +108,7 @@ fn main() -> () {
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[4622]::main::{closure#0})
+ // + def_id: DefId(0:14 ~ retag[7654]::main::{closure#0})
// + substs: [
// i8,
// for<'a> extern "rust-call" fn((&'a i32,)) -> &'a i32,
@@ -186,11 +186,11 @@ fn main() -> () {
}
bb7 (cleanup): {
- drop(_21) -> bb9; // scope 7 at $DIR/retag.rs:+18:24: +18:25
+ drop(_21) -> [return: bb9, unwind terminate]; // scope 7 at $DIR/retag.rs:+18:24: +18:25
}
bb8 (cleanup): {
- drop(_5) -> bb9; // scope 1 at $DIR/retag.rs:+3:36: +3:37
+ drop(_5) -> [return: bb9, unwind terminate]; // scope 1 at $DIR/retag.rs:+3:36: +3:37
}
bb9 (cleanup): {
diff --git a/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff b/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
index cfcd43093..bdf1de468 100644
--- a/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
+++ b/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
@@ -12,7 +12,6 @@
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
- let mut _16: i32; // in scope 0 at $SRC_DIR/core/src/result.rs:LL:COL
scope 1 {
debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:+1:9: +1:10
scope 2 {
@@ -23,7 +22,7 @@
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 => _16; // in scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ debug t => _14; // in scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
}
}
@@ -90,10 +89,7 @@
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
- StorageLive(_16); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- _16 = move _14; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- _15 = move _16; // scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- StorageDead(_16); // 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
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 3c7e9dc61..b5e0a66d8 100644
--- a/tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff
+++ b/tests/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff
@@ -61,7 +61,7 @@
bb4: {
_8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- switchInt(move _8) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
+ switchInt(move _8) -> [0: bb6, 1: bb5, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
}
bb5: {
@@ -69,14 +69,10 @@
_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 -> bb8; // 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
}
bb6: {
- unreachable; // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- }
-
- bb7: {
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
@@ -84,10 +80,10 @@
_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 -> bb8; // 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
}
- bb8: {
+ 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
}
diff --git a/tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir b/tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir
index 66ba4df76..cae89fb17 100644
--- a/tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir
+++ b/tests/mir-opt/simple_option_map_e2e.ezmap.PreCodegen.after.mir
@@ -3,30 +3,28 @@
fn ezmap(_1: Option<i32>) -> Option<i32> {
debug x => _1; // in scope 0 at $DIR/simple_option_map_e2e.rs:+0:14: +0:15
let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/simple_option_map_e2e.rs:+0:33: +0:44
- let mut _2: [closure@$DIR/simple_option_map_e2e.rs:14:12: 14:15]; // in scope 0 at $DIR/simple_option_map_e2e.rs:+1:12: +1:21
scope 1 (inlined map::<i32, i32, [closure@$DIR/simple_option_map_e2e.rs:14:12: 14:15]>) { // at $DIR/simple_option_map_e2e.rs:14:5: 14:22
debug slf => _1; // in scope 1 at $DIR/simple_option_map_e2e.rs:2:17: 2:20
- debug f => _2; // in scope 1 at $DIR/simple_option_map_e2e.rs:2:33: 2:34
- let mut _3: isize; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:9: 7:16
- let _4: i32; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:14: 7:15
- let mut _5: i32; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:25: 7:29
+ debug f => const ZeroSized: [closure@$DIR/simple_option_map_e2e.rs:14:12: 14:15]; // in scope 1 at $DIR/simple_option_map_e2e.rs:2:33: 2:34
+ let mut _2: isize; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:9: 7:16
+ let _3: i32; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:14: 7:15
+ let mut _4: i32; // in scope 1 at $DIR/simple_option_map_e2e.rs:7:25: 7:29
scope 2 {
- debug x => _4; // in scope 2 at $DIR/simple_option_map_e2e.rs:7:14: 7:15
+ debug x => _3; // in scope 2 at $DIR/simple_option_map_e2e.rs:7:14: 7:15
scope 3 (inlined ezmap::{closure#0}) { // at $DIR/simple_option_map_e2e.rs:7:25: 7:29
- debug n => _4; // in scope 3 at $DIR/simple_option_map_e2e.rs:+1:13: +1:14
+ debug n => _3; // in scope 3 at $DIR/simple_option_map_e2e.rs:+1:13: +1:14
}
}
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/simple_option_map_e2e.rs:+1:12: +1:21
- _3 = discriminant(_1); // scope 1 at $DIR/simple_option_map_e2e.rs:6:11: 6:14
- switchInt(move _3) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 1 at $DIR/simple_option_map_e2e.rs:6:5: 6:14
+ _2 = discriminant(_1); // scope 1 at $DIR/simple_option_map_e2e.rs:6:11: 6:14
+ switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2]; // scope 1 at $DIR/simple_option_map_e2e.rs:6:5: 6:14
}
bb1: {
_0 = Option::<i32>::None; // scope 1 at $DIR/simple_option_map_e2e.rs:8:17: 8:21
- goto -> bb4; // scope 1 at $DIR/simple_option_map_e2e.rs:8:17: 8:21
+ return; // scope 1 at $DIR/simple_option_map_e2e.rs:8:17: 8:21
}
bb2: {
@@ -34,16 +32,11 @@ fn ezmap(_1: Option<i32>) -> Option<i32> {
}
bb3: {
- _4 = ((_1 as Some).0: i32); // scope 1 at $DIR/simple_option_map_e2e.rs:7:14: 7:15
- StorageLive(_5); // scope 2 at $DIR/simple_option_map_e2e.rs:7:25: 7:29
- _5 = Add(_4, const 1_i32); // scope 3 at $DIR/simple_option_map_e2e.rs:+1:16: +1:21
- _0 = Option::<i32>::Some(move _5); // scope 2 at $DIR/simple_option_map_e2e.rs:7:20: 7:30
- StorageDead(_5); // scope 2 at $DIR/simple_option_map_e2e.rs:7:29: 7:30
- goto -> bb4; // scope 1 at $DIR/simple_option_map_e2e.rs:10:1: 10:2
- }
-
- bb4: {
- StorageDead(_2); // scope 0 at $DIR/simple_option_map_e2e.rs:+1:21: +1:22
- return; // scope 0 at $DIR/simple_option_map_e2e.rs:+2:2: +2:2
+ _3 = ((_1 as Some).0: i32); // scope 1 at $DIR/simple_option_map_e2e.rs:7:14: 7:15
+ StorageLive(_4); // scope 2 at $DIR/simple_option_map_e2e.rs:7:25: 7:29
+ _4 = Add(_3, const 1_i32); // scope 3 at $DIR/simple_option_map_e2e.rs:+1:16: +1:21
+ _0 = Option::<i32>::Some(move _4); // scope 2 at $DIR/simple_option_map_e2e.rs:7:20: 7:30
+ StorageDead(_4); // scope 2 at $DIR/simple_option_map_e2e.rs:7:29: 7:30
+ return; // scope 1 at $DIR/simple_option_map_e2e.rs:10:1: 10:2
}
}
diff --git a/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff
index 1e66b1f70..c61107d25 100644
--- a/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff
+++ b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff
@@ -12,8 +12,8 @@
}
bb1: {
-- falseUnwind -> [real: bb2, cleanup: bb11]; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
-+ falseUnwind -> [real: bb2, cleanup: bb6]; // scope 0 at $DIR/simplify_cfg.rs:+1:5: +5:6
+- 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
}
bb2: {
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
new file mode 100644
index 000000000..f7f50206a
--- /dev/null
+++ b/tests/mir-opt/simplify_duplicate_unreachable_blocks.assert_nonzero_nonmax.SimplifyCfg-after-uninhabited-enum-branching.diff
@@ -0,0 +1,25 @@
+- // MIR for `assert_nonzero_nonmax` before SimplifyCfg-after-uninhabited-enum-branching
++ // MIR for `assert_nonzero_nonmax` after SimplifyCfg-after-uninhabited-enum-branching
+
+ fn assert_nonzero_nonmax(_1: u8) -> u8 {
+ let mut _0: u8; // return place in scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+0:47: +0:49
+
+ 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
+ }
+
+ bb1: {
+ unreachable; // scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+10:13: +10:26
+ }
+
+ bb2: {
+- unreachable; // scope 0 at $DIR/simplify_duplicate_unreachable_blocks.rs:+13:13: +13:26
+- }
+-
+- 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
+ }
+ }
+
diff --git a/tests/mir-opt/simplify_duplicate_unreachable_blocks.rs b/tests/mir-opt/simplify_duplicate_unreachable_blocks.rs
new file mode 100644
index 000000000..e2578407f
--- /dev/null
+++ b/tests/mir-opt/simplify_duplicate_unreachable_blocks.rs
@@ -0,0 +1,30 @@
+#![feature(custom_mir, core_intrinsics)]
+#![crate_type = "lib"]
+
+use std::intrinsics::mir::*;
+
+// unit-test: SimplifyCfg-after-uninhabited-enum-branching
+
+// EMIT_MIR simplify_duplicate_unreachable_blocks.assert_nonzero_nonmax.SimplifyCfg-after-uninhabited-enum-branching.diff
+#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
+pub unsafe fn assert_nonzero_nonmax(x: u8) -> u8 {
+ mir!(
+ {
+ match x {
+ 0 => unreachable1,
+ u8::MAX => unreachable2,
+ _ => retblock,
+ }
+ }
+ unreachable1 = {
+ Unreachable()
+ }
+ unreachable2 = {
+ Unreachable()
+ }
+ retblock = {
+ RET = x;
+ Return()
+ }
+ )
+}
diff --git a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
index f9e22866b..b473d0fde 100644
--- a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
+++ b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
@@ -14,15 +14,13 @@
}
bb1: {
- StorageLive(_2); // scope 0 at $DIR/simplify_if.rs:+2:9: +2:15
_2 = noop() -> bb2; // scope 0 at $DIR/simplify_if.rs:+2:9: +2:15
// mir::Constant
- // + span: $DIR/simplify_if.rs:7:9: 7:13
+ // + span: $DIR/simplify_if.rs:8:9: 8:13
// + literal: Const { ty: fn() {noop}, val: Value(<ZST>) }
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/simplify_if.rs:+2:15: +2:16
goto -> bb4; // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6
}
diff --git a/tests/mir-opt/simplify_if.rs b/tests/mir-opt/simplify_if.rs
index 2d093d926..b86f80a80 100644
--- a/tests/mir-opt/simplify_if.rs
+++ b/tests/mir-opt/simplify_if.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
#[inline(never)]
fn noop() {}
diff --git a/tests/mir-opt/simplify_locals_fixedpoint.rs b/tests/mir-opt/simplify_locals_fixedpoint.rs
index 1fdba6e99..7c41e8b7c 100644
--- a/tests/mir-opt/simplify_locals_fixedpoint.rs
+++ b/tests/mir-opt/simplify_locals_fixedpoint.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 0f8866f9c..ae2c774f2 100644
--- 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
@@ -56,7 +56,7 @@
+ 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:15:5: 15:12
+ // + span: $DIR/simplify_locals_removes_unused_consts.rs:16:5: 16:12
// + literal: Const { ty: fn(((), ())) {use_zst}, val: Value(<ZST>) }
}
@@ -84,7 +84,7 @@
+ 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:17:5: 17:11
+ // + span: $DIR/simplify_locals_removes_unused_consts.rs:18:5: 18:11
// + literal: Const { ty: fn(u8) {use_u8}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.rs b/tests/mir-opt/simplify_locals_removes_unused_consts.rs
index 7a03a2837..983d8004e 100644
--- a/tests/mir-opt/simplify_locals_removes_unused_consts.rs
+++ b/tests/mir-opt/simplify_locals_removes_unused_consts.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// unit-test: SimplifyLocals-before-const-prop
// compile-flags: -C overflow-checks=no
diff --git a/tests/mir-opt/simplify_match.main.ConstProp.diff b/tests/mir-opt/simplify_match.main.ConstProp.diff
index b700adfb1..d2b9ac3cc 100644
--- a/tests/mir-opt/simplify_match.main.ConstProp.diff
+++ b/tests/mir-opt/simplify_match.main.ConstProp.diff
@@ -22,7 +22,7 @@
bb2: {
_0 = noop() -> bb3; // scope 0 at $DIR/simplify_match.rs:+2:17: +2:23
// mir::Constant
- // + span: $DIR/simplify_match.rs:7:17: 7:21
+ // + span: $DIR/simplify_match.rs:8:17: 8:21
// + literal: Const { ty: fn() {noop}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/simplify_match.rs b/tests/mir-opt/simplify_match.rs
index 216203f9f..6a2a6f217 100644
--- a/tests/mir-opt/simplify_match.rs
+++ b/tests/mir-opt/simplify_match.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
#[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 391b00eff..11115c96e 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
@@ -4,21 +4,13 @@ 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: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _5: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _6: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _7: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _8: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _9: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _10: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _11: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _12: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _13: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _14: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _15: *mut [std::string::String]; // 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
bb0: {
- goto -> bb15; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ goto -> bb8; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb1: {
@@ -30,72 +22,34 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () {
}
bb3 (cleanup): {
- _5 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _4 = Add(move _4, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- drop((*_5)) -> bb4; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _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
}
bb4 (cleanup): {
- _6 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _6) -> [0: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _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
}
bb5: {
- _7 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _4 = Add(move _4, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- drop((*_7)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _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
}
bb6: {
- _8 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _8) -> [0: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _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
}
bb7: {
- _4 = const 0_usize; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+ _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
}
bb8: {
goto -> bb7; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
-
- bb9 (cleanup): {
- _11 = _9; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _9 = Offset(move _9, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- drop((*_11)) -> bb10; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb10 (cleanup): {
- _12 = Eq(_9, _10); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _12) -> [0: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb11: {
- _13 = _9; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _9 = Offset(move _9, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- drop((*_13)) -> [return: bb12, unwind: bb10]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb12: {
- _14 = Eq(_9, _10); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _14) -> [0: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb13: {
- _15 = &raw mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _9 = move _15 as *mut std::string::String (PtrToPtr); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _10 = Offset(_9, move _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- goto -> bb12; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb14: {
- goto -> bb13; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb15: {
- _2 = SizeOf(std::string::String); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _3 = Len((*_1)); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _2) -> [0: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
}
diff --git a/tests/mir-opt/sroa.constant.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.constant.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index 9e33215f2..000000000
--- a/tests/mir-opt/sroa.constant.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,46 +0,0 @@
-- // MIR for `constant` before ScalarReplacementOfAggregates
-+ // MIR for `constant` after ScalarReplacementOfAggregates
-
- fn constant() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/sroa.rs:+0:15: +0:15
- let _1: (usize, u8); // in scope 0 at $DIR/sroa.rs:+2:9: +2:10
-+ let _4: usize; // in scope 0 at $DIR/sroa.rs:+2:9: +2:10
-+ let _5: u8; // in scope 0 at $DIR/sroa.rs:+2:9: +2:10
- scope 1 {
-- debug y => _1; // in scope 1 at $DIR/sroa.rs:+2:9: +2:10
-+ debug y => (usize, u8){ .0 => _4, .1 => _5, }; // in scope 1 at $DIR/sroa.rs:+2:9: +2:10
- let _2: usize; // in scope 1 at $DIR/sroa.rs:+3:9: +3:10
- scope 2 {
- debug t => _2; // in scope 2 at $DIR/sroa.rs:+3:9: +3:10
- let _3: u8; // in scope 2 at $DIR/sroa.rs:+4:9: +4:10
- scope 3 {
- debug u => _3; // in scope 3 at $DIR/sroa.rs:+4:9: +4:10
- }
- }
- }
-
- bb0: {
-- StorageLive(_1); // scope 0 at $DIR/sroa.rs:+2:9: +2:10
-+ StorageLive(_4); // scope 0 at $DIR/sroa.rs:+2:9: +2:10
-+ StorageLive(_5); // scope 0 at $DIR/sroa.rs:+2:9: +2:10
-+ nop; // scope 0 at $DIR/sroa.rs:+2:9: +2:10
- _1 = const _; // scope 0 at $DIR/sroa.rs:+2:13: +2:14
-+ _4 = move (_1.0: usize); // scope 1 at $DIR/sroa.rs:+3:9: +3:10
-+ _5 = move (_1.1: u8); // scope 1 at $DIR/sroa.rs:+3:9: +3:10
- StorageLive(_2); // scope 1 at $DIR/sroa.rs:+3:9: +3:10
-- _2 = (_1.0: usize); // scope 1 at $DIR/sroa.rs:+3:13: +3:16
-+ _2 = _4; // scope 1 at $DIR/sroa.rs:+3:13: +3:16
- StorageLive(_3); // scope 2 at $DIR/sroa.rs:+4:9: +4:10
-- _3 = (_1.1: u8); // scope 2 at $DIR/sroa.rs:+4:13: +4:16
-+ _3 = _5; // scope 2 at $DIR/sroa.rs:+4:13: +4:16
- _0 = const (); // scope 0 at $DIR/sroa.rs:+0:15: +5:2
- StorageDead(_3); // scope 2 at $DIR/sroa.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/sroa.rs:+5:1: +5:2
-- StorageDead(_1); // scope 0 at $DIR/sroa.rs:+5:1: +5:2
-+ StorageDead(_4); // scope 0 at $DIR/sroa.rs:+5:1: +5:2
-+ StorageDead(_5); // scope 0 at $DIR/sroa.rs:+5:1: +5:2
-+ nop; // scope 0 at $DIR/sroa.rs:+5:1: +5:2
- return; // scope 0 at $DIR/sroa.rs:+5:2: +5:2
- }
- }
-
diff --git a/tests/mir-opt/sroa.copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.copies.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index 976f6d44b..000000000
--- a/tests/mir-opt/sroa.copies.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,91 +0,0 @@
-- // MIR for `copies` before ScalarReplacementOfAggregates
-+ // MIR for `copies` after ScalarReplacementOfAggregates
-
- fn copies(_1: Foo) -> () {
- debug x => _1; // in scope 0 at $DIR/sroa.rs:+0:11: +0:12
- let mut _0: (); // return place in scope 0 at $DIR/sroa.rs:+0:19: +0:19
- let _2: Foo; // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ let _11: u8; // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ let _12: (); // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ let _13: &str; // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ let _14: std::option::Option<isize>; // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
- scope 1 {
-- debug y => _2; // in scope 1 at $DIR/sroa.rs:+1:9: +1:10
-+ debug y => Foo{ .0 => _11, .1 => _12, .2 => _13, .3 => _14, }; // in scope 1 at $DIR/sroa.rs:+1:9: +1:10
- let _3: u8; // in scope 1 at $DIR/sroa.rs:+2:9: +2:10
- scope 2 {
- debug t => _3; // in scope 2 at $DIR/sroa.rs:+2:9: +2:10
- let _4: &str; // in scope 2 at $DIR/sroa.rs:+3:9: +3:10
- scope 3 {
- debug u => _4; // in scope 3 at $DIR/sroa.rs:+3:9: +3:10
- let _5: Foo; // in scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ let _7: u8; // in scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ let _8: (); // in scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ let _9: &str; // in scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ let _10: std::option::Option<isize>; // in scope 3 at $DIR/sroa.rs:+4:9: +4:10
- scope 4 {
-- debug z => _5; // in scope 4 at $DIR/sroa.rs:+4:9: +4:10
-+ debug z => Foo{ .0 => _7, .1 => _8, .2 => _9, .3 => _10, }; // in scope 4 at $DIR/sroa.rs:+4:9: +4:10
- let _6: (); // in scope 4 at $DIR/sroa.rs:+5:9: +5:10
- scope 5 {
- debug a => _6; // in scope 5 at $DIR/sroa.rs:+5:9: +5:10
- }
- }
- }
- }
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-- _2 = _1; // scope 0 at $DIR/sroa.rs:+1:13: +1:14
-+ StorageLive(_11); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ StorageLive(_12); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ StorageLive(_13); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ StorageLive(_14); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ nop; // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ _11 = (_1.0: u8); // scope 0 at $DIR/sroa.rs:+1:13: +1:14
-+ _12 = (_1.1: ()); // scope 0 at $DIR/sroa.rs:+1:13: +1:14
-+ _13 = (_1.2: &str); // scope 0 at $DIR/sroa.rs:+1:13: +1:14
-+ _14 = (_1.3: std::option::Option<isize>); // scope 0 at $DIR/sroa.rs:+1:13: +1:14
-+ nop; // scope 0 at $DIR/sroa.rs:+1:13: +1:14
- StorageLive(_3); // scope 1 at $DIR/sroa.rs:+2:9: +2:10
-- _3 = (_2.0: u8); // scope 1 at $DIR/sroa.rs:+2:13: +2:16
-+ _3 = _11; // scope 1 at $DIR/sroa.rs:+2:13: +2:16
- StorageLive(_4); // scope 2 at $DIR/sroa.rs:+3:9: +3:10
-- _4 = (_2.2: &str); // scope 2 at $DIR/sroa.rs:+3:13: +3:16
-- StorageLive(_5); // scope 3 at $DIR/sroa.rs:+4:9: +4:10
-- _5 = _2; // scope 3 at $DIR/sroa.rs:+4:13: +4:14
-+ _4 = _13; // scope 2 at $DIR/sroa.rs:+3:13: +3:16
-+ StorageLive(_7); // scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ StorageLive(_8); // scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ StorageLive(_9); // scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ StorageLive(_10); // scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ nop; // scope 3 at $DIR/sroa.rs:+4:9: +4:10
-+ _7 = _11; // scope 3 at $DIR/sroa.rs:+4:13: +4:14
-+ _8 = _12; // scope 3 at $DIR/sroa.rs:+4:13: +4:14
-+ _9 = _13; // scope 3 at $DIR/sroa.rs:+4:13: +4:14
-+ _10 = _14; // scope 3 at $DIR/sroa.rs:+4:13: +4:14
-+ nop; // scope 3 at $DIR/sroa.rs:+4:13: +4:14
- StorageLive(_6); // scope 4 at $DIR/sroa.rs:+5:9: +5:10
-- _6 = (_5.1: ()); // scope 4 at $DIR/sroa.rs:+5:13: +5:16
-+ _6 = _8; // scope 4 at $DIR/sroa.rs:+5:13: +5:16
- _0 = const (); // scope 0 at $DIR/sroa.rs:+0:19: +6:2
- StorageDead(_6); // scope 4 at $DIR/sroa.rs:+6:1: +6:2
-- StorageDead(_5); // scope 3 at $DIR/sroa.rs:+6:1: +6:2
-+ StorageDead(_7); // scope 3 at $DIR/sroa.rs:+6:1: +6:2
-+ StorageDead(_8); // scope 3 at $DIR/sroa.rs:+6:1: +6:2
-+ StorageDead(_9); // scope 3 at $DIR/sroa.rs:+6:1: +6:2
-+ StorageDead(_10); // scope 3 at $DIR/sroa.rs:+6:1: +6:2
-+ nop; // scope 3 at $DIR/sroa.rs:+6:1: +6:2
- StorageDead(_4); // scope 2 at $DIR/sroa.rs:+6:1: +6:2
- StorageDead(_3); // scope 1 at $DIR/sroa.rs:+6:1: +6:2
-- StorageDead(_2); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
-+ StorageDead(_11); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
-+ StorageDead(_12); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
-+ StorageDead(_13); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
-+ StorageDead(_14); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
-+ nop; // scope 0 at $DIR/sroa.rs:+6:1: +6:2
- return; // scope 0 at $DIR/sroa.rs:+6:2: +6:2
- }
- }
-
diff --git a/tests/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index 17a89e7d8..000000000
--- a/tests/mir-opt/sroa.dropping.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-- // MIR for `dropping` before ScalarReplacementOfAggregates
-+ // MIR for `dropping` after ScalarReplacementOfAggregates
-
- fn dropping() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/sroa.rs:+0:19: +0:19
- let _1: Tag; // in scope 0 at $DIR/sroa.rs:+1:5: +1:32
- let mut _2: S; // in scope 0 at $DIR/sroa.rs:+1:5: +1:30
- let mut _3: Tag; // in scope 0 at $DIR/sroa.rs:+1:7: +1:13
- let mut _4: Tag; // in scope 0 at $DIR/sroa.rs:+1:15: +1:21
- let mut _5: Tag; // in scope 0 at $DIR/sroa.rs:+1:23: +1:29
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/sroa.rs:+1:5: +1:32
- StorageLive(_2); // scope 0 at $DIR/sroa.rs:+1:5: +1:30
- StorageLive(_3); // scope 0 at $DIR/sroa.rs:+1:7: +1:13
- _3 = Tag(const 0_usize); // scope 0 at $DIR/sroa.rs:+1:7: +1:13
- StorageLive(_4); // scope 0 at $DIR/sroa.rs:+1:15: +1:21
- _4 = Tag(const 1_usize); // scope 0 at $DIR/sroa.rs:+1:15: +1:21
- StorageLive(_5); // scope 0 at $DIR/sroa.rs:+1:23: +1:29
- _5 = Tag(const 2_usize); // scope 0 at $DIR/sroa.rs:+1:23: +1:29
- _2 = S(move _3, move _4, move _5); // scope 0 at $DIR/sroa.rs:+1:5: +1:30
- StorageDead(_5); // scope 0 at $DIR/sroa.rs:+1:29: +1:30
- StorageDead(_4); // scope 0 at $DIR/sroa.rs:+1:29: +1:30
- StorageDead(_3); // scope 0 at $DIR/sroa.rs:+1:29: +1:30
- _1 = move (_2.1: Tag); // scope 0 at $DIR/sroa.rs:+1:5: +1:32
- drop(_1) -> bb1; // scope 0 at $DIR/sroa.rs:+1:32: +1:33
- }
-
- bb1: {
- drop((_2.0: Tag)) -> bb3; // scope 0 at $DIR/sroa.rs:+1:32: +1:33
- }
-
- bb2: {
- StorageDead(_2); // scope 0 at $DIR/sroa.rs:+1:32: +1:33
- StorageDead(_1); // scope 0 at $DIR/sroa.rs:+1:32: +1:33
- _0 = const (); // scope 0 at $DIR/sroa.rs:+0:19: +2:2
- return; // scope 0 at $DIR/sroa.rs:+2:2: +2:2
- }
-
- bb3: {
- drop((_2.2: Tag)) -> bb2; // scope 0 at $DIR/sroa.rs:+1:32: +1:33
- }
- }
-
diff --git a/tests/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index 04d26162a..000000000
--- a/tests/mir-opt/sroa.enums.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,43 +0,0 @@
-- // MIR for `enums` before ScalarReplacementOfAggregates
-+ // MIR for `enums` after ScalarReplacementOfAggregates
-
- fn enums(_1: usize) -> usize {
- debug a => _1; // in scope 0 at $DIR/sroa.rs:+0:14: +0:15
- let mut _0: usize; // return place in scope 0 at $DIR/sroa.rs:+0:27: +0:32
- let mut _2: std::option::Option<usize>; // in scope 0 at $DIR/sroa.rs:+1:22: +1:29
- let mut _3: usize; // in scope 0 at $DIR/sroa.rs:+1:27: +1:28
- let mut _4: isize; // in scope 0 at $DIR/sroa.rs:+1:12: +1:19
- scope 1 {
- debug a => _5; // in scope 1 at $DIR/sroa.rs:+1:17: +1:18
- let _5: usize; // in scope 1 at $DIR/sroa.rs:+1:17: +1:18
- }
-
- bb0: {
- StorageLive(_2); // scope 1 at $DIR/sroa.rs:+1:22: +1:29
- StorageLive(_3); // scope 1 at $DIR/sroa.rs:+1:27: +1:28
- _3 = _1; // scope 1 at $DIR/sroa.rs:+1:27: +1:28
- _2 = Option::<usize>::Some(move _3); // scope 1 at $DIR/sroa.rs:+1:22: +1:29
- StorageDead(_3); // scope 1 at $DIR/sroa.rs:+1:28: +1:29
- _4 = discriminant(_2); // scope 1 at $DIR/sroa.rs:+1:12: +1:19
- switchInt(move _4) -> [1: bb1, otherwise: bb2]; // scope 1 at $DIR/sroa.rs:+1:12: +1:19
- }
-
- bb1: {
- StorageLive(_5); // scope 1 at $DIR/sroa.rs:+1:17: +1:18
- _5 = ((_2 as Some).0: usize); // scope 1 at $DIR/sroa.rs:+1:17: +1:18
- _0 = _5; // scope 1 at $DIR/sroa.rs:+1:32: +1:33
- StorageDead(_5); // scope 0 at $DIR/sroa.rs:+1:34: +1:35
- goto -> bb3; // scope 0 at $DIR/sroa.rs:+1:5: +1:46
- }
-
- bb2: {
- _0 = const 0_usize; // scope 0 at $DIR/sroa.rs:+1:43: +1:44
- goto -> bb3; // scope 0 at $DIR/sroa.rs:+1:5: +1:46
- }
-
- bb3: {
- StorageDead(_2); // scope 0 at $DIR/sroa.rs:+2:1: +2:2
- return; // scope 0 at $DIR/sroa.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index fd691fdd1..000000000
--- a/tests/mir-opt/sroa.escaping.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-- // MIR for `escaping` before ScalarReplacementOfAggregates
-+ // MIR for `escaping` after ScalarReplacementOfAggregates
-
- fn escaping() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/sroa.rs:+0:19: +0:19
- let _1: (); // in scope 0 at $DIR/sroa.rs:+1:5: +1:42
- let mut _2: *const u32; // in scope 0 at $DIR/sroa.rs:+1:7: +1:41
- let _3: &u32; // in scope 0 at $DIR/sroa.rs:+1:7: +1:41
- let _4: Escaping; // in scope 0 at $DIR/sroa.rs:+1:8: +1:39
- let mut _5: u32; // in scope 0 at $DIR/sroa.rs:+1:34: +1:37
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/sroa.rs:+1:5: +1:42
- StorageLive(_2); // scope 0 at $DIR/sroa.rs:+1:7: +1:41
- StorageLive(_3); // scope 0 at $DIR/sroa.rs:+1:7: +1:41
- StorageLive(_4); // scope 0 at $DIR/sroa.rs:+1:8: +1:39
- StorageLive(_5); // scope 0 at $DIR/sroa.rs:+1:34: +1:37
- _5 = g() -> bb1; // scope 0 at $DIR/sroa.rs:+1:34: +1:37
- // mir::Constant
- // + span: $DIR/sroa.rs:78:34: 78:35
- // + literal: Const { ty: fn() -> u32 {g}, val: Value(<ZST>) }
- }
-
- bb1: {
- _4 = Escaping { a: const 1_u32, b: const 2_u32, c: move _5 }; // scope 0 at $DIR/sroa.rs:+1:8: +1:39
- StorageDead(_5); // scope 0 at $DIR/sroa.rs:+1:38: +1:39
- _3 = &(_4.0: u32); // scope 0 at $DIR/sroa.rs:+1:7: +1:41
- _2 = &raw const (*_3); // scope 0 at $DIR/sroa.rs:+1:7: +1:41
- _1 = f(move _2) -> bb2; // scope 0 at $DIR/sroa.rs:+1:5: +1:42
- // mir::Constant
- // + span: $DIR/sroa.rs:78:5: 78:6
- // + literal: Const { ty: fn(*const u32) {f}, val: Value(<ZST>) }
- }
-
- bb2: {
- StorageDead(_2); // scope 0 at $DIR/sroa.rs:+1:41: +1:42
- StorageDead(_4); // scope 0 at $DIR/sroa.rs:+1:42: +1:43
- StorageDead(_3); // scope 0 at $DIR/sroa.rs:+1:42: +1:43
- StorageDead(_1); // scope 0 at $DIR/sroa.rs:+1:42: +1:43
- _0 = const (); // scope 0 at $DIR/sroa.rs:+0:19: +2:2
- return; // scope 0 at $DIR/sroa.rs:+2:2: +2:2
- }
- }
-
diff --git a/tests/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index 69631fc02..000000000
--- a/tests/mir-opt/sroa.flat.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,80 +0,0 @@
-- // MIR for `flat` before ScalarReplacementOfAggregates
-+ // MIR for `flat` after ScalarReplacementOfAggregates
-
- fn flat() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/sroa.rs:+0:15: +0:15
- let _1: u8; // in scope 0 at $DIR/sroa.rs:+1:15: +1:16
- let _2: (); // in scope 0 at $DIR/sroa.rs:+1:18: +1:19
- let _3: &str; // in scope 0 at $DIR/sroa.rs:+1:21: +1:22
- let _4: std::option::Option<isize>; // in scope 0 at $DIR/sroa.rs:+1:24: +1:25
- let mut _5: Foo; // in scope 0 at $DIR/sroa.rs:+1:30: +1:70
- let mut _6: (); // in scope 0 at $DIR/sroa.rs:+1:45: +1:47
- let mut _7: std::option::Option<isize>; // in scope 0 at $DIR/sroa.rs:+1:60: +1:68
-+ let mut _8: u8; // in scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ let mut _9: (); // in scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ let mut _10: &str; // in scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ let mut _11: std::option::Option<isize>; // in scope 0 at $DIR/sroa.rs:+1:30: +1:70
- scope 1 {
- debug a => _1; // in scope 1 at $DIR/sroa.rs:+1:15: +1:16
- debug b => _2; // in scope 1 at $DIR/sroa.rs:+1:18: +1:19
- debug c => _3; // in scope 1 at $DIR/sroa.rs:+1:21: +1:22
- debug d => _4; // in scope 1 at $DIR/sroa.rs:+1:24: +1:25
- scope 2 {
- scope 3 {
- scope 4 {
- scope 5 {
- }
- }
- }
- }
- }
-
- bb0: {
-- StorageLive(_5); // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ StorageLive(_8); // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ StorageLive(_9); // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ StorageLive(_10); // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ StorageLive(_11); // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ nop; // scope 0 at $DIR/sroa.rs:+1:30: +1:70
- StorageLive(_6); // scope 0 at $DIR/sroa.rs:+1:45: +1:47
- _6 = (); // scope 0 at $DIR/sroa.rs:+1:45: +1:47
- StorageLive(_7); // scope 0 at $DIR/sroa.rs:+1:60: +1:68
- _7 = Option::<isize>::Some(const -4_isize); // scope 0 at $DIR/sroa.rs:+1:60: +1:68
-- _5 = Foo { a: const 5_u8, b: move _6, c: const "a", d: move _7 }; // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ _8 = const 5_u8; // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ _9 = move _6; // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ _10 = const "a"; // scope 0 at $DIR/sroa.rs:+1:30: +1:70
- // mir::Constant
- // + span: $DIR/sroa.rs:53:52: 53:55
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
-+ _11 = move _7; // scope 0 at $DIR/sroa.rs:+1:30: +1:70
-+ nop; // scope 0 at $DIR/sroa.rs:+1:30: +1:70
- StorageDead(_7); // scope 0 at $DIR/sroa.rs:+1:69: +1:70
- StorageDead(_6); // scope 0 at $DIR/sroa.rs:+1:69: +1:70
- StorageLive(_1); // scope 0 at $DIR/sroa.rs:+1:15: +1:16
-- _1 = (_5.0: u8); // scope 0 at $DIR/sroa.rs:+1:15: +1:16
-+ _1 = _8; // scope 0 at $DIR/sroa.rs:+1:15: +1:16
- StorageLive(_2); // scope 0 at $DIR/sroa.rs:+1:18: +1:19
-- _2 = (_5.1: ()); // scope 0 at $DIR/sroa.rs:+1:18: +1:19
-+ _2 = _9; // scope 0 at $DIR/sroa.rs:+1:18: +1:19
- StorageLive(_3); // scope 0 at $DIR/sroa.rs:+1:21: +1:22
-- _3 = (_5.2: &str); // scope 0 at $DIR/sroa.rs:+1:21: +1:22
-+ _3 = _10; // scope 0 at $DIR/sroa.rs:+1:21: +1:22
- StorageLive(_4); // scope 0 at $DIR/sroa.rs:+1:24: +1:25
-- _4 = (_5.3: std::option::Option<isize>); // scope 0 at $DIR/sroa.rs:+1:24: +1:25
-- StorageDead(_5); // scope 0 at $DIR/sroa.rs:+1:70: +1:71
-+ _4 = _11; // scope 0 at $DIR/sroa.rs:+1:24: +1:25
-+ StorageDead(_8); // scope 0 at $DIR/sroa.rs:+1:70: +1:71
-+ StorageDead(_9); // scope 0 at $DIR/sroa.rs:+1:70: +1:71
-+ StorageDead(_10); // scope 0 at $DIR/sroa.rs:+1:70: +1:71
-+ StorageDead(_11); // scope 0 at $DIR/sroa.rs:+1:70: +1:71
-+ nop; // scope 0 at $DIR/sroa.rs:+1:70: +1:71
- _0 = const (); // scope 0 at $DIR/sroa.rs:+0:15: +6:2
- StorageDead(_4); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
- StorageDead(_3); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
- StorageDead(_2); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
- StorageDead(_1); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
- return; // scope 0 at $DIR/sroa.rs:+6:2: +6:2
- }
- }
-
diff --git a/tests/mir-opt/sroa.ref_copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.ref_copies.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index f0d62220d..000000000
--- a/tests/mir-opt/sroa.ref_copies.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,56 +0,0 @@
-- // MIR for `ref_copies` before ScalarReplacementOfAggregates
-+ // MIR for `ref_copies` after ScalarReplacementOfAggregates
-
- fn ref_copies(_1: &Foo) -> () {
- debug x => _1; // in scope 0 at $DIR/sroa.rs:+0:15: +0:16
- let mut _0: (); // return place in scope 0 at $DIR/sroa.rs:+0:24: +0:24
- let _2: Foo; // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ let _5: u8; // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ let _6: (); // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ let _7: &str; // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ let _8: std::option::Option<isize>; // in scope 0 at $DIR/sroa.rs:+1:9: +1:10
- scope 1 {
-- debug y => _2; // in scope 1 at $DIR/sroa.rs:+1:9: +1:10
-+ debug y => Foo{ .0 => _5, .1 => _6, .2 => _7, .3 => _8, }; // in scope 1 at $DIR/sroa.rs:+1:9: +1:10
- let _3: u8; // in scope 1 at $DIR/sroa.rs:+2:9: +2:10
- scope 2 {
- debug t => _3; // in scope 2 at $DIR/sroa.rs:+2:9: +2:10
- let _4: &str; // in scope 2 at $DIR/sroa.rs:+3:9: +3:10
- scope 3 {
- debug u => _4; // in scope 3 at $DIR/sroa.rs:+3:9: +3:10
- }
- }
- }
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-- _2 = (*_1); // scope 0 at $DIR/sroa.rs:+1:13: +1:15
-+ StorageLive(_5); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ StorageLive(_6); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ StorageLive(_7); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ StorageLive(_8); // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ nop; // scope 0 at $DIR/sroa.rs:+1:9: +1:10
-+ _5 = ((*_1).0: u8); // scope 0 at $DIR/sroa.rs:+1:13: +1:15
-+ _6 = ((*_1).1: ()); // scope 0 at $DIR/sroa.rs:+1:13: +1:15
-+ _7 = ((*_1).2: &str); // scope 0 at $DIR/sroa.rs:+1:13: +1:15
-+ _8 = ((*_1).3: std::option::Option<isize>); // scope 0 at $DIR/sroa.rs:+1:13: +1:15
-+ nop; // scope 0 at $DIR/sroa.rs:+1:13: +1:15
- StorageLive(_3); // scope 1 at $DIR/sroa.rs:+2:9: +2:10
-- _3 = (_2.0: u8); // scope 1 at $DIR/sroa.rs:+2:13: +2:16
-+ _3 = _5; // scope 1 at $DIR/sroa.rs:+2:13: +2:16
- StorageLive(_4); // scope 2 at $DIR/sroa.rs:+3:9: +3:10
-- _4 = (_2.2: &str); // scope 2 at $DIR/sroa.rs:+3:13: +3:16
-+ _4 = _7; // scope 2 at $DIR/sroa.rs:+3:13: +3:16
- _0 = const (); // scope 0 at $DIR/sroa.rs:+0:24: +4:2
- StorageDead(_4); // scope 2 at $DIR/sroa.rs:+4:1: +4:2
- StorageDead(_3); // scope 1 at $DIR/sroa.rs:+4:1: +4:2
-- StorageDead(_2); // scope 0 at $DIR/sroa.rs:+4:1: +4:2
-+ StorageDead(_5); // scope 0 at $DIR/sroa.rs:+4:1: +4:2
-+ StorageDead(_6); // scope 0 at $DIR/sroa.rs:+4:1: +4:2
-+ StorageDead(_7); // scope 0 at $DIR/sroa.rs:+4:1: +4:2
-+ StorageDead(_8); // scope 0 at $DIR/sroa.rs:+4:1: +4:2
-+ nop; // scope 0 at $DIR/sroa.rs:+4:1: +4:2
- return; // scope 0 at $DIR/sroa.rs:+4:2: +4:2
- }
- }
-
diff --git a/tests/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index 2c63d8b26..000000000
--- a/tests/mir-opt/sroa.structs.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-- // MIR for `structs` before ScalarReplacementOfAggregates
-+ // MIR for `structs` after ScalarReplacementOfAggregates
-
- fn structs(_1: f32) -> f32 {
- debug a => _1; // in scope 0 at $DIR/sroa.rs:+0:16: +0:17
- let mut _0: f32; // return place in scope 0 at $DIR/sroa.rs:+0:27: +0:30
- let mut _2: structs::U; // in scope 0 at $DIR/sroa.rs:+6:5: +6:21
- let mut _3: f32; // in scope 0 at $DIR/sroa.rs:+6:18: +6:19
-+ let mut _4: usize; // in scope 0 at $DIR/sroa.rs:+6:5: +6:21
-+ let mut _5: f32; // in scope 0 at $DIR/sroa.rs:+6:5: +6:21
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/sroa.rs:+6:5: +6:21
-+ StorageLive(_4); // scope 0 at $DIR/sroa.rs:+6:5: +6:21
-+ StorageLive(_5); // scope 0 at $DIR/sroa.rs:+6:5: +6:21
-+ nop; // scope 0 at $DIR/sroa.rs:+6:5: +6:21
- StorageLive(_3); // scope 0 at $DIR/sroa.rs:+6:18: +6:19
- _3 = _1; // scope 0 at $DIR/sroa.rs:+6:18: +6:19
-- _2 = U { _foo: const 0_usize, a: move _3 }; // scope 0 at $DIR/sroa.rs:+6:5: +6:21
-+ _4 = const 0_usize; // scope 0 at $DIR/sroa.rs:+6:5: +6:21
-+ _5 = move _3; // scope 0 at $DIR/sroa.rs:+6:5: +6:21
-+ nop; // scope 0 at $DIR/sroa.rs:+6:5: +6:21
- StorageDead(_3); // scope 0 at $DIR/sroa.rs:+6:20: +6:21
-- _0 = (_2.1: f32); // scope 0 at $DIR/sroa.rs:+6:5: +6:23
-- StorageDead(_2); // scope 0 at $DIR/sroa.rs:+7:1: +7:2
-+ _0 = _5; // scope 0 at $DIR/sroa.rs:+6:5: +6:23
-+ StorageDead(_4); // scope 0 at $DIR/sroa.rs:+7:1: +7:2
-+ StorageDead(_5); // scope 0 at $DIR/sroa.rs:+7:1: +7:2
-+ nop; // scope 0 at $DIR/sroa.rs:+7:1: +7:2
- return; // scope 0 at $DIR/sroa.rs:+7:2: +7:2
- }
- }
-
diff --git a/tests/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff
deleted file mode 100644
index adfb01385..000000000
--- a/tests/mir-opt/sroa.unions.ScalarReplacementOfAggregates.diff
+++ /dev/null
@@ -1,23 +0,0 @@
-- // MIR for `unions` before ScalarReplacementOfAggregates
-+ // MIR for `unions` after ScalarReplacementOfAggregates
-
- fn unions(_1: f32) -> u32 {
- debug a => _1; // in scope 0 at $DIR/sroa.rs:+0:15: +0:16
- let mut _0: u32; // return place in scope 0 at $DIR/sroa.rs:+0:26: +0:29
- let mut _2: unions::Repr; // in scope 0 at $DIR/sroa.rs:+5:14: +5:27
- let mut _3: f32; // in scope 0 at $DIR/sroa.rs:+5:24: +5:25
- scope 1 {
- }
-
- bb0: {
- StorageLive(_2); // scope 1 at $DIR/sroa.rs:+5:14: +5:27
- StorageLive(_3); // scope 1 at $DIR/sroa.rs:+5:24: +5:25
- _3 = _1; // scope 1 at $DIR/sroa.rs:+5:24: +5:25
- _2 = Repr { f: move _3 }; // scope 1 at $DIR/sroa.rs:+5:14: +5:27
- StorageDead(_3); // scope 1 at $DIR/sroa.rs:+5:26: +5:27
- _0 = (_2.1: u32); // scope 1 at $DIR/sroa.rs:+5:14: +5:29
- StorageDead(_2); // scope 0 at $DIR/sroa.rs:+6:1: +6:2
- return; // scope 0 at $DIR/sroa.rs:+6:2: +6:2
- }
- }
-
diff --git a/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..579587a43
--- /dev/null
+++ b/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,214 @@
+- // MIR for `foo` before ScalarReplacementOfAggregates
++ // 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::ArgumentV1<'_>]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
+ let mut _17: &[core::fmt::ArgumentV1<'_>; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
+ let _18: &[core::fmt::ArgumentV1<'_>; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
+ let _19: [core::fmt::ArgumentV1<'_>; 2]; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL
+ let mut _20: core::fmt::ArgumentV1<'_>; // 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::ArgumentV1<'_>; // 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
+ 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
+ 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
+ scope 3 {
+ debug y => _6; // in scope 3 at $DIR/lifetimes.rs:+7:9: +7:10
+ 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
+ }
+ }
+ }
+ }
+
+ 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>) }
+ }
+
+ 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
+ }
+
+ 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::ArgumentV1::<'_>::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::ArgumentV1<'b> {core::fmt::ArgumentV1::<'_>::new_display::<Box<dyn std::fmt::Display>>}, val: Value(<ZST>) }
+ }
+
+ 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::ArgumentV1::<'_>::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::ArgumentV1<'b> {core::fmt::ArgumentV1::<'_>::new_display::<u32>}, val: Value(<ZST>) }
+ }
+
+ 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::ArgumentV1<'_>] (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::ArgumentV1<'_>]) -> Arguments<'_> {Arguments::<'_>::new_v1}, val: Value(<ZST>) }
+ }
+
+ 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>) }
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ bb11: {
+ switchInt(_27) -> [0: bb10, otherwise: bb12]; // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
+ }
+
+ 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
+ }
+
+ bb13: {
+ drop(_5) -> [return: bb10, unwind unreachable]; // scope 1 at $DIR/lifetimes.rs:+12:1: +12:2
+ }
+ }
+
diff --git a/tests/mir-opt/sroa/lifetimes.rs b/tests/mir-opt/sroa/lifetimes.rs
new file mode 100644
index 000000000..2356d212f
--- /dev/null
+++ b/tests/mir-opt/sroa/lifetimes.rs
@@ -0,0 +1,37 @@
+// unit-test: ScalarReplacementOfAggregates
+// compile-flags: -Cpanic=abort
+// no-prefer-dynamic
+
+trait Err {
+ type Err;
+}
+
+struct Foo<T: Err> {
+ // Check that the `'static` lifetime is erased when creating the local for `x`,
+ // even if we fail to normalize the type.
+ x: Result<Box<dyn std::fmt::Display + 'static>, <T as Err>::Err>,
+ y: u32,
+}
+
+// EMIT_MIR lifetimes.foo.ScalarReplacementOfAggregates.diff
+fn foo<T: Err>() {
+ let foo: Foo<T> = Foo {
+ x: Ok(Box::new(5_u32)),
+ y: 7_u32,
+ };
+
+ let x = foo.x;
+ let y = foo.y;
+
+ if let Ok(x) = x {
+ eprintln!("{x} {y}");
+ }
+}
+
+impl Err for () {
+ type Err = ();
+}
+
+fn main() {
+ foo::<()>()
+}
diff --git a/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..647681f0e
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,46 @@
+- // MIR for `constant` before ScalarReplacementOfAggregates
++ // 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
+ 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
+ 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
+ scope 3 {
+ debug u => _3; // in scope 3 at $DIR/structs.rs:+4:9: +4:10
+ }
+ }
+ }
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..b0b0da886
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,91 @@
+- // MIR for `copies` before ScalarReplacementOfAggregates
++ // 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
+ 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
+ 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
+ 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
+ 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
+ scope 5 {
+ debug a => _6; // in scope 5 at $DIR/structs.rs:+5:9: +5:10
+ }
+ }
+ }
+ }
+ }
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..d378c260a
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.dropping.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,44 @@
+- // MIR for `dropping` before ScalarReplacementOfAggregates
++ // 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
+
+ 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
+ }
+
+ bb1: {
+ drop((_2.0: Tag)) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/structs.rs:+1:32: +1:33
+ }
+
+ 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
+ }
+
+ bb3: {
+ drop((_2.2: Tag)) -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/structs.rs:+1:32: +1:33
+ }
+ }
+
diff --git a/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..ff1e30c2d
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,43 @@
+- // MIR for `enums` before ScalarReplacementOfAggregates
++ // 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
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ bb3: {
+ StorageDead(_2); // scope 0 at $DIR/structs.rs:+2:1: +2:2
+ return; // scope 0 at $DIR/structs.rs:+2:2: +2:2
+ }
+ }
+
diff --git a/tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..3074fcbdf
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.escaping.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,44 @@
+- // MIR for `escaping` before ScalarReplacementOfAggregates
++ // 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
+
+ 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>) }
+ }
+
+ 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>) }
+ }
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..1aa11d17b
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,80 @@
+- // MIR for `flat` before ScalarReplacementOfAggregates
++ // 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
+ 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
+ scope 2 {
+ scope 3 {
+ scope 4 {
+ scope 5 {
+ }
+ }
+ }
+ }
+ }
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..7b09ac182
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,56 @@
+- // MIR for `ref_copies` before ScalarReplacementOfAggregates
++ // 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
+ 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
+ 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
+ scope 3 {
+ debug u => _4; // in scope 3 at $DIR/structs.rs:+3:9: +3:10
+ }
+ }
+ }
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/sroa.rs b/tests/mir-opt/sroa/structs.rs
index fff92cf8d..7946eeaea 100644
--- a/tests/mir-opt/sroa.rs
+++ b/tests/mir-opt/sroa/structs.rs
@@ -111,12 +111,12 @@ fn main() {
constant();
}
-// EMIT_MIR sroa.dropping.ScalarReplacementOfAggregates.diff
-// EMIT_MIR sroa.enums.ScalarReplacementOfAggregates.diff
-// EMIT_MIR sroa.structs.ScalarReplacementOfAggregates.diff
-// EMIT_MIR sroa.unions.ScalarReplacementOfAggregates.diff
-// EMIT_MIR sroa.flat.ScalarReplacementOfAggregates.diff
-// EMIT_MIR sroa.escaping.ScalarReplacementOfAggregates.diff
-// EMIT_MIR sroa.copies.ScalarReplacementOfAggregates.diff
-// EMIT_MIR sroa.ref_copies.ScalarReplacementOfAggregates.diff
-// EMIT_MIR sroa.constant.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.dropping.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.enums.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.structs.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.unions.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.flat.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.escaping.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.copies.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.ref_copies.ScalarReplacementOfAggregates.diff
+// EMIT_MIR structs.constant.ScalarReplacementOfAggregates.diff
diff --git a/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..c94e4b137
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,33 @@
+- // MIR for `structs` before ScalarReplacementOfAggregates
++ // 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
+
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff
new file mode 100644
index 000000000..5aa054589
--- /dev/null
+++ b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff
@@ -0,0 +1,23 @@
+- // MIR for `unions` before ScalarReplacementOfAggregates
++ // 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
+ 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
+ }
+ }
+
diff --git a/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir b/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
index b9cc10575..935dbb28b 100644
--- a/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
+++ b/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
@@ -26,37 +26,37 @@ fn new(_1: Result<T, E>) -> Result<T, E> {
bb0: {
StorageLive(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
_3 = discriminant(_1); // scope 0 at $DIR/try_identity_e2e.rs:+3:19: +3:20
- switchInt(move _3) -> [0: bb2, 1: bb1, otherwise: bb5]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20
+ switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20
}
bb1: {
_5 = move ((_1 as Err).0: E); // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
_2 = ControlFlow::<E, T>::Break(move _5); // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
- goto -> bb3; // scope 0 at $DIR/try_identity_e2e.rs:+5:47: +5:48
+ goto -> bb4; // scope 0 at $DIR/try_identity_e2e.rs:+5:47: +5:48
}
bb2: {
+ unreachable; // scope 0 at $DIR/try_identity_e2e.rs:+3:19: +3:20
+ }
+
+ bb3: {
_4 = move ((_1 as Ok).0: T); // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
_2 = ControlFlow::<E, T>::Continue(move _4); // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
- goto -> bb3; // scope 0 at $DIR/try_identity_e2e.rs:+4:49: +4:50
+ goto -> bb4; // scope 0 at $DIR/try_identity_e2e.rs:+4:49: +4:50
}
- bb3: {
+ bb4: {
_6 = discriminant(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
- switchInt(move _6) -> [0: bb6, 1: bb4, otherwise: bb5]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
+ switchInt(move _6) -> [0: bb6, 1: bb5, otherwise: bb2]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
}
- bb4: {
+ bb5: {
_8 = move ((_2 as Break).0: E); // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
_0 = Result::<T, E>::Err(move _8); // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
StorageDead(_2); // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
return; // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
}
- bb5: {
- unreachable; // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
- }
-
bb6: {
_7 = move ((_2 as Continue).0: T); // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
_0 = Result::<T, E>::Ok(move _7); // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
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 03f37b14b..a0b556640 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
@@ -34,7 +34,7 @@ fn main() -> () {
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: bb5, 5: bb3, otherwise: bb4]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
+ switchInt(move _8) -> [4: bb4, 5: bb3, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
}
bb2: {
@@ -49,22 +49,18 @@ fn main() -> () {
// + 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 -> bb6; // 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
}
bb4: {
- unreachable; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- }
-
- bb5: {
_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 -> bb6; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
+ goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
}
- bb6: {
+ 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
diff --git a/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
index 671e11622..58d6e4281 100644
--- a/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
+++ b/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
@@ -63,7 +63,7 @@
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: bb8, 5: bb6, otherwise: bb7]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
+ switchInt(move _8) -> [4: bb7, 5: bb6, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
}
bb6: {
@@ -74,22 +74,18 @@
// + 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 -> bb9; // 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
}
bb7: {
- unreachable; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
- }
-
- bb8: {
_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 -> bb9; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
+ goto -> bb8; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
}
- bb9: {
+ 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
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 eb2a76ed1..0368b5f18 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
@@ -63,7 +63,7 @@ fn main() -> () {
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: bb7, 3: bb5, otherwise: bb6]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
+ switchInt(move _10) -> [2: bb6, 3: bb5, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
}
bb5: {
@@ -74,14 +74,10 @@ fn main() -> () {
// + 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 -> bb8; // 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
}
bb6: {
- unreachable; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21
- }
-
- bb7: {
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
@@ -89,10 +85,10 @@ fn main() -> () {
// + 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 -> bb8; // 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
}
- bb8: {
+ 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
diff --git a/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
index 4e797774d..73353941f 100644
--- a/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
+++ b/tests/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
@@ -84,8 +84,8 @@
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: bb9, 1: bb10, 2: bb11, 3: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
-+ switchInt(move _10) -> [2: bb11, 3: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +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
}
bb7: {
@@ -96,22 +96,18 @@
// + 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 -> bb12; // 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
}
bb8: {
- unreachable; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21
- }
-
- bb9: {
_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 -> bb12; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+11:24: +11:34
+ goto -> bb11; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+11:24: +11:34
}
- bb10: {
+ 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
@@ -119,10 +115,10 @@
// + 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 -> bb12; // 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
}
- 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
@@ -130,10 +126,10 @@
// + 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 -> bb12; // 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
}
- bb12: {
+ 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
diff --git a/tests/mir-opt/unreachable.main.UnreachablePropagation.diff b/tests/mir-opt/unreachable.main.UnreachablePropagation.diff
index 848bff1d4..323b61346 100644
--- a/tests/mir-opt/unreachable.main.UnreachablePropagation.diff
+++ b/tests/mir-opt/unreachable.main.UnreachablePropagation.diff
@@ -21,7 +21,7 @@
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:9:23: 9:28
+ // + span: $DIR/unreachable.rs:10:23: 10:28
// + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/unreachable.rs b/tests/mir-opt/unreachable.rs
index 6098b525b..97093729d 100644
--- a/tests/mir-opt/unreachable.rs
+++ b/tests/mir-opt/unreachable.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
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
index fb778470e..94bc63361 100644
--- a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
+++ b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
@@ -23,7 +23,7 @@
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:14:25: 14:30
+ // + span: $DIR/unreachable_diverging.rs:15:25: 15:30
// + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(<ZST>) }
}
@@ -44,7 +44,7 @@
bb3: {
_5 = loop_forever() -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:+4:13: +4:27
// mir::Constant
- // + span: $DIR/unreachable_diverging.rs:16:13: 16:25
+ // + span: $DIR/unreachable_diverging.rs:17:13: 17:25
// + literal: Const { ty: fn() {loop_forever}, val: Value(<ZST>) }
}
diff --git a/tests/mir-opt/unreachable_diverging.rs b/tests/mir-opt/unreachable_diverging.rs
index bbf28efc7..24e776148 100644
--- a/tests/mir-opt/unreachable_diverging.rs
+++ b/tests/mir-opt/unreachable_diverging.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
pub enum Empty {}
fn empty() -> Option<Empty> {
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 ed9f3bdbd..c27a93e91 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
@@ -22,7 +22,7 @@ fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
}
bb4 (cleanup): {
- drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb2; // 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]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb5: {
diff --git a/tests/mir-opt/while_storage.rs b/tests/mir-opt/while_storage.rs
index afd083acb..d10048dd9 100644
--- a/tests/mir-opt/while_storage.rs
+++ b/tests/mir-opt/while_storage.rs
@@ -1,3 +1,4 @@
+// ignore-wasm32 compiled with panic=abort by default
// 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
index 318119bd4..811789a60 100644
--- a/tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir
+++ b/tests/mir-opt/while_storage.while_loop.PreCodegen.after.mir
@@ -14,7 +14,7 @@ fn while_loop(_1: bool) -> () {
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:10:11: 10:19
+ // + span: $DIR/while_storage.rs:11:11: 11:19
// + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(<ZST>) }
}
@@ -26,7 +26,7 @@ fn while_loop(_1: bool) -> () {
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:11:12: 11:20
+ // + span: $DIR/while_storage.rs:12:12: 12:20
// + literal: Const { ty: fn(bool) -> bool {get_bool}, val: Value(<ZST>) }
}
diff --git a/tests/pretty/ast-stmt-expr-attr.rs b/tests/pretty/ast-stmt-expr-attr.rs
index 27c86ec22..a958666e3 100644
--- a/tests/pretty/ast-stmt-expr-attr.rs
+++ b/tests/pretty/ast-stmt-expr-attr.rs
@@ -4,7 +4,6 @@ fn main() {}
#[cfg(FALSE)]
fn syntax() {
- let _ = #[attr] box 0;
let _ = #[attr] [];
let _ = #[attr] [0];
let _ = #[attr] [0; 0];
diff --git a/tests/pretty/issue-4264.pp b/tests/pretty/issue-4264.pp
index e0fa1fe28..4020a433d 100644
--- a/tests/pretty/issue-4264.pp
+++ b/tests/pretty/issue-4264.pp
@@ -32,13 +32,11 @@ fn bar() ({
({
let res =
((::alloc::fmt::format as
- for<'a> fn(Arguments<'a>) -> String {format})(((<#[lang = "format_arguments"]>::new_v1
+ for<'a> fn(Arguments<'a>) -> String {format})(((<#[lang = "format_arguments"]>::new_const
as
- fn(&[&'static str], &[core::fmt::ArgumentV1<'_>]) -> Arguments<'_> {Arguments::<'_>::new_v1})((&([("test"
- as &str)] as [&str; 1]) as &[&str; 1]),
- (&([] as [core::fmt::ArgumentV1<'_>; 0]) as
- &[core::fmt::ArgumentV1<'_>; 0])) as Arguments<'_>)) as
- String);
+ fn(&[&'static str]) -> Arguments<'_> {Arguments::<'_>::new_const})((&([("test"
+ as &str)] as [&str; 1]) as &[&str; 1])) as Arguments<'_>))
+ as String);
(res as String)
} as String);
} as ())
diff --git a/tests/pretty/stmt_expr_attributes.rs b/tests/pretty/stmt_expr_attributes.rs
index c01379065..052c45f2c 100644
--- a/tests/pretty/stmt_expr_attributes.rs
+++ b/tests/pretty/stmt_expr_attributes.rs
@@ -1,6 +1,5 @@
// pp-exact
-#![feature(box_syntax)]
#![feature(inline_const)]
#![feature(inline_const_pat)]
#![feature(rustc_attrs)]
@@ -140,7 +139,6 @@ fn _10() {
}
fn _11() {
- let _ = #[rustc_dummy] box 0;
let _: [(); 0] = #[rustc_dummy] [];
let _ = #[rustc_dummy] [0, 0];
let _ = #[rustc_dummy] [0; 0];
diff --git a/tests/pretty/tests-are-sorted.pp b/tests/pretty/tests-are-sorted.pp
index 15dcd4ed9..58f746f2e 100644
--- a/tests/pretty/tests-are-sorted.pp
+++ b/tests/pretty/tests-are-sorted.pp
@@ -4,7 +4,7 @@
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
-// compile-flags: --crate-type=lib --test
+// compile-flags: --crate-type=lib --test --remap-path-prefix={{src-base}}/=/the/src/ --remap-path-prefix={{src-base}}\=/the/src/
// pretty-compare-only
// pretty-mode:expanded
// pp-exact:tests-are-sorted.pp
@@ -18,6 +18,11 @@ pub const m_test: test::TestDescAndFn =
name: test::StaticTestName("m_test"),
ignore: false,
ignore_message: ::core::option::Option::None,
+ source_file: "/the/src/tests-are-sorted.rs",
+ start_line: 7usize,
+ start_col: 4usize,
+ end_line: 7usize,
+ end_col: 10usize,
compile_fail: false,
no_run: false,
should_panic: test::ShouldPanic::No,
@@ -34,8 +39,13 @@ pub const z_test: test::TestDescAndFn =
test::TestDescAndFn {
desc: test::TestDesc {
name: test::StaticTestName("z_test"),
- ignore: false,
- ignore_message: ::core::option::Option::None,
+ ignore: true,
+ ignore_message: ::core::option::Option::Some("not yet implemented"),
+ source_file: "/the/src/tests-are-sorted.rs",
+ start_line: 11usize,
+ start_col: 4usize,
+ end_line: 11usize,
+ end_col: 10usize,
compile_fail: false,
no_run: false,
should_panic: test::ShouldPanic::No,
@@ -43,6 +53,7 @@ pub const z_test: test::TestDescAndFn =
},
testfn: test::StaticTestFn(|| test::assert_test_result(z_test())),
};
+#[ignore = "not yet implemented"]
fn z_test() {}
extern crate test;
@@ -54,6 +65,11 @@ pub const a_test: test::TestDescAndFn =
name: test::StaticTestName("a_test"),
ignore: false,
ignore_message: ::core::option::Option::None,
+ source_file: "/the/src/tests-are-sorted.rs",
+ start_line: 14usize,
+ start_col: 4usize,
+ end_line: 14usize,
+ end_col: 10usize,
compile_fail: false,
no_run: false,
should_panic: test::ShouldPanic::No,
diff --git a/tests/pretty/tests-are-sorted.rs b/tests/pretty/tests-are-sorted.rs
index 1f737d547..39e092225 100644
--- a/tests/pretty/tests-are-sorted.rs
+++ b/tests/pretty/tests-are-sorted.rs
@@ -1,4 +1,4 @@
-// compile-flags: --crate-type=lib --test
+// compile-flags: --crate-type=lib --test --remap-path-prefix={{src-base}}/=/the/src/ --remap-path-prefix={{src-base}}\=/the/src/
// pretty-compare-only
// pretty-mode:expanded
// pp-exact:tests-are-sorted.pp
@@ -7,6 +7,7 @@
fn m_test() {}
#[test]
+#[ignore = "not yet implemented"]
fn z_test() {}
#[test]
diff --git a/tests/run-make-fulldeps/hotplug_codegen_backend/Makefile b/tests/run-make-fulldeps/hotplug_codegen_backend/Makefile
index 4cda243ff..6752091e6 100644
--- a/tests/run-make-fulldeps/hotplug_codegen_backend/Makefile
+++ b/tests/run-make-fulldeps/hotplug_codegen_backend/Makefile
@@ -1,4 +1,4 @@
-include ../tools.mk
+include ../../run-make/tools.mk
# ignore-stage1
diff --git a/tests/run-make-fulldeps/issue-19371/Makefile b/tests/run-make-fulldeps/issue-19371/Makefile
index 994e50801..edec68f08 100644
--- a/tests/run-make-fulldeps/issue-19371/Makefile
+++ b/tests/run-make-fulldeps/issue-19371/Makefile
@@ -1,4 +1,4 @@
-include ../tools.mk
+include ../../run-make/tools.mk
# This test ensures that rustc compile_input can be called twice in one task
# without causing a panic.
diff --git a/tests/run-make-fulldeps/issue-25581/Makefile b/tests/run-make-fulldeps/issue-25581/Makefile
deleted file mode 100644
index 4f5d026f2..000000000
--- a/tests/run-make-fulldeps/issue-25581/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../tools.mk
-
-all: $(call NATIVE_STATICLIB,test)
- $(RUSTC) test.rs
- $(call RUN,test) || exit 1
diff --git a/tests/run-make-fulldeps/obtain-borrowck/Makefile b/tests/run-make-fulldeps/obtain-borrowck/Makefile
index 212d0f67d..233f5c9ea 100644
--- a/tests/run-make-fulldeps/obtain-borrowck/Makefile
+++ b/tests/run-make-fulldeps/obtain-borrowck/Makefile
@@ -1,4 +1,4 @@
-include ../tools.mk
+include ../../run-make/tools.mk
# This example shows how to implement a rustc driver that retrieves MIR bodies
# together with the borrow checker information.
diff --git a/tests/run-make-fulldeps/pretty-expanded/Makefile b/tests/run-make-fulldeps/pretty-expanded/Makefile
index 5a0097a83..48199179e 100644
--- a/tests/run-make-fulldeps/pretty-expanded/Makefile
+++ b/tests/run-make-fulldeps/pretty-expanded/Makefile
@@ -1,4 +1,4 @@
-include ../tools.mk
+include ../../run-make/tools.mk
all:
$(RUSTC) -o $(TMPDIR)/input.expanded.rs -Zunpretty=expanded input.rs
diff --git a/tests/run-make-fulldeps/a-b-a-linker-guard/Makefile b/tests/run-make/a-b-a-linker-guard/Makefile
index adc9e3d09..43282eae0 100644
--- a/tests/run-make-fulldeps/a-b-a-linker-guard/Makefile
+++ b/tests/run-make/a-b-a-linker-guard/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Test that if we build `b` against a version of `a` that has one set
diff --git a/tests/run-make-fulldeps/a-b-a-linker-guard/a.rs b/tests/run-make/a-b-a-linker-guard/a.rs
index aa07b1e71..aa07b1e71 100644
--- a/tests/run-make-fulldeps/a-b-a-linker-guard/a.rs
+++ b/tests/run-make/a-b-a-linker-guard/a.rs
diff --git a/tests/run-make-fulldeps/a-b-a-linker-guard/b.rs b/tests/run-make/a-b-a-linker-guard/b.rs
index f30df120a..f30df120a 100644
--- a/tests/run-make-fulldeps/a-b-a-linker-guard/b.rs
+++ b/tests/run-make/a-b-a-linker-guard/b.rs
diff --git a/tests/run-make-fulldeps/alloc-no-oom-handling/Makefile b/tests/run-make/alloc-no-oom-handling/Makefile
index 87f74c69c..87f74c69c 100644
--- a/tests/run-make-fulldeps/alloc-no-oom-handling/Makefile
+++ b/tests/run-make/alloc-no-oom-handling/Makefile
diff --git a/tests/run-make-fulldeps/alloc-no-rc/Makefile b/tests/run-make/alloc-no-rc/Makefile
index 9824b17e6..9824b17e6 100644
--- a/tests/run-make-fulldeps/alloc-no-rc/Makefile
+++ b/tests/run-make/alloc-no-rc/Makefile
diff --git a/tests/run-make-fulldeps/alloc-no-sync/Makefile b/tests/run-make/alloc-no-sync/Makefile
index 04ec4c7d8..04ec4c7d8 100644
--- a/tests/run-make-fulldeps/alloc-no-sync/Makefile
+++ b/tests/run-make/alloc-no-sync/Makefile
diff --git a/tests/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile b/tests/run-make/allow-non-lint-warnings-cmdline/Makefile
index 60d9c7c37..78b9a7b98 100644
--- a/tests/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile
+++ b/tests/run-make/allow-non-lint-warnings-cmdline/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Test that -A warnings makes the 'empty trait list for derive' warning go away
diff --git a/tests/run-make-fulldeps/allow-non-lint-warnings-cmdline/foo.rs b/tests/run-make/allow-non-lint-warnings-cmdline/foo.rs
index 46e72da2d..46e72da2d 100644
--- a/tests/run-make-fulldeps/allow-non-lint-warnings-cmdline/foo.rs
+++ b/tests/run-make/allow-non-lint-warnings-cmdline/foo.rs
diff --git a/tests/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile b/tests/run-make/allow-warnings-cmdline-stability/Makefile
index 1ce8d0ec2..368a39af6 100644
--- a/tests/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile
+++ b/tests/run-make/allow-warnings-cmdline-stability/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Test that -A warnings makes the 'empty trait list for derive' warning go away
diff --git a/tests/run-make-fulldeps/allow-warnings-cmdline-stability/bar.rs b/tests/run-make/allow-warnings-cmdline-stability/bar.rs
index 3dcfb9dad..3dcfb9dad 100644
--- a/tests/run-make-fulldeps/allow-warnings-cmdline-stability/bar.rs
+++ b/tests/run-make/allow-warnings-cmdline-stability/bar.rs
diff --git a/tests/run-make-fulldeps/allow-warnings-cmdline-stability/foo.rs b/tests/run-make/allow-warnings-cmdline-stability/foo.rs
index 869b54354..869b54354 100644
--- a/tests/run-make-fulldeps/allow-warnings-cmdline-stability/foo.rs
+++ b/tests/run-make/allow-warnings-cmdline-stability/foo.rs
diff --git a/tests/run-make-fulldeps/archive-duplicate-names/Makefile b/tests/run-make/archive-duplicate-names/Makefile
index bbdcd2a34..5433a42d2 100644
--- a/tests/run-make-fulldeps/archive-duplicate-names/Makefile
+++ b/tests/run-make/archive-duplicate-names/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/archive-duplicate-names/bar.c b/tests/run-make/archive-duplicate-names/bar.c
index e42599986..e42599986 100644
--- a/tests/run-make-fulldeps/archive-duplicate-names/bar.c
+++ b/tests/run-make/archive-duplicate-names/bar.c
diff --git a/tests/run-make-fulldeps/archive-duplicate-names/bar.rs b/tests/run-make/archive-duplicate-names/bar.rs
index 994a98c2c..994a98c2c 100644
--- a/tests/run-make-fulldeps/archive-duplicate-names/bar.rs
+++ b/tests/run-make/archive-duplicate-names/bar.rs
diff --git a/tests/run-make-fulldeps/archive-duplicate-names/foo.c b/tests/run-make/archive-duplicate-names/foo.c
index 85e6cd8c3..85e6cd8c3 100644
--- a/tests/run-make-fulldeps/archive-duplicate-names/foo.c
+++ b/tests/run-make/archive-duplicate-names/foo.c
diff --git a/tests/run-make-fulldeps/archive-duplicate-names/foo.rs b/tests/run-make/archive-duplicate-names/foo.rs
index 0bf13c406..0bf13c406 100644
--- a/tests/run-make-fulldeps/archive-duplicate-names/foo.rs
+++ b/tests/run-make/archive-duplicate-names/foo.rs
diff --git a/tests/run-make-fulldeps/return-non-c-like-enum/Makefile b/tests/run-make/arguments-non-c-like-enum/Makefile
index 513311c82..0c8d8bf3a 100644
--- a/tests/run-make-fulldeps/return-non-c-like-enum/Makefile
+++ b/tests/run-make/arguments-non-c-like-enum/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/arguments-non-c-like-enum/nonclike.rs b/tests/run-make/arguments-non-c-like-enum/nonclike.rs
index 57c2c6127..57c2c6127 100644
--- a/tests/run-make-fulldeps/arguments-non-c-like-enum/nonclike.rs
+++ b/tests/run-make/arguments-non-c-like-enum/nonclike.rs
diff --git a/tests/run-make-fulldeps/arguments-non-c-like-enum/test.c b/tests/run-make/arguments-non-c-like-enum/test.c
index 0a1621e49..0a1621e49 100644
--- a/tests/run-make-fulldeps/arguments-non-c-like-enum/test.c
+++ b/tests/run-make/arguments-non-c-like-enum/test.c
diff --git a/tests/run-make-fulldeps/atomic-lock-free/Makefile b/tests/run-make/atomic-lock-free/Makefile
index 37e59624a..37e59624a 100644
--- a/tests/run-make-fulldeps/atomic-lock-free/Makefile
+++ b/tests/run-make/atomic-lock-free/Makefile
diff --git a/tests/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs b/tests/run-make/atomic-lock-free/atomic_lock_free.rs
index 47d90b185..47d90b185 100644
--- a/tests/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs
+++ b/tests/run-make/atomic-lock-free/atomic_lock_free.rs
diff --git a/tests/run-make-fulldeps/bare-outfile/Makefile b/tests/run-make/bare-outfile/Makefile
index 858466e94..23b619ea0 100644
--- a/tests/run-make-fulldeps/bare-outfile/Makefile
+++ b/tests/run-make/bare-outfile/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/bare-outfile/foo.rs b/tests/run-make/bare-outfile/foo.rs
index f79c691f0..f79c691f0 100644
--- a/tests/run-make-fulldeps/bare-outfile/foo.rs
+++ b/tests/run-make/bare-outfile/foo.rs
diff --git a/tests/run-make-fulldeps/c-dynamic-dylib/Makefile b/tests/run-make/c-dynamic-dylib/Makefile
index ac6877892..b5bfbc765 100644
--- a/tests/run-make-fulldeps/c-dynamic-dylib/Makefile
+++ b/tests/run-make/c-dynamic-dylib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-macos
diff --git a/tests/run-make-fulldeps/c-dynamic-dylib/bar.rs b/tests/run-make/c-dynamic-dylib/bar.rs
index b8c798ffd..b8c798ffd 100644
--- a/tests/run-make-fulldeps/c-dynamic-dylib/bar.rs
+++ b/tests/run-make/c-dynamic-dylib/bar.rs
diff --git a/tests/run-make-fulldeps/c-dynamic-dylib/cfoo.c b/tests/run-make/c-dynamic-dylib/cfoo.c
index fea490cf9..fea490cf9 100644
--- a/tests/run-make-fulldeps/c-dynamic-dylib/cfoo.c
+++ b/tests/run-make/c-dynamic-dylib/cfoo.c
diff --git a/tests/run-make-fulldeps/c-dynamic-dylib/foo.rs b/tests/run-make/c-dynamic-dylib/foo.rs
index 9f7a9e221..9f7a9e221 100644
--- a/tests/run-make-fulldeps/c-dynamic-dylib/foo.rs
+++ b/tests/run-make/c-dynamic-dylib/foo.rs
diff --git a/tests/run-make-fulldeps/c-dynamic-rlib/Makefile b/tests/run-make/c-dynamic-rlib/Makefile
index c65d648b9..0475bd8ac 100644
--- a/tests/run-make-fulldeps/c-dynamic-rlib/Makefile
+++ b/tests/run-make/c-dynamic-rlib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-macos
diff --git a/tests/run-make-fulldeps/c-dynamic-rlib/bar.rs b/tests/run-make/c-dynamic-rlib/bar.rs
index b8c798ffd..b8c798ffd 100644
--- a/tests/run-make-fulldeps/c-dynamic-rlib/bar.rs
+++ b/tests/run-make/c-dynamic-rlib/bar.rs
diff --git a/tests/run-make-fulldeps/c-dynamic-rlib/cfoo.c b/tests/run-make/c-dynamic-rlib/cfoo.c
index fea490cf9..fea490cf9 100644
--- a/tests/run-make-fulldeps/c-dynamic-rlib/cfoo.c
+++ b/tests/run-make/c-dynamic-rlib/cfoo.c
diff --git a/tests/run-make-fulldeps/c-dynamic-rlib/foo.rs b/tests/run-make/c-dynamic-rlib/foo.rs
index 3dd376f1f..3dd376f1f 100644
--- a/tests/run-make-fulldeps/c-dynamic-rlib/foo.rs
+++ b/tests/run-make/c-dynamic-rlib/foo.rs
diff --git a/tests/run-make-fulldeps/c-link-to-rust-dylib/Makefile b/tests/run-make/c-link-to-rust-dylib/Makefile
index 2a371b545..2763cb6ed 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-dylib/Makefile
+++ b/tests/run-make/c-link-to-rust-dylib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(TMPDIR)/$(call BIN,bar)
diff --git a/tests/run-make-fulldeps/c-link-to-rust-dylib/bar.c b/tests/run-make/c-link-to-rust-dylib/bar.c
index bb4036b06..bb4036b06 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-dylib/bar.c
+++ b/tests/run-make/c-link-to-rust-dylib/bar.c
diff --git a/tests/run-make-fulldeps/c-link-to-rust-dylib/foo.rs b/tests/run-make/c-link-to-rust-dylib/foo.rs
index f197fa513..f197fa513 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-dylib/foo.rs
+++ b/tests/run-make/c-link-to-rust-dylib/foo.rs
diff --git a/tests/run-make-fulldeps/c-link-to-rust-staticlib/Makefile b/tests/run-make/c-link-to-rust-staticlib/Makefile
index d38bcef30..e14775f5c 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-staticlib/Makefile
+++ b/tests/run-make/c-link-to-rust-staticlib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-freebsd
diff --git a/tests/run-make-fulldeps/c-link-to-rust-staticlib/bar.c b/tests/run-make/c-link-to-rust-staticlib/bar.c
index bb4036b06..bb4036b06 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-staticlib/bar.c
+++ b/tests/run-make/c-link-to-rust-staticlib/bar.c
diff --git a/tests/run-make-fulldeps/c-link-to-rust-staticlib/foo.rs b/tests/run-make/c-link-to-rust-staticlib/foo.rs
index 2e59432cd..2e59432cd 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-staticlib/foo.rs
+++ b/tests/run-make/c-link-to-rust-staticlib/foo.rs
diff --git a/tests/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile b/tests/run-make/c-link-to-rust-va-list-fn/Makefile
index 9ce2a34e6..596c0fce3 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
+++ b/tests/run-make/c-link-to-rust-va-list-fn/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/c-link-to-rust-va-list-fn/checkrust.rs b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
index 5830ef033..5830ef033 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-va-list-fn/checkrust.rs
+++ b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
diff --git a/tests/run-make-fulldeps/c-link-to-rust-va-list-fn/test.c b/tests/run-make/c-link-to-rust-va-list-fn/test.c
index 5bdb51680..5bdb51680 100644
--- a/tests/run-make-fulldeps/c-link-to-rust-va-list-fn/test.c
+++ b/tests/run-make/c-link-to-rust-va-list-fn/test.c
diff --git a/tests/run-make-fulldeps/c-static-dylib/Makefile b/tests/run-make/c-static-dylib/Makefile
index 5b78005e3..4e23edb6c 100644
--- a/tests/run-make-fulldeps/c-static-dylib/Makefile
+++ b/tests/run-make/c-static-dylib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,cfoo)
diff --git a/tests/run-make-fulldeps/c-static-dylib/bar.rs b/tests/run-make/c-static-dylib/bar.rs
index b8c798ffd..b8c798ffd 100644
--- a/tests/run-make-fulldeps/c-static-dylib/bar.rs
+++ b/tests/run-make/c-static-dylib/bar.rs
diff --git a/tests/run-make-fulldeps/c-static-dylib/cfoo.c b/tests/run-make/c-static-dylib/cfoo.c
index 9fe07f82f..9fe07f82f 100644
--- a/tests/run-make-fulldeps/c-static-dylib/cfoo.c
+++ b/tests/run-make/c-static-dylib/cfoo.c
diff --git a/tests/run-make-fulldeps/c-static-dylib/foo.rs b/tests/run-make/c-static-dylib/foo.rs
index 1e8af4d44..1e8af4d44 100644
--- a/tests/run-make-fulldeps/c-static-dylib/foo.rs
+++ b/tests/run-make/c-static-dylib/foo.rs
diff --git a/tests/run-make-fulldeps/c-static-rlib/Makefile b/tests/run-make/c-static-rlib/Makefile
index 11a3cf194..4e351127c 100644
--- a/tests/run-make-fulldeps/c-static-rlib/Makefile
+++ b/tests/run-make/c-static-rlib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,cfoo)
diff --git a/tests/run-make-fulldeps/c-static-rlib/bar.rs b/tests/run-make/c-static-rlib/bar.rs
index b8c798ffd..b8c798ffd 100644
--- a/tests/run-make-fulldeps/c-static-rlib/bar.rs
+++ b/tests/run-make/c-static-rlib/bar.rs
diff --git a/tests/run-make-fulldeps/c-static-rlib/cfoo.c b/tests/run-make/c-static-rlib/cfoo.c
index 9fe07f82f..9fe07f82f 100644
--- a/tests/run-make-fulldeps/c-static-rlib/cfoo.c
+++ b/tests/run-make/c-static-rlib/cfoo.c
diff --git a/tests/run-make-fulldeps/c-static-rlib/foo.rs b/tests/run-make/c-static-rlib/foo.rs
index 9c6d2080e..9c6d2080e 100644
--- a/tests/run-make-fulldeps/c-static-rlib/foo.rs
+++ b/tests/run-make/c-static-rlib/foo.rs
diff --git a/tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile b/tests/run-make/c-unwind-abi-catch-lib-panic/Makefile
index 134f000d4..9c41a5a71 100644
--- a/tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile
+++ b/tests/run-make/c-unwind-abi-catch-lib-panic/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: archive
diff --git a/tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/add.c b/tests/run-make/c-unwind-abi-catch-lib-panic/add.c
index 444359451..444359451 100644
--- a/tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/add.c
+++ b/tests/run-make/c-unwind-abi-catch-lib-panic/add.c
diff --git a/tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/main.rs b/tests/run-make/c-unwind-abi-catch-lib-panic/main.rs
index 78a71219c..78a71219c 100644
--- a/tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/main.rs
+++ b/tests/run-make/c-unwind-abi-catch-lib-panic/main.rs
diff --git a/tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/panic.rs b/tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs
index a99a04d5c..a99a04d5c 100644
--- a/tests/run-make-fulldeps/c-unwind-abi-catch-lib-panic/panic.rs
+++ b/tests/run-make/c-unwind-abi-catch-lib-panic/panic.rs
diff --git a/tests/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile b/tests/run-make/c-unwind-abi-catch-panic/Makefile
index e93ec99da..4398ac2ee 100644
--- a/tests/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile
+++ b/tests/run-make/c-unwind-abi-catch-panic/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,add)
diff --git a/tests/run-make-fulldeps/c-unwind-abi-catch-panic/add.c b/tests/run-make/c-unwind-abi-catch-panic/add.c
index 444359451..444359451 100644
--- a/tests/run-make-fulldeps/c-unwind-abi-catch-panic/add.c
+++ b/tests/run-make/c-unwind-abi-catch-panic/add.c
diff --git a/tests/run-make-fulldeps/c-unwind-abi-catch-panic/main.rs b/tests/run-make/c-unwind-abi-catch-panic/main.rs
index 15d38d721..15d38d721 100644
--- a/tests/run-make-fulldeps/c-unwind-abi-catch-panic/main.rs
+++ b/tests/run-make/c-unwind-abi-catch-panic/main.rs
diff --git a/tests/run-make-fulldeps/cat-and-grep-sanity-check/Makefile b/tests/run-make/cat-and-grep-sanity-check/Makefile
index 82351e220..82351e220 100644
--- a/tests/run-make-fulldeps/cat-and-grep-sanity-check/Makefile
+++ b/tests/run-make/cat-and-grep-sanity-check/Makefile
diff --git a/tests/run-make-fulldeps/cdylib-dylib-linkage/Makefile b/tests/run-make/cdylib-dylib-linkage/Makefile
index 5c9b2d1bb..51fbfef2d 100644
--- a/tests/run-make-fulldeps/cdylib-dylib-linkage/Makefile
+++ b/tests/run-make/cdylib-dylib-linkage/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
TARGET_SYSROOT := $(shell $(RUSTC) --print sysroot)/lib/rustlib/$(TARGET)/lib
diff --git a/tests/run-make-fulldeps/cdylib-dylib-linkage/bar.rs b/tests/run-make/cdylib-dylib-linkage/bar.rs
index b3a7539ab..b3a7539ab 100644
--- a/tests/run-make-fulldeps/cdylib-dylib-linkage/bar.rs
+++ b/tests/run-make/cdylib-dylib-linkage/bar.rs
diff --git a/tests/run-make-fulldeps/cdylib-dylib-linkage/foo.c b/tests/run-make/cdylib-dylib-linkage/foo.c
index 154f9682e..154f9682e 100644
--- a/tests/run-make-fulldeps/cdylib-dylib-linkage/foo.c
+++ b/tests/run-make/cdylib-dylib-linkage/foo.c
diff --git a/tests/run-make-fulldeps/cdylib-dylib-linkage/foo.rs b/tests/run-make/cdylib-dylib-linkage/foo.rs
index c4069495a..c4069495a 100644
--- a/tests/run-make-fulldeps/cdylib-dylib-linkage/foo.rs
+++ b/tests/run-make/cdylib-dylib-linkage/foo.rs
diff --git a/tests/run-make-fulldeps/cdylib-fewer-symbols/Makefile b/tests/run-make/cdylib-fewer-symbols/Makefile
index 324791af8..4e08f979c 100644
--- a/tests/run-make-fulldeps/cdylib-fewer-symbols/Makefile
+++ b/tests/run-make/cdylib-fewer-symbols/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
# Test that allocator-related symbols don't show up as exported from a cdylib as
# they're internal to Rust and not part of the public ABI.
diff --git a/tests/run-make-fulldeps/cdylib-fewer-symbols/foo.rs b/tests/run-make/cdylib-fewer-symbols/foo.rs
index af37bc8e9..af37bc8e9 100644
--- a/tests/run-make-fulldeps/cdylib-fewer-symbols/foo.rs
+++ b/tests/run-make/cdylib-fewer-symbols/foo.rs
diff --git a/tests/run-make-fulldeps/cdylib/Makefile b/tests/run-make/cdylib/Makefile
index 47ec762b3..3c8b52695 100644
--- a/tests/run-make-fulldeps/cdylib/Makefile
+++ b/tests/run-make/cdylib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call RUN_BINFILE,foo)
diff --git a/tests/run-make-fulldeps/cdylib/bar.rs b/tests/run-make/cdylib/bar.rs
index fe665abc7..fe665abc7 100644
--- a/tests/run-make-fulldeps/cdylib/bar.rs
+++ b/tests/run-make/cdylib/bar.rs
diff --git a/tests/run-make-fulldeps/cdylib/foo.c b/tests/run-make/cdylib/foo.c
index 154f9682e..154f9682e 100644
--- a/tests/run-make-fulldeps/cdylib/foo.c
+++ b/tests/run-make/cdylib/foo.c
diff --git a/tests/run-make-fulldeps/cdylib/foo.rs b/tests/run-make/cdylib/foo.rs
index c4069495a..c4069495a 100644
--- a/tests/run-make-fulldeps/cdylib/foo.rs
+++ b/tests/run-make/cdylib/foo.rs
diff --git a/tests/run-make-fulldeps/codegen-options-parsing/Makefile b/tests/run-make/codegen-options-parsing/Makefile
index b063593c9..56bb900b7 100644
--- a/tests/run-make-fulldeps/codegen-options-parsing/Makefile
+++ b/tests/run-make/codegen-options-parsing/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/codegen-options-parsing/dummy.rs b/tests/run-make/codegen-options-parsing/dummy.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/codegen-options-parsing/dummy.rs
+++ b/tests/run-make/codegen-options-parsing/dummy.rs
diff --git a/tests/run-make-fulldeps/compile-stdin/Makefile b/tests/run-make/compile-stdin/Makefile
index be1554869..2a495281c 100644
--- a/tests/run-make-fulldeps/compile-stdin/Makefile
+++ b/tests/run-make/compile-stdin/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths-2/Makefile b/tests/run-make/compiler-lookup-paths-2/Makefile
index d4ff7d8da..d4ff7d8da 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths-2/Makefile
+++ b/tests/run-make/compiler-lookup-paths-2/Makefile
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths-2/a.rs b/tests/run-make/compiler-lookup-paths-2/a.rs
index 83be6e807..83be6e807 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths-2/a.rs
+++ b/tests/run-make/compiler-lookup-paths-2/a.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths-2/b.rs b/tests/run-make/compiler-lookup-paths-2/b.rs
index 1be6cbc91..1be6cbc91 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths-2/b.rs
+++ b/tests/run-make/compiler-lookup-paths-2/b.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths-2/c.rs b/tests/run-make/compiler-lookup-paths-2/c.rs
index e37bc2e1d..e37bc2e1d 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths-2/c.rs
+++ b/tests/run-make/compiler-lookup-paths-2/c.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/Makefile b/tests/run-make/compiler-lookup-paths/Makefile
index c16bf7af6..310d6772c 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/Makefile
+++ b/tests/run-make/compiler-lookup-paths/Makefile
@@ -1,5 +1,8 @@
include ../tools.mk
+# ignore-wasm32 (need a C compiler)
+# ignore-wasm64 (need a C compiler)
+
all: $(TMPDIR)/libnative.a
mkdir -p $(TMPDIR)/crate
mkdir -p $(TMPDIR)/native
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/a.rs b/tests/run-make/compiler-lookup-paths/a.rs
index 83be6e807..83be6e807 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/a.rs
+++ b/tests/run-make/compiler-lookup-paths/a.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/b.rs b/tests/run-make/compiler-lookup-paths/b.rs
index 1be6cbc91..1be6cbc91 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/b.rs
+++ b/tests/run-make/compiler-lookup-paths/b.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/c.rs b/tests/run-make/compiler-lookup-paths/c.rs
index 4c7ce01b6..4c7ce01b6 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/c.rs
+++ b/tests/run-make/compiler-lookup-paths/c.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/d.rs b/tests/run-make/compiler-lookup-paths/d.rs
index 6cd9916b6..6cd9916b6 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/d.rs
+++ b/tests/run-make/compiler-lookup-paths/d.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/e.rs b/tests/run-make/compiler-lookup-paths/e.rs
index 18eb60aca..18eb60aca 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/e.rs
+++ b/tests/run-make/compiler-lookup-paths/e.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/e2.rs b/tests/run-make/compiler-lookup-paths/e2.rs
index cbf08b98e..cbf08b98e 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/e2.rs
+++ b/tests/run-make/compiler-lookup-paths/e2.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/f.rs b/tests/run-make/compiler-lookup-paths/f.rs
index 483deaaea..483deaaea 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/f.rs
+++ b/tests/run-make/compiler-lookup-paths/f.rs
diff --git a/tests/run-make-fulldeps/compiler-lookup-paths/native.c b/tests/run-make/compiler-lookup-paths/native.c
index d11c69f81..d11c69f81 100644
--- a/tests/run-make-fulldeps/compiler-lookup-paths/native.c
+++ b/tests/run-make/compiler-lookup-paths/native.c
diff --git a/tests/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile b/tests/run-make/compiler-rt-works-on-mingw/Makefile
index 74917570a..74917570a 100644
--- a/tests/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile
+++ b/tests/run-make/compiler-rt-works-on-mingw/Makefile
diff --git a/tests/run-make-fulldeps/compiler-rt-works-on-mingw/foo.cpp b/tests/run-make/compiler-rt-works-on-mingw/foo.cpp
index 4c2fb9cdb..4c2fb9cdb 100644
--- a/tests/run-make-fulldeps/compiler-rt-works-on-mingw/foo.cpp
+++ b/tests/run-make/compiler-rt-works-on-mingw/foo.cpp
diff --git a/tests/run-make-fulldeps/compiler-rt-works-on-mingw/foo.rs b/tests/run-make/compiler-rt-works-on-mingw/foo.rs
index 7fdb81588..7fdb81588 100644
--- a/tests/run-make-fulldeps/compiler-rt-works-on-mingw/foo.rs
+++ b/tests/run-make/compiler-rt-works-on-mingw/foo.rs
diff --git a/tests/run-make/const_fn_mir/Makefile b/tests/run-make/const_fn_mir/Makefile
index ad5695093..b2c268f04 100644
--- a/tests/run-make/const_fn_mir/Makefile
+++ b/tests/run-make/const_fn_mir/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) main.rs --emit=mir -o "$(TMPDIR)"/dump.mir
diff --git a/tests/run-make/const_fn_mir/dump.mir b/tests/run-make/const_fn_mir/dump.mir
index ab4084c95..9cc70d3b0 100644
--- a/tests/run-make/const_fn_mir/dump.mir
+++ b/tests/run-make/const_fn_mir/dump.mir
@@ -2,9 +2,15 @@
// 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
bb0: {
- _0 = const 11_i32; // scope 0 at main.rs:5:5: 5:10
+ _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
+ }
+
+ 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
}
}
diff --git a/tests/run-make-fulldeps/core-no-fp-fmt-parse/Makefile b/tests/run-make/core-no-fp-fmt-parse/Makefile
index 837664d92..837664d92 100644
--- a/tests/run-make-fulldeps/core-no-fp-fmt-parse/Makefile
+++ b/tests/run-make/core-no-fp-fmt-parse/Makefile
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.abort.txt b/tests/run-make/coverage-reports/expected_show_coverage.abort.txt
index 00f46f42a..a71c58d61 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.abort.txt
+++ b/tests/run-make/coverage-reports/expected_show_coverage.abort.txt
@@ -32,7 +32,7 @@
30| |// Notes:
31| |// 1. Compare this program and its coverage results to those of the similar tests
32| |// `panic_unwind.rs` and `try_error_result.rs`.
- 33| |// 2. This test confirms the coverage generated when a program includes `TerminatorKind::Abort`.
+ 33| |// 2. This test confirms the coverage generated when a program includes `UnwindAction::Terminate`.
34| |// 3. The test does not invoke the abort. By executing to a successful completion, the coverage
35| |// results show where the program did and did not execute.
36| |// 4. If the program actually aborted, the coverage counters would not be saved (which "works as
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.closure.txt b/tests/run-make/coverage-reports/expected_show_coverage.closure.txt
index e463099a5..002ecec3b 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.closure.txt
+++ b/tests/run-make/coverage-reports/expected_show_coverage.closure.txt
@@ -29,8 +29,8 @@
29| 1| some_string = Some(String::from("the string content"));
30| 1| let
31| 1| a
- 32| 1| =
- 33| 1| ||
+ 32| | =
+ 33| | ||
34| 0| {
35| 0| let mut countdown = 0;
36| 0| if is_false {
diff --git a/tests/run-make/coverage-reports/expected_show_coverage.continue.txt b/tests/run-make/coverage-reports/expected_show_coverage.continue.txt
index 1c64ead9f..bf42924b1 100644
--- a/tests/run-make/coverage-reports/expected_show_coverage.continue.txt
+++ b/tests/run-make/coverage-reports/expected_show_coverage.continue.txt
@@ -65,6 +65,6 @@
65| | }
66| 0| x = 3;
67| | }
- 68| | let _ = x;
+ 68| 1| let _ = x;
69| 1|}
diff --git a/tests/run-make/coverage/abort.rs b/tests/run-make/coverage/abort.rs
index 3dac43df8..98264bdc1 100644
--- a/tests/run-make/coverage/abort.rs
+++ b/tests/run-make/coverage/abort.rs
@@ -30,7 +30,7 @@ fn main() -> Result<(), u8> {
// Notes:
// 1. Compare this program and its coverage results to those of the similar tests
// `panic_unwind.rs` and `try_error_result.rs`.
-// 2. This test confirms the coverage generated when a program includes `TerminatorKind::Abort`.
+// 2. This test confirms the coverage generated when a program includes `UnwindAction::Terminate`.
// 3. The test does not invoke the abort. By executing to a successful completion, the coverage
// results show where the program did and did not execute.
// 4. If the program actually aborted, the coverage counters would not be saved (which "works as
diff --git a/tests/run-make/coverage/coverage_tools.mk b/tests/run-make/coverage/coverage_tools.mk
index 0b6bbc331..028c020a4 100644
--- a/tests/run-make/coverage/coverage_tools.mk
+++ b/tests/run-make/coverage/coverage_tools.mk
@@ -3,4 +3,4 @@
#
# include ../coverage/coverage_tools.mk
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
diff --git a/tests/run-make-fulldeps/crate-data-smoke/Makefile b/tests/run-make/crate-data-smoke/Makefile
index a453f65ff..a453f65ff 100644
--- a/tests/run-make-fulldeps/crate-data-smoke/Makefile
+++ b/tests/run-make/crate-data-smoke/Makefile
diff --git a/tests/run-make-fulldeps/crate-data-smoke/crate.rs b/tests/run-make/crate-data-smoke/crate.rs
index a48a6f51c..a48a6f51c 100644
--- a/tests/run-make-fulldeps/crate-data-smoke/crate.rs
+++ b/tests/run-make/crate-data-smoke/crate.rs
diff --git a/tests/run-make-fulldeps/crate-data-smoke/lib.rs b/tests/run-make/crate-data-smoke/lib.rs
index 8002f11ec..8002f11ec 100644
--- a/tests/run-make-fulldeps/crate-data-smoke/lib.rs
+++ b/tests/run-make/crate-data-smoke/lib.rs
diff --git a/tests/run-make-fulldeps/crate-data-smoke/rlib.rs b/tests/run-make/crate-data-smoke/rlib.rs
index 47fcce4a7..47fcce4a7 100644
--- a/tests/run-make-fulldeps/crate-data-smoke/rlib.rs
+++ b/tests/run-make/crate-data-smoke/rlib.rs
diff --git a/tests/run-make-fulldeps/crate-hash-rustc-version/Makefile b/tests/run-make/crate-hash-rustc-version/Makefile
index 4f25a865e..f1d2a3604 100644
--- a/tests/run-make-fulldeps/crate-hash-rustc-version/Makefile
+++ b/tests/run-make/crate-hash-rustc-version/Makefile
@@ -1,4 +1,5 @@
-include ../../run-make-fulldeps/tools.mk
+# ignore-cross-compile
+include ../tools.mk
# Ensure that crates compiled with different rustc versions cannot
# be dynamically linked.
diff --git a/tests/run-make-fulldeps/crate-hash-rustc-version/a.rs b/tests/run-make/crate-hash-rustc-version/a.rs
index d65b5ce8e..d65b5ce8e 100644
--- a/tests/run-make-fulldeps/crate-hash-rustc-version/a.rs
+++ b/tests/run-make/crate-hash-rustc-version/a.rs
diff --git a/tests/run-make-fulldeps/crate-hash-rustc-version/b.rs b/tests/run-make/crate-hash-rustc-version/b.rs
index 316ac26e7..316ac26e7 100644
--- a/tests/run-make-fulldeps/crate-hash-rustc-version/b.rs
+++ b/tests/run-make/crate-hash-rustc-version/b.rs
diff --git a/tests/run-make-fulldeps/crate-name-priority/Makefile b/tests/run-make/crate-name-priority/Makefile
index 08a07c325..4adaa75a7 100644
--- a/tests/run-make-fulldeps/crate-name-priority/Makefile
+++ b/tests/run-make/crate-name-priority/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/crate-name-priority/foo.rs b/tests/run-make/crate-name-priority/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/crate-name-priority/foo.rs
+++ b/tests/run-make/crate-name-priority/foo.rs
diff --git a/tests/run-make-fulldeps/crate-name-priority/foo1.rs b/tests/run-make/crate-name-priority/foo1.rs
index 4ff3bd951..4ff3bd951 100644
--- a/tests/run-make-fulldeps/crate-name-priority/foo1.rs
+++ b/tests/run-make/crate-name-priority/foo1.rs
diff --git a/tests/run-make-fulldeps/cross-lang-lto-clang/Makefile b/tests/run-make/cross-lang-lto-clang/Makefile
index acaebf439..acaebf439 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-clang/Makefile
+++ b/tests/run-make/cross-lang-lto-clang/Makefile
diff --git a/tests/run-make-fulldeps/cross-lang-lto-clang/clib.c b/tests/run-make/cross-lang-lto-clang/clib.c
index 90f33f24d..90f33f24d 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-clang/clib.c
+++ b/tests/run-make/cross-lang-lto-clang/clib.c
diff --git a/tests/run-make-fulldeps/cross-lang-lto-clang/cmain.c b/tests/run-make/cross-lang-lto-clang/cmain.c
index e62a40117..e62a40117 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-clang/cmain.c
+++ b/tests/run-make/cross-lang-lto-clang/cmain.c
diff --git a/tests/run-make-fulldeps/cross-lang-lto-clang/main.rs b/tests/run-make/cross-lang-lto-clang/main.rs
index 8129dcb85..8129dcb85 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-clang/main.rs
+++ b/tests/run-make/cross-lang-lto-clang/main.rs
diff --git a/tests/run-make-fulldeps/cross-lang-lto-clang/rustlib.rs b/tests/run-make/cross-lang-lto-clang/rustlib.rs
index 8a74d74a4..8a74d74a4 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-clang/rustlib.rs
+++ b/tests/run-make/cross-lang-lto-clang/rustlib.rs
diff --git a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile b/tests/run-make/cross-lang-lto-pgo-smoketest/Makefile
index 70085d9bd..70085d9bd 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest/Makefile
diff --git a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/clib.c b/tests/run-make/cross-lang-lto-pgo-smoketest/clib.c
index 90f33f24d..90f33f24d 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/clib.c
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest/clib.c
diff --git a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/cmain.c b/tests/run-make/cross-lang-lto-pgo-smoketest/cmain.c
index e3f24828b..e3f24828b 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/cmain.c
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest/cmain.c
diff --git a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/main.rs b/tests/run-make/cross-lang-lto-pgo-smoketest/main.rs
index 8129dcb85..8129dcb85 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/main.rs
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest/main.rs
diff --git a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/rustlib.rs b/tests/run-make/cross-lang-lto-pgo-smoketest/rustlib.rs
index 8a74d74a4..8a74d74a4 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-pgo-smoketest/rustlib.rs
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest/rustlib.rs
diff --git a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile b/tests/run-make/cross-lang-lto-upstream-rlibs/Makefile
index 6f1caa31a..6f1caa31a 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile
+++ b/tests/run-make/cross-lang-lto-upstream-rlibs/Makefile
diff --git a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs b/tests/run-make/cross-lang-lto-upstream-rlibs/staticlib.rs
index 34951dda3..34951dda3 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs
+++ b/tests/run-make/cross-lang-lto-upstream-rlibs/staticlib.rs
diff --git a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/upstream.rs b/tests/run-make/cross-lang-lto-upstream-rlibs/upstream.rs
index bd6820098..bd6820098 100644
--- a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/upstream.rs
+++ b/tests/run-make/cross-lang-lto-upstream-rlibs/upstream.rs
diff --git a/tests/run-make-fulldeps/cross-lang-lto/Makefile b/tests/run-make/cross-lang-lto/Makefile
index 92058f952..92058f952 100644
--- a/tests/run-make-fulldeps/cross-lang-lto/Makefile
+++ b/tests/run-make/cross-lang-lto/Makefile
diff --git a/tests/run-make-fulldeps/cross-lang-lto/lib.rs b/tests/run-make/cross-lang-lto/lib.rs
index 94cfef6ad..94cfef6ad 100644
--- a/tests/run-make-fulldeps/cross-lang-lto/lib.rs
+++ b/tests/run-make/cross-lang-lto/lib.rs
diff --git a/tests/run-make-fulldeps/cross-lang-lto/main.rs b/tests/run-make/cross-lang-lto/main.rs
index f6320bcb0..f6320bcb0 100644
--- a/tests/run-make-fulldeps/cross-lang-lto/main.rs
+++ b/tests/run-make/cross-lang-lto/main.rs
diff --git a/tests/run-make-fulldeps/debug-assertions/Makefile b/tests/run-make/debug-assertions/Makefile
index 73beb4b03..e83337c59 100644
--- a/tests/run-make-fulldeps/debug-assertions/Makefile
+++ b/tests/run-make/debug-assertions/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/debug-assertions/debug.rs b/tests/run-make/debug-assertions/debug.rs
index 76ca60a71..76ca60a71 100644
--- a/tests/run-make-fulldeps/debug-assertions/debug.rs
+++ b/tests/run-make/debug-assertions/debug.rs
diff --git a/tests/run-make/dep-graph/Makefile b/tests/run-make/dep-graph/Makefile
index ae97b1672..d06333f44 100644
--- a/tests/run-make/dep-graph/Makefile
+++ b/tests/run-make/dep-graph/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-cross-compile
diff --git a/tests/run-make-fulldeps/dep-info-doesnt-run-much/Makefile b/tests/run-make/dep-info-doesnt-run-much/Makefile
index b4dc44ad2..b4dc44ad2 100644
--- a/tests/run-make-fulldeps/dep-info-doesnt-run-much/Makefile
+++ b/tests/run-make/dep-info-doesnt-run-much/Makefile
diff --git a/tests/run-make-fulldeps/dep-info-doesnt-run-much/foo.rs b/tests/run-make/dep-info-doesnt-run-much/foo.rs
index 316e68129..316e68129 100644
--- a/tests/run-make-fulldeps/dep-info-doesnt-run-much/foo.rs
+++ b/tests/run-make/dep-info-doesnt-run-much/foo.rs
diff --git a/tests/run-make-fulldeps/dep-info-spaces/Makefile b/tests/run-make/dep-info-spaces/Makefile
index 0cfe513e4..0cfe513e4 100644
--- a/tests/run-make-fulldeps/dep-info-spaces/Makefile
+++ b/tests/run-make/dep-info-spaces/Makefile
diff --git a/tests/run-make-fulldeps/dep-info-spaces/Makefile.foo b/tests/run-make/dep-info-spaces/Makefile.foo
index 80a5d4333..80a5d4333 100644
--- a/tests/run-make-fulldeps/dep-info-spaces/Makefile.foo
+++ b/tests/run-make/dep-info-spaces/Makefile.foo
diff --git a/tests/run-make-fulldeps/dep-info-spaces/bar.rs b/tests/run-make/dep-info-spaces/bar.rs
index c5c0bc606..c5c0bc606 100644
--- a/tests/run-make-fulldeps/dep-info-spaces/bar.rs
+++ b/tests/run-make/dep-info-spaces/bar.rs
diff --git a/tests/run-make-fulldeps/dep-info-spaces/foo foo.rs b/tests/run-make/dep-info-spaces/foo foo.rs
index b76b4321d..b76b4321d 100644
--- a/tests/run-make-fulldeps/dep-info-spaces/foo foo.rs
+++ b/tests/run-make/dep-info-spaces/foo foo.rs
diff --git a/tests/run-make-fulldeps/dep-info-spaces/lib.rs b/tests/run-make/dep-info-spaces/lib.rs
index 6264e7b67..6264e7b67 100644
--- a/tests/run-make-fulldeps/dep-info-spaces/lib.rs
+++ b/tests/run-make/dep-info-spaces/lib.rs
diff --git a/tests/run-make-fulldeps/dep-info/Makefile b/tests/run-make/dep-info/Makefile
index c76f43a8e..c76f43a8e 100644
--- a/tests/run-make-fulldeps/dep-info/Makefile
+++ b/tests/run-make/dep-info/Makefile
diff --git a/tests/run-make-fulldeps/dep-info/Makefile.foo b/tests/run-make/dep-info/Makefile.foo
index e5df31f88..e5df31f88 100644
--- a/tests/run-make-fulldeps/dep-info/Makefile.foo
+++ b/tests/run-make/dep-info/Makefile.foo
diff --git a/tests/run-make-fulldeps/dep-info/bar.rs b/tests/run-make/dep-info/bar.rs
index c5c0bc606..c5c0bc606 100644
--- a/tests/run-make-fulldeps/dep-info/bar.rs
+++ b/tests/run-make/dep-info/bar.rs
diff --git a/tests/run-make-fulldeps/dep-info/foo.rs b/tests/run-make/dep-info/foo.rs
index b76b4321d..b76b4321d 100644
--- a/tests/run-make-fulldeps/dep-info/foo.rs
+++ b/tests/run-make/dep-info/foo.rs
diff --git a/tests/run-make-fulldeps/dep-info/lib.rs b/tests/run-make/dep-info/lib.rs
index eb8631259..eb8631259 100644
--- a/tests/run-make-fulldeps/dep-info/lib.rs
+++ b/tests/run-make/dep-info/lib.rs
diff --git a/tests/run-make-fulldeps/dep-info/lib2.rs b/tests/run-make/dep-info/lib2.rs
index f4fda9c93..f4fda9c93 100644
--- a/tests/run-make-fulldeps/dep-info/lib2.rs
+++ b/tests/run-make/dep-info/lib2.rs
diff --git a/tests/run-make-fulldeps/doctests-keep-binaries/Makefile b/tests/run-make/doctests-keep-binaries/Makefile
index 273c8980b..6254e93d3 100644
--- a/tests/run-make-fulldeps/doctests-keep-binaries/Makefile
+++ b/tests/run-make/doctests-keep-binaries/Makefile
@@ -1,4 +1,5 @@
-include ../../run-make-fulldeps/tools.mk
+# ignore-cross-compile
+include ../tools.mk
# Check that valid binaries are persisted by running them, regardless of whether the --run or --no-run option is used.
diff --git a/tests/run-make-fulldeps/doctests-keep-binaries/t.rs b/tests/run-make/doctests-keep-binaries/t.rs
index c38cf0a0b..c38cf0a0b 100644
--- a/tests/run-make-fulldeps/doctests-keep-binaries/t.rs
+++ b/tests/run-make/doctests-keep-binaries/t.rs
diff --git a/tests/run-make/dump-mono-stats/Makefile b/tests/run-make/dump-mono-stats/Makefile
index fe1112fb0..196f84be6 100644
--- a/tests/run-make/dump-mono-stats/Makefile
+++ b/tests/run-make/dump-mono-stats/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type lib foo.rs -Z dump-mono-stats=$(TMPDIR) -Zdump-mono-stats-format=json
diff --git a/tests/run-make-fulldeps/duplicate-output-flavors/Makefile b/tests/run-make/duplicate-output-flavors/Makefile
index e33279966..e33279966 100644
--- a/tests/run-make-fulldeps/duplicate-output-flavors/Makefile
+++ b/tests/run-make/duplicate-output-flavors/Makefile
diff --git a/tests/run-make-fulldeps/duplicate-output-flavors/foo.rs b/tests/run-make/duplicate-output-flavors/foo.rs
index c1bfaa6ca..c1bfaa6ca 100644
--- a/tests/run-make-fulldeps/duplicate-output-flavors/foo.rs
+++ b/tests/run-make/duplicate-output-flavors/foo.rs
diff --git a/tests/run-make-fulldeps/dylib-chain/Makefile b/tests/run-make/dylib-chain/Makefile
index 1139822f4..f1fea99c5 100644
--- a/tests/run-make-fulldeps/dylib-chain/Makefile
+++ b/tests/run-make/dylib-chain/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/dylib-chain/m1.rs b/tests/run-make/dylib-chain/m1.rs
index 08c3f3752..08c3f3752 100644
--- a/tests/run-make-fulldeps/dylib-chain/m1.rs
+++ b/tests/run-make/dylib-chain/m1.rs
diff --git a/tests/run-make-fulldeps/dylib-chain/m2.rs b/tests/run-make/dylib-chain/m2.rs
index 62176ddc9..62176ddc9 100644
--- a/tests/run-make-fulldeps/dylib-chain/m2.rs
+++ b/tests/run-make/dylib-chain/m2.rs
diff --git a/tests/run-make-fulldeps/dylib-chain/m3.rs b/tests/run-make/dylib-chain/m3.rs
index d213aeda9..d213aeda9 100644
--- a/tests/run-make-fulldeps/dylib-chain/m3.rs
+++ b/tests/run-make/dylib-chain/m3.rs
diff --git a/tests/run-make-fulldeps/dylib-chain/m4.rs b/tests/run-make/dylib-chain/m4.rs
index fa8ec6079..fa8ec6079 100644
--- a/tests/run-make-fulldeps/dylib-chain/m4.rs
+++ b/tests/run-make/dylib-chain/m4.rs
diff --git a/tests/run-make/emit-named-files/Makefile b/tests/run-make/emit-named-files/Makefile
index e081fa479..2b97b841f 100644
--- a/tests/run-make/emit-named-files/Makefile
+++ b/tests/run-make/emit-named-files/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
OUT=$(TMPDIR)/emit
diff --git a/tests/run-make/emit-path-unhashed/Makefile b/tests/run-make/emit-path-unhashed/Makefile
index c144d4aa9..74047fe5f 100644
--- a/tests/run-make/emit-path-unhashed/Makefile
+++ b/tests/run-make/emit-path-unhashed/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
OUT=$(TMPDIR)/emit
diff --git a/tests/run-make/emit-shared-files/Makefile b/tests/run-make/emit-shared-files/Makefile
index cad0c9e5b..27c72b003 100644
--- a/tests/run-make/emit-shared-files/Makefile
+++ b/tests/run-make/emit-shared-files/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
INVOCATION_ONLY = $(TMPDIR)/invocation-only
TOOLCHAIN_ONLY = $(TMPDIR)/toolchain-only
diff --git a/tests/run-make-fulldeps/emit-stack-sizes/Makefile b/tests/run-make/emit-stack-sizes/Makefile
index f636ebd28..f636ebd28 100644
--- a/tests/run-make-fulldeps/emit-stack-sizes/Makefile
+++ b/tests/run-make/emit-stack-sizes/Makefile
diff --git a/tests/run-make-fulldeps/emit-stack-sizes/foo.rs b/tests/run-make/emit-stack-sizes/foo.rs
index ee51ae328..ee51ae328 100644
--- a/tests/run-make-fulldeps/emit-stack-sizes/foo.rs
+++ b/tests/run-make/emit-stack-sizes/foo.rs
diff --git a/tests/run-make-fulldeps/emit/Makefile b/tests/run-make/emit/Makefile
index 78e68bd61..b3ca0b79f 100644
--- a/tests/run-make-fulldeps/emit/Makefile
+++ b/tests/run-make/emit/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/emit/test-24876.rs b/tests/run-make/emit/test-24876.rs
index 734e2ee4b..734e2ee4b 100644
--- a/tests/run-make-fulldeps/emit/test-24876.rs
+++ b/tests/run-make/emit/test-24876.rs
diff --git a/tests/run-make-fulldeps/emit/test-26235.rs b/tests/run-make/emit/test-26235.rs
index 07d975f33..07d975f33 100644
--- a/tests/run-make-fulldeps/emit/test-26235.rs
+++ b/tests/run-make/emit/test-26235.rs
diff --git a/tests/run-make/env-dep-info/Makefile b/tests/run-make/env-dep-info/Makefile
index 1675a61b1..bc0ffc2df 100644
--- a/tests/run-make/env-dep-info/Makefile
+++ b/tests/run-make/env-dep-info/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
# instead of hardcoding them everywhere they're needed.
diff --git a/tests/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile b/tests/run-make/error-found-staticlib-instead-crate/Makefile
index 0eae41d72..0eae41d72 100644
--- a/tests/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile
+++ b/tests/run-make/error-found-staticlib-instead-crate/Makefile
diff --git a/tests/run-make-fulldeps/error-found-staticlib-instead-crate/bar.rs b/tests/run-make/error-found-staticlib-instead-crate/bar.rs
index fe35f1f8e..fe35f1f8e 100644
--- a/tests/run-make-fulldeps/error-found-staticlib-instead-crate/bar.rs
+++ b/tests/run-make/error-found-staticlib-instead-crate/bar.rs
diff --git a/tests/run-make-fulldeps/error-found-staticlib-instead-crate/foo.rs b/tests/run-make/error-found-staticlib-instead-crate/foo.rs
index b76b4321d..b76b4321d 100644
--- a/tests/run-make-fulldeps/error-found-staticlib-instead-crate/foo.rs
+++ b/tests/run-make/error-found-staticlib-instead-crate/foo.rs
diff --git a/tests/run-make-fulldeps/error-writing-dependencies/Makefile b/tests/run-make/error-writing-dependencies/Makefile
index a5d30a647..a5d30a647 100644
--- a/tests/run-make-fulldeps/error-writing-dependencies/Makefile
+++ b/tests/run-make/error-writing-dependencies/Makefile
diff --git a/tests/run-make-fulldeps/error-writing-dependencies/foo.rs b/tests/run-make/error-writing-dependencies/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/error-writing-dependencies/foo.rs
+++ b/tests/run-make/error-writing-dependencies/foo.rs
diff --git a/tests/run-make-fulldeps/exit-code/Makefile b/tests/run-make/exit-code/Makefile
index 3ffaafe90..6458b7168 100644
--- a/tests/run-make-fulldeps/exit-code/Makefile
+++ b/tests/run-make/exit-code/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/exit-code/compile-error.rs b/tests/run-make/exit-code/compile-error.rs
index a96c19760..a96c19760 100644
--- a/tests/run-make-fulldeps/exit-code/compile-error.rs
+++ b/tests/run-make/exit-code/compile-error.rs
diff --git a/tests/run-make-fulldeps/exit-code/lint-failure.rs b/tests/run-make/exit-code/lint-failure.rs
index df876ec23..df876ec23 100644
--- a/tests/run-make-fulldeps/exit-code/lint-failure.rs
+++ b/tests/run-make/exit-code/lint-failure.rs
diff --git a/tests/run-make-fulldeps/exit-code/success.rs b/tests/run-make/exit-code/success.rs
index 55b8e42b6..55b8e42b6 100644
--- a/tests/run-make-fulldeps/exit-code/success.rs
+++ b/tests/run-make/exit-code/success.rs
diff --git a/tests/run-make/export-executable-symbols/Makefile b/tests/run-make/export-executable-symbols/Makefile
index daa77c99d..c4d29aa2b 100644
--- a/tests/run-make/export-executable-symbols/Makefile
+++ b/tests/run-make/export-executable-symbols/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-wasm32
# ignore-wasm64
diff --git a/tests/run-make-fulldeps/extern-diff-internal-name/Makefile b/tests/run-make/extern-diff-internal-name/Makefile
index 54596c2f0..250f82dfa 100644
--- a/tests/run-make-fulldeps/extern-diff-internal-name/Makefile
+++ b/tests/run-make/extern-diff-internal-name/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/extern-diff-internal-name/lib.rs b/tests/run-make/extern-diff-internal-name/lib.rs
index ad96f7086..ad96f7086 100644
--- a/tests/run-make-fulldeps/extern-diff-internal-name/lib.rs
+++ b/tests/run-make/extern-diff-internal-name/lib.rs
diff --git a/tests/run-make-fulldeps/extern-diff-internal-name/test.rs b/tests/run-make/extern-diff-internal-name/test.rs
index 4c53dc28a..4c53dc28a 100644
--- a/tests/run-make-fulldeps/extern-diff-internal-name/test.rs
+++ b/tests/run-make/extern-diff-internal-name/test.rs
diff --git a/tests/run-make-fulldeps/extern-flag-disambiguates/Makefile b/tests/run-make/extern-flag-disambiguates/Makefile
index a8f142a64..e54a537ec 100644
--- a/tests/run-make-fulldeps/extern-flag-disambiguates/Makefile
+++ b/tests/run-make/extern-flag-disambiguates/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Attempt to build this dependency tree:
diff --git a/tests/run-make-fulldeps/extern-flag-disambiguates/a.rs b/tests/run-make/extern-flag-disambiguates/a.rs
index 2b1a31901..2b1a31901 100644
--- a/tests/run-make-fulldeps/extern-flag-disambiguates/a.rs
+++ b/tests/run-make/extern-flag-disambiguates/a.rs
diff --git a/tests/run-make-fulldeps/extern-flag-disambiguates/b.rs b/tests/run-make/extern-flag-disambiguates/b.rs
index 1d7a7339c..1d7a7339c 100644
--- a/tests/run-make-fulldeps/extern-flag-disambiguates/b.rs
+++ b/tests/run-make/extern-flag-disambiguates/b.rs
diff --git a/tests/run-make-fulldeps/extern-flag-disambiguates/c.rs b/tests/run-make/extern-flag-disambiguates/c.rs
index 3f9d143ed..3f9d143ed 100644
--- a/tests/run-make-fulldeps/extern-flag-disambiguates/c.rs
+++ b/tests/run-make/extern-flag-disambiguates/c.rs
diff --git a/tests/run-make-fulldeps/extern-flag-disambiguates/d.rs b/tests/run-make/extern-flag-disambiguates/d.rs
index 249c6a107..249c6a107 100644
--- a/tests/run-make-fulldeps/extern-flag-disambiguates/d.rs
+++ b/tests/run-make/extern-flag-disambiguates/d.rs
diff --git a/tests/run-make-fulldeps/extern-flag-fun/Makefile b/tests/run-make/extern-flag-fun/Makefile
index a0b7c15ed..687cdfd76 100644
--- a/tests/run-make-fulldeps/extern-flag-fun/Makefile
+++ b/tests/run-make/extern-flag-fun/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/extern-flag-fun/bar-alt.rs b/tests/run-make/extern-flag-fun/bar-alt.rs
index cdc6c27d8..cdc6c27d8 100644
--- a/tests/run-make-fulldeps/extern-flag-fun/bar-alt.rs
+++ b/tests/run-make/extern-flag-fun/bar-alt.rs
diff --git a/tests/run-make-fulldeps/extern-flag-fun/bar.rs b/tests/run-make/extern-flag-fun/bar.rs
index d11c69f81..d11c69f81 100644
--- a/tests/run-make-fulldeps/extern-flag-fun/bar.rs
+++ b/tests/run-make/extern-flag-fun/bar.rs
diff --git a/tests/run-make-fulldeps/extern-flag-fun/foo.rs b/tests/run-make/extern-flag-fun/foo.rs
index 0edda7d7b..0edda7d7b 100644
--- a/tests/run-make-fulldeps/extern-flag-fun/foo.rs
+++ b/tests/run-make/extern-flag-fun/foo.rs
diff --git a/tests/run-make-fulldeps/extern-flag-fun/gated_unstable.rs b/tests/run-make/extern-flag-fun/gated_unstable.rs
index 03600c830..03600c830 100644
--- a/tests/run-make-fulldeps/extern-flag-fun/gated_unstable.rs
+++ b/tests/run-make/extern-flag-fun/gated_unstable.rs
diff --git a/tests/run-make-fulldeps/extern-flag-fun/rustc.rs b/tests/run-make/extern-flag-fun/rustc.rs
index b76b4321d..b76b4321d 100644
--- a/tests/run-make-fulldeps/extern-flag-fun/rustc.rs
+++ b/tests/run-make/extern-flag-fun/rustc.rs
diff --git a/tests/run-make-fulldeps/extern-flag-pathless/Makefile b/tests/run-make/extern-flag-pathless/Makefile
index 0f23815b6..701bfcd28 100644
--- a/tests/run-make-fulldeps/extern-flag-pathless/Makefile
+++ b/tests/run-make/extern-flag-pathless/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Test mixing pathless --extern with paths.
diff --git a/tests/run-make-fulldeps/extern-flag-pathless/bar-dynamic.rs b/tests/run-make/extern-flag-pathless/bar-dynamic.rs
index e2d68d517..e2d68d517 100644
--- a/tests/run-make-fulldeps/extern-flag-pathless/bar-dynamic.rs
+++ b/tests/run-make/extern-flag-pathless/bar-dynamic.rs
diff --git a/tests/run-make-fulldeps/extern-flag-pathless/bar-static.rs b/tests/run-make/extern-flag-pathless/bar-static.rs
index 240d8bde4..240d8bde4 100644
--- a/tests/run-make-fulldeps/extern-flag-pathless/bar-static.rs
+++ b/tests/run-make/extern-flag-pathless/bar-static.rs
diff --git a/tests/run-make-fulldeps/extern-flag-pathless/foo.rs b/tests/run-make/extern-flag-pathless/foo.rs
index 1ea64da7d..1ea64da7d 100644
--- a/tests/run-make-fulldeps/extern-flag-pathless/foo.rs
+++ b/tests/run-make/extern-flag-pathless/foo.rs
diff --git a/tests/run-make-fulldeps/extern-flag-rename-transitive/Makefile b/tests/run-make/extern-flag-rename-transitive/Makefile
index d16a8e208..d16a8e208 100644
--- a/tests/run-make-fulldeps/extern-flag-rename-transitive/Makefile
+++ b/tests/run-make/extern-flag-rename-transitive/Makefile
diff --git a/tests/run-make-fulldeps/extern-flag-rename-transitive/bar.rs b/tests/run-make/extern-flag-rename-transitive/bar.rs
index 94446a07d..94446a07d 100644
--- a/tests/run-make-fulldeps/extern-flag-rename-transitive/bar.rs
+++ b/tests/run-make/extern-flag-rename-transitive/bar.rs
diff --git a/tests/run-make-fulldeps/extern-flag-rename-transitive/baz.rs b/tests/run-make/extern-flag-rename-transitive/baz.rs
index c3908db34..c3908db34 100644
--- a/tests/run-make-fulldeps/extern-flag-rename-transitive/baz.rs
+++ b/tests/run-make/extern-flag-rename-transitive/baz.rs
diff --git a/tests/run-make-fulldeps/extern-flag-rename-transitive/foo.rs b/tests/run-make/extern-flag-rename-transitive/foo.rs
index c1bfaa6ca..c1bfaa6ca 100644
--- a/tests/run-make-fulldeps/extern-flag-rename-transitive/foo.rs
+++ b/tests/run-make/extern-flag-rename-transitive/foo.rs
diff --git a/tests/run-make-fulldeps/extern-fn-generic/Makefile b/tests/run-make/extern-fn-generic/Makefile
index 71746fb10..7dceea6cb 100644
--- a/tests/run-make-fulldeps/extern-fn-generic/Makefile
+++ b/tests/run-make/extern-fn-generic/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
diff --git a/tests/run-make-fulldeps/extern-fn-generic/test.c b/tests/run-make/extern-fn-generic/test.c
index a8504ff2a..a8504ff2a 100644
--- a/tests/run-make-fulldeps/extern-fn-generic/test.c
+++ b/tests/run-make/extern-fn-generic/test.c
diff --git a/tests/run-make-fulldeps/extern-fn-generic/test.rs b/tests/run-make/extern-fn-generic/test.rs
index c9baa4898..c9baa4898 100644
--- a/tests/run-make-fulldeps/extern-fn-generic/test.rs
+++ b/tests/run-make/extern-fn-generic/test.rs
diff --git a/tests/run-make-fulldeps/extern-fn-generic/testcrate.rs b/tests/run-make/extern-fn-generic/testcrate.rs
index 39f76e59c..39f76e59c 100644
--- a/tests/run-make-fulldeps/extern-fn-generic/testcrate.rs
+++ b/tests/run-make/extern-fn-generic/testcrate.rs
diff --git a/tests/run-make-fulldeps/extern-fn-mangle/Makefile b/tests/run-make/extern-fn-mangle/Makefile
index 4f5d026f2..3cbbf3839 100644
--- a/tests/run-make-fulldeps/extern-fn-mangle/Makefile
+++ b/tests/run-make/extern-fn-mangle/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
diff --git a/tests/run-make-fulldeps/extern-fn-mangle/test.c b/tests/run-make/extern-fn-mangle/test.c
index e94d75083..e94d75083 100644
--- a/tests/run-make-fulldeps/extern-fn-mangle/test.c
+++ b/tests/run-make/extern-fn-mangle/test.c
diff --git a/tests/run-make-fulldeps/extern-fn-mangle/test.rs b/tests/run-make/extern-fn-mangle/test.rs
index 40b08f1ed..40b08f1ed 100644
--- a/tests/run-make-fulldeps/extern-fn-mangle/test.rs
+++ b/tests/run-make/extern-fn-mangle/test.rs
diff --git a/tests/run-make-fulldeps/extern-fn-reachable/Makefile b/tests/run-make/extern-fn-reachable/Makefile
index 05bdb8d65..3297251bf 100644
--- a/tests/run-make-fulldeps/extern-fn-reachable/Makefile
+++ b/tests/run-make/extern-fn-reachable/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows-msvc
diff --git a/tests/run-make-fulldeps/extern-fn-reachable/dylib.rs b/tests/run-make/extern-fn-reachable/dylib.rs
index cd0179348..cd0179348 100644
--- a/tests/run-make-fulldeps/extern-fn-reachable/dylib.rs
+++ b/tests/run-make/extern-fn-reachable/dylib.rs
diff --git a/tests/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile b/tests/run-make/extern-fn-struct-passing-abi/Makefile
index 4f5d026f2..3cbbf3839 100644
--- a/tests/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile
+++ b/tests/run-make/extern-fn-struct-passing-abi/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
diff --git a/tests/run-make-fulldeps/extern-fn-struct-passing-abi/test.c b/tests/run-make/extern-fn-struct-passing-abi/test.c
index 136b07129..136b07129 100644
--- a/tests/run-make-fulldeps/extern-fn-struct-passing-abi/test.c
+++ b/tests/run-make/extern-fn-struct-passing-abi/test.c
diff --git a/tests/run-make-fulldeps/extern-fn-struct-passing-abi/test.rs b/tests/run-make/extern-fn-struct-passing-abi/test.rs
index afe0f52ef..afe0f52ef 100644
--- a/tests/run-make-fulldeps/extern-fn-struct-passing-abi/test.rs
+++ b/tests/run-make/extern-fn-struct-passing-abi/test.rs
diff --git a/tests/run-make-fulldeps/extern-fn-with-extern-types/Makefile b/tests/run-make/extern-fn-with-extern-types/Makefile
index 1fa708950..07ec503aa 100644
--- a/tests/run-make-fulldeps/extern-fn-with-extern-types/Makefile
+++ b/tests/run-make/extern-fn-with-extern-types/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,ctest)
diff --git a/tests/run-make-fulldeps/extern-fn-with-extern-types/ctest.c b/tests/run-make/extern-fn-with-extern-types/ctest.c
index 3b6fb4cfc..3b6fb4cfc 100644
--- a/tests/run-make-fulldeps/extern-fn-with-extern-types/ctest.c
+++ b/tests/run-make/extern-fn-with-extern-types/ctest.c
diff --git a/tests/run-make-fulldeps/extern-fn-with-extern-types/test.rs b/tests/run-make/extern-fn-with-extern-types/test.rs
index 90a6ebaf1..90a6ebaf1 100644
--- a/tests/run-make-fulldeps/extern-fn-with-extern-types/test.rs
+++ b/tests/run-make/extern-fn-with-extern-types/test.rs
diff --git a/tests/run-make-fulldeps/extern-fn-with-packed-struct/Makefile b/tests/run-make/extern-fn-with-packed-struct/Makefile
index 4f5d026f2..3cbbf3839 100644
--- a/tests/run-make-fulldeps/extern-fn-with-packed-struct/Makefile
+++ b/tests/run-make/extern-fn-with-packed-struct/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
diff --git a/tests/run-make-fulldeps/extern-fn-with-packed-struct/test.c b/tests/run-make/extern-fn-with-packed-struct/test.c
index c89f8272b..c89f8272b 100644
--- a/tests/run-make-fulldeps/extern-fn-with-packed-struct/test.c
+++ b/tests/run-make/extern-fn-with-packed-struct/test.c
diff --git a/tests/run-make-fulldeps/extern-fn-with-packed-struct/test.rs b/tests/run-make/extern-fn-with-packed-struct/test.rs
index 2f261efb5..2f261efb5 100644
--- a/tests/run-make-fulldeps/extern-fn-with-packed-struct/test.rs
+++ b/tests/run-make/extern-fn-with-packed-struct/test.rs
diff --git a/tests/run-make-fulldeps/extern-fn-with-union/Makefile b/tests/run-make/extern-fn-with-union/Makefile
index 40bae923e..e6c8c9936 100644
--- a/tests/run-make-fulldeps/extern-fn-with-union/Makefile
+++ b/tests/run-make/extern-fn-with-union/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,ctest)
diff --git a/tests/run-make-fulldeps/extern-fn-with-union/ctest.c b/tests/run-make/extern-fn-with-union/ctest.c
index 86cb64537..86cb64537 100644
--- a/tests/run-make-fulldeps/extern-fn-with-union/ctest.c
+++ b/tests/run-make/extern-fn-with-union/ctest.c
diff --git a/tests/run-make-fulldeps/extern-fn-with-union/test.rs b/tests/run-make/extern-fn-with-union/test.rs
index 438fbddf3..438fbddf3 100644
--- a/tests/run-make-fulldeps/extern-fn-with-union/test.rs
+++ b/tests/run-make/extern-fn-with-union/test.rs
diff --git a/tests/run-make-fulldeps/extern-fn-with-union/testcrate.rs b/tests/run-make/extern-fn-with-union/testcrate.rs
index 28d91ff37..28d91ff37 100644
--- a/tests/run-make-fulldeps/extern-fn-with-union/testcrate.rs
+++ b/tests/run-make/extern-fn-with-union/testcrate.rs
diff --git a/tests/run-make-fulldeps/extern-multiple-copies/Makefile b/tests/run-make/extern-multiple-copies/Makefile
index 00668a6bc..b0b84278e 100644
--- a/tests/run-make-fulldeps/extern-multiple-copies/Makefile
+++ b/tests/run-make/extern-multiple-copies/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/extern-multiple-copies/bar.rs b/tests/run-make/extern-multiple-copies/bar.rs
index c6b3595f6..c6b3595f6 100644
--- a/tests/run-make-fulldeps/extern-multiple-copies/bar.rs
+++ b/tests/run-make/extern-multiple-copies/bar.rs
diff --git a/tests/run-make-fulldeps/extern-multiple-copies/foo1.rs b/tests/run-make/extern-multiple-copies/foo1.rs
index c1bfaa6ca..c1bfaa6ca 100644
--- a/tests/run-make-fulldeps/extern-multiple-copies/foo1.rs
+++ b/tests/run-make/extern-multiple-copies/foo1.rs
diff --git a/tests/run-make-fulldeps/extern-multiple-copies/foo2.rs b/tests/run-make/extern-multiple-copies/foo2.rs
index c1bfaa6ca..c1bfaa6ca 100644
--- a/tests/run-make-fulldeps/extern-multiple-copies/foo2.rs
+++ b/tests/run-make/extern-multiple-copies/foo2.rs
diff --git a/tests/run-make-fulldeps/extern-multiple-copies2/Makefile b/tests/run-make/extern-multiple-copies2/Makefile
index 84de2ebf3..708b1c1b5 100644
--- a/tests/run-make-fulldeps/extern-multiple-copies2/Makefile
+++ b/tests/run-make/extern-multiple-copies2/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/extern-multiple-copies2/bar.rs b/tests/run-make/extern-multiple-copies2/bar.rs
index b3088152d..b3088152d 100644
--- a/tests/run-make-fulldeps/extern-multiple-copies2/bar.rs
+++ b/tests/run-make/extern-multiple-copies2/bar.rs
diff --git a/tests/run-make-fulldeps/extern-multiple-copies2/foo1.rs b/tests/run-make/extern-multiple-copies2/foo1.rs
index 4c778e52f..4c778e52f 100644
--- a/tests/run-make-fulldeps/extern-multiple-copies2/foo1.rs
+++ b/tests/run-make/extern-multiple-copies2/foo1.rs
diff --git a/tests/run-make-fulldeps/extern-multiple-copies2/foo2.rs b/tests/run-make/extern-multiple-copies2/foo2.rs
index 2be103507..2be103507 100644
--- a/tests/run-make-fulldeps/extern-multiple-copies2/foo2.rs
+++ b/tests/run-make/extern-multiple-copies2/foo2.rs
diff --git a/tests/run-make-fulldeps/extern-overrides-distribution/Makefile b/tests/run-make/extern-overrides-distribution/Makefile
index c57b062cd..bfd0dd699 100644
--- a/tests/run-make-fulldeps/extern-overrides-distribution/Makefile
+++ b/tests/run-make/extern-overrides-distribution/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/extern-overrides-distribution/libc.rs b/tests/run-make/extern-overrides-distribution/libc.rs
index ee51ae328..ee51ae328 100644
--- a/tests/run-make-fulldeps/extern-overrides-distribution/libc.rs
+++ b/tests/run-make/extern-overrides-distribution/libc.rs
diff --git a/tests/run-make-fulldeps/extern-overrides-distribution/main.rs b/tests/run-make/extern-overrides-distribution/main.rs
index 1290a8c56..1290a8c56 100644
--- a/tests/run-make-fulldeps/extern-overrides-distribution/main.rs
+++ b/tests/run-make/extern-overrides-distribution/main.rs
diff --git a/tests/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile b/tests/run-make/extra-filename-with-temp-outputs/Makefile
index 470448cf5..64745bef5 100644
--- a/tests/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile
+++ b/tests/run-make/extra-filename-with-temp-outputs/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/extra-filename-with-temp-outputs/foo.rs b/tests/run-make/extra-filename-with-temp-outputs/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/extra-filename-with-temp-outputs/foo.rs
+++ b/tests/run-make/extra-filename-with-temp-outputs/foo.rs
diff --git a/tests/run-make/fmt-write-bloat/Makefile b/tests/run-make/fmt-write-bloat/Makefile
index 07e6e025e..70e04b9af 100644
--- a/tests/run-make/fmt-write-bloat/Makefile
+++ b/tests/run-make/fmt-write-bloat/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-windows
@@ -11,11 +11,11 @@ else
NM = nm
-PANIC_SYMS = panic_bounds_check pad_integral Display Debug
+PANIC_SYMS = panic_bounds_check Debug
# Allow for debug_assert!() in debug builds of std.
ifdef NO_DEBUG_ASSERTIONS
-PANIC_SYMS += panicking panic_fmt
+PANIC_SYMS += panicking panic_fmt pad_integral Display Debug
endif
all: main.rs
diff --git a/tests/run-make-fulldeps/foreign-double-unwind/Makefile b/tests/run-make/foreign-double-unwind/Makefile
index ea2fe9ff8..f20fe3ce6 100644
--- a/tests/run-make-fulldeps/foreign-double-unwind/Makefile
+++ b/tests/run-make/foreign-double-unwind/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: foo
diff --git a/tests/run-make-fulldeps/foreign-double-unwind/foo.cpp b/tests/run-make/foreign-double-unwind/foo.cpp
index 69a8f11c2..69a8f11c2 100644
--- a/tests/run-make-fulldeps/foreign-double-unwind/foo.cpp
+++ b/tests/run-make/foreign-double-unwind/foo.cpp
diff --git a/tests/run-make-fulldeps/foreign-double-unwind/foo.rs b/tests/run-make/foreign-double-unwind/foo.rs
index cae8aa940..cae8aa940 100644
--- a/tests/run-make-fulldeps/foreign-double-unwind/foo.rs
+++ b/tests/run-make/foreign-double-unwind/foo.rs
diff --git a/tests/run-make-fulldeps/foreign-exceptions/Makefile b/tests/run-make/foreign-exceptions/Makefile
index 38fe2773d..a8e20ffb1 100644
--- a/tests/run-make-fulldeps/foreign-exceptions/Makefile
+++ b/tests/run-make/foreign-exceptions/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: foo
diff --git a/tests/run-make-fulldeps/foreign-exceptions/foo.cpp b/tests/run-make/foreign-exceptions/foo.cpp
index 8182021a2..8182021a2 100644
--- a/tests/run-make-fulldeps/foreign-exceptions/foo.cpp
+++ b/tests/run-make/foreign-exceptions/foo.cpp
diff --git a/tests/run-make-fulldeps/foreign-exceptions/foo.rs b/tests/run-make/foreign-exceptions/foo.rs
index dd3b7c76f..dd3b7c76f 100644
--- a/tests/run-make-fulldeps/foreign-exceptions/foo.rs
+++ b/tests/run-make/foreign-exceptions/foo.rs
diff --git a/tests/run-make-fulldeps/foreign-rust-exceptions/Makefile b/tests/run-make/foreign-rust-exceptions/Makefile
index 50fca7f24..0d007bf1c 100644
--- a/tests/run-make-fulldeps/foreign-rust-exceptions/Makefile
+++ b/tests/run-make/foreign-rust-exceptions/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
# ignore-i686-pc-windows-gnu
# This test doesn't work on 32-bit MinGW as cdylib has its own copy of unwinder
diff --git a/tests/run-make-fulldeps/foreign-rust-exceptions/bar.rs b/tests/run-make/foreign-rust-exceptions/bar.rs
index 5f9efe323..5f9efe323 100644
--- a/tests/run-make-fulldeps/foreign-rust-exceptions/bar.rs
+++ b/tests/run-make/foreign-rust-exceptions/bar.rs
diff --git a/tests/run-make-fulldeps/foreign-rust-exceptions/foo.rs b/tests/run-make/foreign-rust-exceptions/foo.rs
index 266987c5b..266987c5b 100644
--- a/tests/run-make-fulldeps/foreign-rust-exceptions/foo.rs
+++ b/tests/run-make/foreign-rust-exceptions/foo.rs
diff --git a/tests/run-make-fulldeps/fpic/Makefile b/tests/run-make/fpic/Makefile
index 5986de366..c38dd8d6e 100644
--- a/tests/run-make-fulldeps/fpic/Makefile
+++ b/tests/run-make/fpic/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows
diff --git a/tests/run-make-fulldeps/fpic/hello.rs b/tests/run-make/fpic/hello.rs
index 45590d86b..45590d86b 100644
--- a/tests/run-make-fulldeps/fpic/hello.rs
+++ b/tests/run-make/fpic/hello.rs
diff --git a/tests/run-make-fulldeps/glibc-staticlib-args/Makefile b/tests/run-make/glibc-staticlib-args/Makefile
index 39e64bacf..cad6c049e 100644
--- a/tests/run-make-fulldeps/glibc-staticlib-args/Makefile
+++ b/tests/run-make/glibc-staticlib-args/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
# only-gnu
# only-linux
diff --git a/tests/run-make-fulldeps/glibc-staticlib-args/library.rs b/tests/run-make/glibc-staticlib-args/library.rs
index 5ab627a2a..5ab627a2a 100644
--- a/tests/run-make-fulldeps/glibc-staticlib-args/library.rs
+++ b/tests/run-make/glibc-staticlib-args/library.rs
diff --git a/tests/run-make-fulldeps/glibc-staticlib-args/program.c b/tests/run-make/glibc-staticlib-args/program.c
index 30f6974b7..30f6974b7 100644
--- a/tests/run-make-fulldeps/glibc-staticlib-args/program.c
+++ b/tests/run-make/glibc-staticlib-args/program.c
diff --git a/tests/run-make-fulldeps/hir-tree/Makefile b/tests/run-make/hir-tree/Makefile
index b0450ea4b..b0450ea4b 100644
--- a/tests/run-make-fulldeps/hir-tree/Makefile
+++ b/tests/run-make/hir-tree/Makefile
diff --git a/tests/run-make-fulldeps/hir-tree/input.rs b/tests/run-make/hir-tree/input.rs
index 9d1a4e9e4..9d1a4e9e4 100644
--- a/tests/run-make-fulldeps/hir-tree/input.rs
+++ b/tests/run-make/hir-tree/input.rs
diff --git a/tests/run-make-fulldeps/include_bytes_deps/Makefile b/tests/run-make/include_bytes_deps/Makefile
index 696dfd207..696dfd207 100644
--- a/tests/run-make-fulldeps/include_bytes_deps/Makefile
+++ b/tests/run-make/include_bytes_deps/Makefile
diff --git a/tests/run-make-fulldeps/include_bytes_deps/input.bin b/tests/run-make/include_bytes_deps/input.bin
index cd0875583..cd0875583 100644
--- a/tests/run-make-fulldeps/include_bytes_deps/input.bin
+++ b/tests/run-make/include_bytes_deps/input.bin
diff --git a/tests/run-make-fulldeps/include_bytes_deps/input.md b/tests/run-make/include_bytes_deps/input.md
index 2a19b7405..2a19b7405 100644
--- a/tests/run-make-fulldeps/include_bytes_deps/input.md
+++ b/tests/run-make/include_bytes_deps/input.md
diff --git a/tests/run-make-fulldeps/include_bytes_deps/input.txt b/tests/run-make/include_bytes_deps/input.txt
index cd0875583..cd0875583 100644
--- a/tests/run-make-fulldeps/include_bytes_deps/input.txt
+++ b/tests/run-make/include_bytes_deps/input.txt
diff --git a/tests/run-make-fulldeps/include_bytes_deps/main.rs b/tests/run-make/include_bytes_deps/main.rs
index 2fd55699d..2fd55699d 100644
--- a/tests/run-make-fulldeps/include_bytes_deps/main.rs
+++ b/tests/run-make/include_bytes_deps/main.rs
diff --git a/tests/run-make-fulldeps/incr-add-rust-src-component/Makefile b/tests/run-make/incr-add-rust-src-component/Makefile
index 5c1d953cc..fd09c2299 100644
--- a/tests/run-make-fulldeps/incr-add-rust-src-component/Makefile
+++ b/tests/run-make/incr-add-rust-src-component/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# rust-lang/rust#70924: Test that if we add rust-src component in between two
diff --git a/tests/run-make-fulldeps/incr-add-rust-src-component/main.rs b/tests/run-make/incr-add-rust-src-component/main.rs
index f6320bcb0..f6320bcb0 100644
--- a/tests/run-make-fulldeps/incr-add-rust-src-component/main.rs
+++ b/tests/run-make/incr-add-rust-src-component/main.rs
diff --git a/tests/run-make/incr-foreign-head-span/Makefile b/tests/run-make/incr-foreign-head-span/Makefile
index 712965eaa..9d6102cdd 100644
--- a/tests/run-make/incr-foreign-head-span/Makefile
+++ b/tests/run-make/incr-foreign-head-span/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-none no-std is not supported
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std'
diff --git a/tests/run-make/incr-prev-body-beyond-eof/Makefile b/tests/run-make/incr-prev-body-beyond-eof/Makefile
index 24eea3aca..aa47552f5 100644
--- a/tests/run-make/incr-prev-body-beyond-eof/Makefile
+++ b/tests/run-make/incr-prev-body-beyond-eof/Makefile
@@ -1,7 +1,7 @@
# ignore-none no-std is not supported
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std`
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# Tests that we don't ICE during incremental compilation after modifying a
# function span such that its previous end line exceeds the number of lines
diff --git a/tests/run-make/incremental-session-fail/Makefile b/tests/run-make/incremental-session-fail/Makefile
index 6ce137092..f43eece2e 100644
--- a/tests/run-make/incremental-session-fail/Makefile
+++ b/tests/run-make/incremental-session-fail/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
SESSION_DIR := $(TMPDIR)/session
OUTPUT_FILE := $(TMPDIR)/build-output
diff --git a/tests/run-make-fulldeps/inline-always-many-cgu/Makefile b/tests/run-make/inline-always-many-cgu/Makefile
index 9945821db..9945821db 100644
--- a/tests/run-make-fulldeps/inline-always-many-cgu/Makefile
+++ b/tests/run-make/inline-always-many-cgu/Makefile
diff --git a/tests/run-make-fulldeps/inline-always-many-cgu/foo.rs b/tests/run-make/inline-always-many-cgu/foo.rs
index 65fe69c16..65fe69c16 100644
--- a/tests/run-make-fulldeps/inline-always-many-cgu/foo.rs
+++ b/tests/run-make/inline-always-many-cgu/foo.rs
diff --git a/tests/run-make-fulldeps/interdependent-c-libraries/Makefile b/tests/run-make/interdependent-c-libraries/Makefile
index dc5b55a99..53a696d82 100644
--- a/tests/run-make-fulldeps/interdependent-c-libraries/Makefile
+++ b/tests/run-make/interdependent-c-libraries/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# The rust crate foo will link to the native library foo, while the rust crate
diff --git a/tests/run-make-fulldeps/interdependent-c-libraries/bar.c b/tests/run-make/interdependent-c-libraries/bar.c
index 812c97535..812c97535 100644
--- a/tests/run-make-fulldeps/interdependent-c-libraries/bar.c
+++ b/tests/run-make/interdependent-c-libraries/bar.c
diff --git a/tests/run-make-fulldeps/interdependent-c-libraries/bar.rs b/tests/run-make/interdependent-c-libraries/bar.rs
index 3c2c3f218..3c2c3f218 100644
--- a/tests/run-make-fulldeps/interdependent-c-libraries/bar.rs
+++ b/tests/run-make/interdependent-c-libraries/bar.rs
diff --git a/tests/run-make-fulldeps/interdependent-c-libraries/foo.c b/tests/run-make/interdependent-c-libraries/foo.c
index 85e6cd8c3..85e6cd8c3 100644
--- a/tests/run-make-fulldeps/interdependent-c-libraries/foo.c
+++ b/tests/run-make/interdependent-c-libraries/foo.c
diff --git a/tests/run-make-fulldeps/interdependent-c-libraries/foo.rs b/tests/run-make/interdependent-c-libraries/foo.rs
index a69809726..a69809726 100644
--- a/tests/run-make-fulldeps/interdependent-c-libraries/foo.rs
+++ b/tests/run-make/interdependent-c-libraries/foo.rs
diff --git a/tests/run-make-fulldeps/interdependent-c-libraries/main.rs b/tests/run-make/interdependent-c-libraries/main.rs
index 2aba427df..2aba427df 100644
--- a/tests/run-make-fulldeps/interdependent-c-libraries/main.rs
+++ b/tests/run-make/interdependent-c-libraries/main.rs
diff --git a/tests/run-make-fulldeps/intrinsic-unreachable/Makefile b/tests/run-make/intrinsic-unreachable/Makefile
index ff9cc5709..ff9cc5709 100644
--- a/tests/run-make-fulldeps/intrinsic-unreachable/Makefile
+++ b/tests/run-make/intrinsic-unreachable/Makefile
diff --git a/tests/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs b/tests/run-make/intrinsic-unreachable/exit-ret.rs
index e7b9694d9..e7b9694d9 100644
--- a/tests/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs
+++ b/tests/run-make/intrinsic-unreachable/exit-ret.rs
diff --git a/tests/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs b/tests/run-make/intrinsic-unreachable/exit-unreachable.rs
index ec85db733..ec85db733 100644
--- a/tests/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs
+++ b/tests/run-make/intrinsic-unreachable/exit-unreachable.rs
diff --git a/tests/run-make-fulldeps/invalid-library/Makefile b/tests/run-make/invalid-library/Makefile
index 910d9af7b..910d9af7b 100644
--- a/tests/run-make-fulldeps/invalid-library/Makefile
+++ b/tests/run-make/invalid-library/Makefile
diff --git a/tests/run-make-fulldeps/invalid-library/foo.rs b/tests/run-make/invalid-library/foo.rs
index bb7b36c49..bb7b36c49 100644
--- a/tests/run-make-fulldeps/invalid-library/foo.rs
+++ b/tests/run-make/invalid-library/foo.rs
diff --git a/tests/run-make/invalid-so/Makefile b/tests/run-make/invalid-so/Makefile
index 5b82ecd20..e36c7040b 100644
--- a/tests/run-make/invalid-so/Makefile
+++ b/tests/run-make/invalid-so/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
DYLIB_NAME := $(shell echo | $(RUSTC) --crate-name foo --crate-type dylib --print file-names -)
diff --git a/tests/run-make-fulldeps/invalid-staticlib/Makefile b/tests/run-make/invalid-staticlib/Makefile
index 3f0f74ce3..3f0f74ce3 100644
--- a/tests/run-make-fulldeps/invalid-staticlib/Makefile
+++ b/tests/run-make/invalid-staticlib/Makefile
diff --git a/tests/run-make/issue-10971-temps-dir/Makefile b/tests/run-make/issue-10971-temps-dir/Makefile
index e589bbffe..6e1649a58 100644
--- a/tests/run-make/issue-10971-temps-dir/Makefile
+++ b/tests/run-make/issue-10971-temps-dir/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# Regression test for issue #10971
# Running two invocations in parallel would overwrite each other's temp files.
diff --git a/tests/run-make/issue-109934-lto-debuginfo/Makefile b/tests/run-make/issue-109934-lto-debuginfo/Makefile
new file mode 100644
index 000000000..3b7a99d3d
--- /dev/null
+++ b/tests/run-make/issue-109934-lto-debuginfo/Makefile
@@ -0,0 +1,12 @@
+# ignore-cross-compile
+include ../tools.mk
+
+# With the upgrade to LLVM 16, this was getting:
+#
+# error: Cannot represent a difference across sections
+#
+# The error stemmed from DI function definitions under type scopes, fixed by
+# only declaring in type scope and defining the subprogram elsewhere.
+
+all:
+ $(RUSTC) lib.rs --test -C lto=fat -C debuginfo=2 -C incremental=$(TMPDIR)/inc-fat
diff --git a/tests/run-make/issue-109934-lto-debuginfo/lib.rs b/tests/run-make/issue-109934-lto-debuginfo/lib.rs
new file mode 100644
index 000000000..c405928bd
--- /dev/null
+++ b/tests/run-make/issue-109934-lto-debuginfo/lib.rs
@@ -0,0 +1,9 @@
+extern crate alloc;
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn something_alloc() {
+ assert_eq!(Vec::<u32>::new(), Vec::<u32>::new());
+ }
+}
diff --git a/tests/run-make-fulldeps/issue-11908/Makefile b/tests/run-make/issue-11908/Makefile
index 47005537e..38586662f 100644
--- a/tests/run-make-fulldeps/issue-11908/Makefile
+++ b/tests/run-make/issue-11908/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
# This test ensures that if you have the same rlib or dylib at two locations
# in the same path that you don't hit an assertion in the compiler.
#
diff --git a/tests/run-make-fulldeps/issue-11908/bar.rs b/tests/run-make/issue-11908/bar.rs
index bb7b36c49..bb7b36c49 100644
--- a/tests/run-make-fulldeps/issue-11908/bar.rs
+++ b/tests/run-make/issue-11908/bar.rs
diff --git a/tests/run-make-fulldeps/issue-11908/foo.rs b/tests/run-make/issue-11908/foo.rs
index 82b2dfe9f..82b2dfe9f 100644
--- a/tests/run-make-fulldeps/issue-11908/foo.rs
+++ b/tests/run-make/issue-11908/foo.rs
diff --git a/tests/run-make-fulldeps/issue-14500/Makefile b/tests/run-make/issue-14500/Makefile
index 52550e570..eeab48de3 100644
--- a/tests/run-make-fulldeps/issue-14500/Makefile
+++ b/tests/run-make/issue-14500/Makefile
@@ -1,5 +1,7 @@
include ../tools.mk
+# ignore-cross-compile
+
# Test to make sure that reachable extern fns are always available in final
# productcs, including when LTO is used. In this test, the `foo` crate has a
# reahable symbol, and is a dependency of the `bar` crate. When the `bar` crate
diff --git a/tests/run-make-fulldeps/issue-14500/bar.rs b/tests/run-make/issue-14500/bar.rs
index 49af74e1b..49af74e1b 100644
--- a/tests/run-make-fulldeps/issue-14500/bar.rs
+++ b/tests/run-make/issue-14500/bar.rs
diff --git a/tests/run-make-fulldeps/issue-14500/foo.c b/tests/run-make/issue-14500/foo.c
index 2353d400d..2353d400d 100644
--- a/tests/run-make-fulldeps/issue-14500/foo.c
+++ b/tests/run-make/issue-14500/foo.c
diff --git a/tests/run-make-fulldeps/issue-14500/foo.rs b/tests/run-make/issue-14500/foo.rs
index 7c19c1f2c..7c19c1f2c 100644
--- a/tests/run-make-fulldeps/issue-14500/foo.rs
+++ b/tests/run-make/issue-14500/foo.rs
diff --git a/tests/run-make-fulldeps/issue-14698/Makefile b/tests/run-make/issue-14698/Makefile
index a1cfb5aba..a1cfb5aba 100644
--- a/tests/run-make-fulldeps/issue-14698/Makefile
+++ b/tests/run-make/issue-14698/Makefile
diff --git a/tests/run-make-fulldeps/issue-14698/foo.rs b/tests/run-make/issue-14698/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/issue-14698/foo.rs
+++ b/tests/run-make/issue-14698/foo.rs
diff --git a/tests/run-make-fulldeps/issue-15460/Makefile b/tests/run-make/issue-15460/Makefile
index 1648d0c0c..a36a085fa 100644
--- a/tests/run-make-fulldeps/issue-15460/Makefile
+++ b/tests/run-make/issue-15460/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,foo)
diff --git a/tests/run-make-fulldeps/issue-15460/bar.rs b/tests/run-make/issue-15460/bar.rs
index e66aeb6bd..e66aeb6bd 100644
--- a/tests/run-make-fulldeps/issue-15460/bar.rs
+++ b/tests/run-make/issue-15460/bar.rs
diff --git a/tests/run-make-fulldeps/issue-15460/foo.c b/tests/run-make/issue-15460/foo.c
index fdf595b57..fdf595b57 100644
--- a/tests/run-make-fulldeps/issue-15460/foo.c
+++ b/tests/run-make/issue-15460/foo.c
diff --git a/tests/run-make-fulldeps/issue-15460/foo.rs b/tests/run-make/issue-15460/foo.rs
index b4eaa0b31..b4eaa0b31 100644
--- a/tests/run-make-fulldeps/issue-15460/foo.rs
+++ b/tests/run-make/issue-15460/foo.rs
diff --git a/tests/run-make-fulldeps/issue-18943/Makefile b/tests/run-make/issue-18943/Makefile
index fc40d756d..fc40d756d 100644
--- a/tests/run-make-fulldeps/issue-18943/Makefile
+++ b/tests/run-make/issue-18943/Makefile
diff --git a/tests/run-make-fulldeps/issue-18943/foo.rs b/tests/run-make/issue-18943/foo.rs
index d18400dd3..d18400dd3 100644
--- a/tests/run-make-fulldeps/issue-18943/foo.rs
+++ b/tests/run-make/issue-18943/foo.rs
diff --git a/tests/run-make-fulldeps/issue-20626/Makefile b/tests/run-make/issue-20626/Makefile
index f76f31e79..63eee910a 100644
--- a/tests/run-make-fulldeps/issue-20626/Makefile
+++ b/tests/run-make/issue-20626/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Test output to be four
diff --git a/tests/run-make-fulldeps/issue-20626/foo.rs b/tests/run-make/issue-20626/foo.rs
index a474e234e..a474e234e 100644
--- a/tests/run-make-fulldeps/issue-20626/foo.rs
+++ b/tests/run-make/issue-20626/foo.rs
diff --git a/tests/run-make-fulldeps/issue-22131/Makefile b/tests/run-make/issue-22131/Makefile
index 770f4b04e..4f33a4659 100644
--- a/tests/run-make-fulldeps/issue-22131/Makefile
+++ b/tests/run-make/issue-22131/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: foo.rs
diff --git a/tests/run-make-fulldeps/issue-22131/foo.rs b/tests/run-make/issue-22131/foo.rs
index 33255d768..33255d768 100644
--- a/tests/run-make-fulldeps/issue-22131/foo.rs
+++ b/tests/run-make/issue-22131/foo.rs
diff --git a/tests/run-make-fulldeps/issue-24445/Makefile b/tests/run-make/issue-24445/Makefile
index 2a12226a6..a13910aa7 100644
--- a/tests/run-make-fulldeps/issue-24445/Makefile
+++ b/tests/run-make/issue-24445/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# only-linux
diff --git a/tests/run-make-fulldeps/issue-24445/foo.c b/tests/run-make/issue-24445/foo.c
index bb4036b06..bb4036b06 100644
--- a/tests/run-make-fulldeps/issue-24445/foo.c
+++ b/tests/run-make/issue-24445/foo.c
diff --git a/tests/run-make-fulldeps/issue-24445/foo.rs b/tests/run-make/issue-24445/foo.rs
index b67f3847c..b67f3847c 100644
--- a/tests/run-make-fulldeps/issue-24445/foo.rs
+++ b/tests/run-make/issue-24445/foo.rs
diff --git a/tests/run-make/issue-25581/Makefile b/tests/run-make/issue-25581/Makefile
new file mode 100644
index 000000000..3cbbf3839
--- /dev/null
+++ b/tests/run-make/issue-25581/Makefile
@@ -0,0 +1,6 @@
+# ignore-cross-compile
+include ../tools.mk
+
+all: $(call NATIVE_STATICLIB,test)
+ $(RUSTC) test.rs
+ $(call RUN,test) || exit 1
diff --git a/tests/run-make-fulldeps/issue-25581/test.c b/tests/run-make/issue-25581/test.c
index 52fbf7851..52fbf7851 100644
--- a/tests/run-make-fulldeps/issue-25581/test.c
+++ b/tests/run-make/issue-25581/test.c
diff --git a/tests/run-make-fulldeps/issue-25581/test.rs b/tests/run-make/issue-25581/test.rs
index ba6749c97..ba6749c97 100644
--- a/tests/run-make-fulldeps/issue-25581/test.rs
+++ b/tests/run-make/issue-25581/test.rs
diff --git a/tests/run-make-fulldeps/issue-26006/Makefile b/tests/run-make/issue-26006/Makefile
index 0ff073020..b679c1215 100644
--- a/tests/run-make-fulldeps/issue-26006/Makefile
+++ b/tests/run-make/issue-26006/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows
diff --git a/tests/run-make-fulldeps/issue-26006/in/libc/lib.rs b/tests/run-make/issue-26006/in/libc/lib.rs
index 23f2bf518..23f2bf518 100644
--- a/tests/run-make-fulldeps/issue-26006/in/libc/lib.rs
+++ b/tests/run-make/issue-26006/in/libc/lib.rs
diff --git a/tests/run-make-fulldeps/issue-26006/in/time/lib.rs b/tests/run-make/issue-26006/in/time/lib.rs
index 87f2f824a..87f2f824a 100644
--- a/tests/run-make-fulldeps/issue-26006/in/time/lib.rs
+++ b/tests/run-make/issue-26006/in/time/lib.rs
diff --git a/tests/run-make-fulldeps/issue-26092/Makefile b/tests/run-make/issue-26092/Makefile
index 96822e769..96822e769 100644
--- a/tests/run-make-fulldeps/issue-26092/Makefile
+++ b/tests/run-make/issue-26092/Makefile
diff --git a/tests/run-make-fulldeps/issue-26092/blank.rs b/tests/run-make/issue-26092/blank.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/issue-26092/blank.rs
+++ b/tests/run-make/issue-26092/blank.rs
diff --git a/tests/run-make-fulldeps/issue-28595/Makefile b/tests/run-make/issue-28595/Makefile
index 30a1d9c56..258f9788a 100644
--- a/tests/run-make-fulldeps/issue-28595/Makefile
+++ b/tests/run-make/issue-28595/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,a) $(call NATIVE_STATICLIB,b)
diff --git a/tests/run-make-fulldeps/issue-28595/a.c b/tests/run-make/issue-28595/a.c
index 7bfd83cca..7bfd83cca 100644
--- a/tests/run-make-fulldeps/issue-28595/a.c
+++ b/tests/run-make/issue-28595/a.c
diff --git a/tests/run-make-fulldeps/issue-28595/a.rs b/tests/run-make/issue-28595/a.rs
index 07863cf64..07863cf64 100644
--- a/tests/run-make-fulldeps/issue-28595/a.rs
+++ b/tests/run-make/issue-28595/a.rs
diff --git a/tests/run-make-fulldeps/issue-28595/b.c b/tests/run-make/issue-28595/b.c
index 6aecb5f9e..6aecb5f9e 100644
--- a/tests/run-make-fulldeps/issue-28595/b.c
+++ b/tests/run-make/issue-28595/b.c
diff --git a/tests/run-make-fulldeps/issue-28595/b.rs b/tests/run-make/issue-28595/b.rs
index 1f389859f..1f389859f 100644
--- a/tests/run-make-fulldeps/issue-28595/b.rs
+++ b/tests/run-make/issue-28595/b.rs
diff --git a/tests/run-make-fulldeps/issue-28766/Makefile b/tests/run-make/issue-28766/Makefile
index 96d0bdc2b..96d0bdc2b 100644
--- a/tests/run-make-fulldeps/issue-28766/Makefile
+++ b/tests/run-make/issue-28766/Makefile
diff --git a/tests/run-make-fulldeps/issue-28766/foo.rs b/tests/run-make/issue-28766/foo.rs
index 1dcabe42d..1dcabe42d 100644
--- a/tests/run-make-fulldeps/issue-28766/foo.rs
+++ b/tests/run-make/issue-28766/foo.rs
diff --git a/tests/run-make-fulldeps/issue-28766/main.rs b/tests/run-make/issue-28766/main.rs
index de12b1fd9..de12b1fd9 100644
--- a/tests/run-make-fulldeps/issue-28766/main.rs
+++ b/tests/run-make/issue-28766/main.rs
diff --git a/tests/run-make-fulldeps/issue-30063/Makefile b/tests/run-make/issue-30063/Makefile
index e4ede598f..8a69ca79f 100644
--- a/tests/run-make-fulldeps/issue-30063/Makefile
+++ b/tests/run-make/issue-30063/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/issue-30063/foo.rs b/tests/run-make/issue-30063/foo.rs
index 45590d86b..45590d86b 100644
--- a/tests/run-make-fulldeps/issue-30063/foo.rs
+++ b/tests/run-make/issue-30063/foo.rs
diff --git a/tests/run-make-fulldeps/issue-33329/Makefile b/tests/run-make/issue-33329/Makefile
index 9c149440d..9c149440d 100644
--- a/tests/run-make-fulldeps/issue-33329/Makefile
+++ b/tests/run-make/issue-33329/Makefile
diff --git a/tests/run-make-fulldeps/issue-33329/main.rs b/tests/run-make/issue-33329/main.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/issue-33329/main.rs
+++ b/tests/run-make/issue-33329/main.rs
diff --git a/tests/run-make-fulldeps/issue-35164/Makefile b/tests/run-make/issue-35164/Makefile
index 38aa6f126..38aa6f126 100644
--- a/tests/run-make-fulldeps/issue-35164/Makefile
+++ b/tests/run-make/issue-35164/Makefile
diff --git a/tests/run-make-fulldeps/issue-35164/main.rs b/tests/run-make/issue-35164/main.rs
index 1333d6322..1333d6322 100644
--- a/tests/run-make-fulldeps/issue-35164/main.rs
+++ b/tests/run-make/issue-35164/main.rs
diff --git a/tests/run-make-fulldeps/issue-35164/submodule/mod.rs b/tests/run-make/issue-35164/submodule/mod.rs
index a9045b242..a9045b242 100644
--- a/tests/run-make-fulldeps/issue-35164/submodule/mod.rs
+++ b/tests/run-make/issue-35164/submodule/mod.rs
diff --git a/tests/run-make/issue-36710/Makefile b/tests/run-make/issue-36710/Makefile
index d6145c071..7b91107a2 100644
--- a/tests/run-make/issue-36710/Makefile
+++ b/tests/run-make/issue-36710/Makefile
@@ -1,11 +1,13 @@
+# ignore-cross-compile
# ignore-none no-std is not supported
# ignore-wasm32 FIXME: don't attempt to compile C++ to WASM
# ignore-wasm64 FIXME: don't attempt to compile C++ to WASM
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std`
# ignore-musl FIXME: this makefile needs teaching how to use a musl toolchain
# (see dist-i586-gnu-i586-i686-musl Dockerfile)
+# ignore-sgx
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all: foo
$(call RUN,foo)
diff --git a/tests/run-make-fulldeps/issue-37839/Makefile b/tests/run-make/issue-37839/Makefile
index de50bd713..6bad27b7b 100644
--- a/tests/run-make-fulldeps/issue-37839/Makefile
+++ b/tests/run-make/issue-37839/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/issue-37839/a.rs b/tests/run-make/issue-37839/a.rs
index b5dffac3f..b5dffac3f 100644
--- a/tests/run-make-fulldeps/issue-37839/a.rs
+++ b/tests/run-make/issue-37839/a.rs
diff --git a/tests/run-make-fulldeps/issue-37839/b.rs b/tests/run-make/issue-37839/b.rs
index 355d2b165..355d2b165 100644
--- a/tests/run-make-fulldeps/issue-37839/b.rs
+++ b/tests/run-make/issue-37839/b.rs
diff --git a/tests/run-make-fulldeps/issue-37839/c.rs b/tests/run-make/issue-37839/c.rs
index 4c7ce01b6..4c7ce01b6 100644
--- a/tests/run-make-fulldeps/issue-37839/c.rs
+++ b/tests/run-make/issue-37839/c.rs
diff --git a/tests/run-make-fulldeps/issue-37893/Makefile b/tests/run-make/issue-37893/Makefile
index 33a60830e..44e4a321a 100644
--- a/tests/run-make-fulldeps/issue-37893/Makefile
+++ b/tests/run-make/issue-37893/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/issue-37893/a.rs b/tests/run-make/issue-37893/a.rs
index b5dffac3f..b5dffac3f 100644
--- a/tests/run-make-fulldeps/issue-37893/a.rs
+++ b/tests/run-make/issue-37893/a.rs
diff --git a/tests/run-make-fulldeps/issue-37893/b.rs b/tests/run-make/issue-37893/b.rs
index 355d2b165..355d2b165 100644
--- a/tests/run-make-fulldeps/issue-37893/b.rs
+++ b/tests/run-make/issue-37893/b.rs
diff --git a/tests/run-make-fulldeps/issue-37893/c.rs b/tests/run-make/issue-37893/c.rs
index b9c215572..b9c215572 100644
--- a/tests/run-make-fulldeps/issue-37893/c.rs
+++ b/tests/run-make/issue-37893/c.rs
diff --git a/tests/run-make-fulldeps/issue-38237/Makefile b/tests/run-make/issue-38237/Makefile
index 75121d040..80dddc5bd 100644
--- a/tests/run-make-fulldeps/issue-38237/Makefile
+++ b/tests/run-make/issue-38237/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/issue-38237/bar.rs b/tests/run-make/issue-38237/bar.rs
index 2b839f3a3..2b839f3a3 100644
--- a/tests/run-make-fulldeps/issue-38237/bar.rs
+++ b/tests/run-make/issue-38237/bar.rs
diff --git a/tests/run-make-fulldeps/issue-38237/baz.rs b/tests/run-make/issue-38237/baz.rs
index cd2425f9b..cd2425f9b 100644
--- a/tests/run-make-fulldeps/issue-38237/baz.rs
+++ b/tests/run-make/issue-38237/baz.rs
diff --git a/tests/run-make-fulldeps/issue-38237/foo.rs b/tests/run-make/issue-38237/foo.rs
index a106e4fde..a106e4fde 100644
--- a/tests/run-make-fulldeps/issue-38237/foo.rs
+++ b/tests/run-make/issue-38237/foo.rs
diff --git a/tests/run-make-fulldeps/issue-40535/Makefile b/tests/run-make/issue-40535/Makefile
index 155c88252..155c88252 100644
--- a/tests/run-make-fulldeps/issue-40535/Makefile
+++ b/tests/run-make/issue-40535/Makefile
diff --git a/tests/run-make-fulldeps/issue-40535/bar.rs b/tests/run-make/issue-40535/bar.rs
index b02b28f59..b02b28f59 100644
--- a/tests/run-make-fulldeps/issue-40535/bar.rs
+++ b/tests/run-make/issue-40535/bar.rs
diff --git a/tests/run-make-fulldeps/issue-40535/baz.rs b/tests/run-make/issue-40535/baz.rs
index 83be6e807..83be6e807 100644
--- a/tests/run-make-fulldeps/issue-40535/baz.rs
+++ b/tests/run-make/issue-40535/baz.rs
diff --git a/tests/run-make-fulldeps/issue-40535/foo.rs b/tests/run-make/issue-40535/foo.rs
index 270202664..270202664 100644
--- a/tests/run-make-fulldeps/issue-40535/foo.rs
+++ b/tests/run-make/issue-40535/foo.rs
diff --git a/tests/run-make-fulldeps/issue-46239/Makefile b/tests/run-make/issue-46239/Makefile
index a93ef3212..0006ced25 100644
--- a/tests/run-make-fulldeps/issue-46239/Makefile
+++ b/tests/run-make/issue-46239/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/issue-46239/main.rs b/tests/run-make/issue-46239/main.rs
index b7df5cf4d..b7df5cf4d 100644
--- a/tests/run-make-fulldeps/issue-46239/main.rs
+++ b/tests/run-make/issue-46239/main.rs
diff --git a/tests/run-make/issue-47384/Makefile b/tests/run-make/issue-47384/Makefile
index 0aadf6c88..afc77cb27 100644
--- a/tests/run-make/issue-47384/Makefile
+++ b/tests/run-make/issue-47384/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-linux
# ignore-cross-compile
diff --git a/tests/run-make-fulldeps/issue-47551/Makefile b/tests/run-make/issue-47551/Makefile
index 5a6ac7257..5a6ac7257 100644
--- a/tests/run-make-fulldeps/issue-47551/Makefile
+++ b/tests/run-make/issue-47551/Makefile
diff --git a/tests/run-make-fulldeps/issue-47551/eh_frame-terminator.rs b/tests/run-make/issue-47551/eh_frame-terminator.rs
index a2c7a31b7..a2c7a31b7 100644
--- a/tests/run-make-fulldeps/issue-47551/eh_frame-terminator.rs
+++ b/tests/run-make/issue-47551/eh_frame-terminator.rs
diff --git a/tests/run-make-fulldeps/issue-51671/Makefile b/tests/run-make/issue-51671/Makefile
index c93645369..c93645369 100644
--- a/tests/run-make-fulldeps/issue-51671/Makefile
+++ b/tests/run-make/issue-51671/Makefile
diff --git a/tests/run-make-fulldeps/issue-51671/app.rs b/tests/run-make/issue-51671/app.rs
index e9dc1e974..e9dc1e974 100644
--- a/tests/run-make-fulldeps/issue-51671/app.rs
+++ b/tests/run-make/issue-51671/app.rs
diff --git a/tests/run-make-fulldeps/issue-53964/Makefile b/tests/run-make/issue-53964/Makefile
index 6bd830213..6bd830213 100644
--- a/tests/run-make-fulldeps/issue-53964/Makefile
+++ b/tests/run-make/issue-53964/Makefile
diff --git a/tests/run-make-fulldeps/issue-53964/app.rs b/tests/run-make/issue-53964/app.rs
index 8127b9578..8127b9578 100644
--- a/tests/run-make-fulldeps/issue-53964/app.rs
+++ b/tests/run-make/issue-53964/app.rs
diff --git a/tests/run-make-fulldeps/issue-53964/panic.rs b/tests/run-make/issue-53964/panic.rs
index a87812050..a87812050 100644
--- a/tests/run-make-fulldeps/issue-53964/panic.rs
+++ b/tests/run-make/issue-53964/panic.rs
diff --git a/tests/run-make-fulldeps/issue-64153/Makefile b/tests/run-make/issue-64153/Makefile
index f42ea620f..f42ea620f 100644
--- a/tests/run-make-fulldeps/issue-64153/Makefile
+++ b/tests/run-make/issue-64153/Makefile
diff --git a/tests/run-make-fulldeps/issue-64153/downstream.rs b/tests/run-make/issue-64153/downstream.rs
index e03704665..e03704665 100644
--- a/tests/run-make-fulldeps/issue-64153/downstream.rs
+++ b/tests/run-make/issue-64153/downstream.rs
diff --git a/tests/run-make-fulldeps/issue-64153/upstream.rs b/tests/run-make/issue-64153/upstream.rs
index 861a00298..861a00298 100644
--- a/tests/run-make-fulldeps/issue-64153/upstream.rs
+++ b/tests/run-make/issue-64153/upstream.rs
diff --git a/tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile b/tests/run-make/issue-68794-textrel-on-minimal-lib/Makefile
index 13983f4ff..6140b39c0 100644
--- a/tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile
+++ b/tests/run-make/issue-68794-textrel-on-minimal-lib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
# Regression test for issue #68794
#
# Verify that no text relocations are accidentally introduced by linking a
diff --git a/tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/bar.c b/tests/run-make/issue-68794-textrel-on-minimal-lib/bar.c
index bb4036b06..bb4036b06 100644
--- a/tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/bar.c
+++ b/tests/run-make/issue-68794-textrel-on-minimal-lib/bar.c
diff --git a/tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/foo.rs b/tests/run-make/issue-68794-textrel-on-minimal-lib/foo.rs
index a3e865b63..a3e865b63 100644
--- a/tests/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/foo.rs
+++ b/tests/run-make/issue-68794-textrel-on-minimal-lib/foo.rs
diff --git a/tests/run-make-fulldeps/issue-69368/Makefile b/tests/run-make/issue-69368/Makefile
index 41770475d..b1229d1b0 100644
--- a/tests/run-make-fulldeps/issue-69368/Makefile
+++ b/tests/run-make/issue-69368/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Test that previously triggered a linker failure with root cause
diff --git a/tests/run-make-fulldeps/issue-69368/a.rs b/tests/run-make/issue-69368/a.rs
index a54f42955..a54f42955 100644
--- a/tests/run-make-fulldeps/issue-69368/a.rs
+++ b/tests/run-make/issue-69368/a.rs
diff --git a/tests/run-make-fulldeps/issue-69368/b.rs b/tests/run-make/issue-69368/b.rs
index 4d6af0266..4d6af0266 100644
--- a/tests/run-make-fulldeps/issue-69368/b.rs
+++ b/tests/run-make/issue-69368/b.rs
diff --git a/tests/run-make-fulldeps/issue-69368/c.rs b/tests/run-make/issue-69368/c.rs
index 729c4249a..729c4249a 100644
--- a/tests/run-make-fulldeps/issue-69368/c.rs
+++ b/tests/run-make/issue-69368/c.rs
diff --git a/tests/run-make/issue-71519/Makefile b/tests/run-make/issue-71519/Makefile
index 57497f520..0ee83328b 100644
--- a/tests/run-make/issue-71519/Makefile
+++ b/tests/run-make/issue-71519/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-msvc
# needs-rust-lld
diff --git a/tests/run-make-fulldeps/issue-7349/Makefile b/tests/run-make/issue-7349/Makefile
index dc073b77f..dc073b77f 100644
--- a/tests/run-make-fulldeps/issue-7349/Makefile
+++ b/tests/run-make/issue-7349/Makefile
diff --git a/tests/run-make-fulldeps/issue-7349/foo.rs b/tests/run-make/issue-7349/foo.rs
index 246a12595..246a12595 100644
--- a/tests/run-make-fulldeps/issue-7349/foo.rs
+++ b/tests/run-make/issue-7349/foo.rs
diff --git a/tests/run-make-fulldeps/issue-83045/Makefile b/tests/run-make/issue-83045/Makefile
index 34853cb1d..7053da00f 100644
--- a/tests/run-make-fulldeps/issue-83045/Makefile
+++ b/tests/run-make/issue-83045/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# This test case creates a situation where the crate loader would run
# into an ICE when confronted with an invalid setup where it cannot
@@ -29,5 +29,5 @@ all:
--crate-type=rlib \
--edition=2018 \
c.rs 2>&1 | tee $(TMPDIR)/output.txt || exit 0
- $(CGREP) E0463 < $(TMPDIR)/output.txt
+ $(CGREP) E0519 < $(TMPDIR)/output.txt
$(CGREP) -v "internal compiler error" < $(TMPDIR)/output.txt
diff --git a/tests/run-make-fulldeps/issue-83045/a.rs b/tests/run-make/issue-83045/a.rs
index 66d9f758e..66d9f758e 100644
--- a/tests/run-make-fulldeps/issue-83045/a.rs
+++ b/tests/run-make/issue-83045/a.rs
diff --git a/tests/run-make-fulldeps/issue-83045/b.rs b/tests/run-make/issue-83045/b.rs
index f4876cfa4..f4876cfa4 100644
--- a/tests/run-make-fulldeps/issue-83045/b.rs
+++ b/tests/run-make/issue-83045/b.rs
diff --git a/tests/run-make-fulldeps/issue-83045/c.rs b/tests/run-make/issue-83045/c.rs
index e0c452549..e0c452549 100644
--- a/tests/run-make-fulldeps/issue-83045/c.rs
+++ b/tests/run-make/issue-83045/c.rs
diff --git a/tests/run-make/issue-83112-incr-test-moved-file/Makefile b/tests/run-make/issue-83112-incr-test-moved-file/Makefile
index 2f796e5b2..a00088cd9 100644
--- a/tests/run-make/issue-83112-incr-test-moved-file/Makefile
+++ b/tests/run-make/issue-83112-incr-test-moved-file/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-none no-std is not supported
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std'
diff --git a/tests/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile b/tests/run-make/issue-84395-lto-embed-bitcode/Makefile
index 879ce1743..95c8d08a1 100644
--- a/tests/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile
+++ b/tests/run-make/issue-84395-lto-embed-bitcode/Makefile
@@ -3,7 +3,7 @@
# This test makes sure the embed bitcode in elf created with
# lto-embed-bitcode=optimized is valid llvm BC module.
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) test.rs --target $(TARGET) -Clink-arg=-fuse-ld=lld -Clinker-plugin-lto -Clinker=$(CLANG) -Clink-arg=-Wl,--plugin-opt=-lto-embed-bitcode=optimized -Zemit-thin-lto=no
diff --git a/tests/run-make-fulldeps/issue-84395-lto-embed-bitcode/test.rs b/tests/run-make/issue-84395-lto-embed-bitcode/test.rs
index 47ad8c634..47ad8c634 100644
--- a/tests/run-make-fulldeps/issue-84395-lto-embed-bitcode/test.rs
+++ b/tests/run-make/issue-84395-lto-embed-bitcode/test.rs
diff --git a/tests/run-make/issue-85019-moved-src-dir/Makefile b/tests/run-make/issue-85019-moved-src-dir/Makefile
index 3606d4fdf..dec289058 100644
--- a/tests/run-make/issue-85019-moved-src-dir/Makefile
+++ b/tests/run-make/issue-85019-moved-src-dir/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
INCR=$(TMPDIR)/incr
FIRST_SRC=$(TMPDIR)/first_src
diff --git a/tests/run-make/issue-85401-static-mir/Makefile b/tests/run-make/issue-85401-static-mir/Makefile
index 99590166b..47a36b6e4 100644
--- a/tests/run-make/issue-85401-static-mir/Makefile
+++ b/tests/run-make/issue-85401-static-mir/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# Regression test for issue #85401
# Verify that we do not ICE when trying to access MIR for statics,
diff --git a/tests/run-make/issue-85441/Makefile b/tests/run-make/issue-85441/Makefile
index f04b07d51..987d7f7d4 100644
--- a/tests/run-make/issue-85441/Makefile
+++ b/tests/run-make/issue-85441/Makefile
@@ -1,6 +1,6 @@
# only-windows-msvc
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# Tests that WS2_32.dll is not unnecessarily linked, see issue #85441
diff --git a/tests/run-make/issue-88756-default-output/Makefile b/tests/run-make/issue-88756-default-output/Makefile
index 275c35c26..d1c3d0fe0 100644
--- a/tests/run-make/issue-88756-default-output/Makefile
+++ b/tests/run-make/issue-88756-default-output/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(BARE_RUSTDOC) 2>&1 | sed -E 's@/nightly/|/beta/|/stable/|/1\.[0-9]+\.[0-9]+/@/$$CHANNEL/@g' | diff - output-default.stdout
diff --git a/tests/run-make/issue-96498/Makefile b/tests/run-make/issue-96498/Makefile
index ce2b1b1ff..efdd328c6 100644
--- a/tests/run-make/issue-96498/Makefile
+++ b/tests/run-make/issue-96498/Makefile
@@ -1,7 +1,7 @@
# only-windows
# needs-rust-lld
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# Ensure that LLD can link
all:
diff --git a/tests/run-make-fulldeps/issue-97463-abi-param-passing/Makefile b/tests/run-make/issue-97463-abi-param-passing/Makefile
index db1b53e15..7ce7aaeec 100644
--- a/tests/run-make-fulldeps/issue-97463-abi-param-passing/Makefile
+++ b/tests/run-make/issue-97463-abi-param-passing/Makefile
@@ -1,4 +1,5 @@
--include ../tools.mk
+# ignore-cross-compile
+include ../tools.mk
# ignore-msvc
diff --git a/tests/run-make-fulldeps/issue-97463-abi-param-passing/bad.c b/tests/run-make/issue-97463-abi-param-passing/bad.c
index 013314ab2..013314ab2 100644
--- a/tests/run-make-fulldeps/issue-97463-abi-param-passing/bad.c
+++ b/tests/run-make/issue-97463-abi-param-passing/bad.c
diff --git a/tests/run-make-fulldeps/issue-97463-abi-param-passing/param_passing.rs b/tests/run-make/issue-97463-abi-param-passing/param_passing.rs
index c11f3cc72..c11f3cc72 100644
--- a/tests/run-make-fulldeps/issue-97463-abi-param-passing/param_passing.rs
+++ b/tests/run-make/issue-97463-abi-param-passing/param_passing.rs
diff --git a/tests/run-make-fulldeps/issue64319/Makefile b/tests/run-make/issue64319/Makefile
index ee0d177ab..56346cbcc 100644
--- a/tests/run-make-fulldeps/issue64319/Makefile
+++ b/tests/run-make/issue64319/Makefile
@@ -1,4 +1,5 @@
-include ../../run-make-fulldeps/tools.mk
+# ignore-cross-compile
+include ../tools.mk
# Different optimization levels imply different values for `-Zshare-generics`,
# so try out a whole bunch of combinations to make sure everything is compatible
diff --git a/tests/run-make-fulldeps/issue64319/bar.rs b/tests/run-make/issue64319/bar.rs
index 3895c0b6c..3895c0b6c 100644
--- a/tests/run-make-fulldeps/issue64319/bar.rs
+++ b/tests/run-make/issue64319/bar.rs
diff --git a/tests/run-make-fulldeps/issue64319/foo.rs b/tests/run-make/issue64319/foo.rs
index c54a238e9..c54a238e9 100644
--- a/tests/run-make-fulldeps/issue64319/foo.rs
+++ b/tests/run-make/issue64319/foo.rs
diff --git a/tests/run-make/jobserver-error/Makefile b/tests/run-make/jobserver-error/Makefile
new file mode 100644
index 000000000..4a1699cc7
--- /dev/null
+++ b/tests/run-make/jobserver-error/Makefile
@@ -0,0 +1,9 @@
+include ../tools.mk
+
+# only-linux
+# ignore-test: This test randomly fails, see https://github.com/rust-lang/rust/issues/110321
+
+# Test compiler behavior in case: `jobserver-auth` points to correct pipe which is not jobserver.
+
+all:
+ bash -c 'echo "fn main() {}" | MAKEFLAGS="--jobserver-auth=3,3" $(RUSTC) - 3</dev/null' 2>&1 | diff jobserver.stderr -
diff --git a/tests/run-make/jobserver-error/jobserver.stderr b/tests/run-make/jobserver-error/jobserver.stderr
new file mode 100644
index 000000000..d18e15a26
--- /dev/null
+++ b/tests/run-make/jobserver-error/jobserver.stderr
@@ -0,0 +1,4 @@
+error: failed to acquire jobserver token: early EOF on jobserver pipe
+
+error: aborting due to previous error
+
diff --git a/tests/run-make-fulldeps/libs-through-symlinks/Makefile b/tests/run-make/libs-through-symlinks/Makefile
index 45deaecb8..592eae663 100644
--- a/tests/run-make-fulldeps/libs-through-symlinks/Makefile
+++ b/tests/run-make/libs-through-symlinks/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows
diff --git a/tests/run-make-fulldeps/libs-through-symlinks/bar.rs b/tests/run-make/libs-through-symlinks/bar.rs
index bb7b36c49..bb7b36c49 100644
--- a/tests/run-make-fulldeps/libs-through-symlinks/bar.rs
+++ b/tests/run-make/libs-through-symlinks/bar.rs
diff --git a/tests/run-make-fulldeps/libs-through-symlinks/foo.rs b/tests/run-make/libs-through-symlinks/foo.rs
index 8e3df2c6d..8e3df2c6d 100644
--- a/tests/run-make-fulldeps/libs-through-symlinks/foo.rs
+++ b/tests/run-make/libs-through-symlinks/foo.rs
diff --git a/tests/run-make-fulldeps/libtest-json/Makefile b/tests/run-make/libtest-json/Makefile
index 37b6cb9e2..417637cf0 100644
--- a/tests/run-make-fulldeps/libtest-json/Makefile
+++ b/tests/run-make/libtest-json/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Test expected libtest's JSON output
diff --git a/tests/run-make-fulldeps/libtest-json/f.rs b/tests/run-make/libtest-json/f.rs
index edfe25086..edfe25086 100644
--- a/tests/run-make-fulldeps/libtest-json/f.rs
+++ b/tests/run-make/libtest-json/f.rs
diff --git a/tests/run-make-fulldeps/libtest-json/output-default.json b/tests/run-make/libtest-json/output-default.json
index ad22b66ed..ad22b66ed 100644
--- a/tests/run-make-fulldeps/libtest-json/output-default.json
+++ b/tests/run-make/libtest-json/output-default.json
diff --git a/tests/run-make-fulldeps/libtest-json/output-stdout-success.json b/tests/run-make/libtest-json/output-stdout-success.json
index ec98172eb..ec98172eb 100644
--- a/tests/run-make-fulldeps/libtest-json/output-stdout-success.json
+++ b/tests/run-make/libtest-json/output-stdout-success.json
diff --git a/tests/run-make-fulldeps/libtest-json/validate_json.py b/tests/run-make/libtest-json/validate_json.py
index 657f732f2..657f732f2 100755
--- a/tests/run-make-fulldeps/libtest-json/validate_json.py
+++ b/tests/run-make/libtest-json/validate_json.py
diff --git a/tests/run-make/libtest-thread-limit/Makefile b/tests/run-make/libtest-thread-limit/Makefile
index d43a89e60..9496fa301 100644
--- a/tests/run-make/libtest-thread-limit/Makefile
+++ b/tests/run-make/libtest-thread-limit/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-linux
diff --git a/tests/run-make/libtest-thread-limit/test.rs b/tests/run-make/libtest-thread-limit/test.rs
index 26bc29216..88e8a498a 100644
--- a/tests/run-make/libtest-thread-limit/test.rs
+++ b/tests/run-make/libtest-thread-limit/test.rs
@@ -1,5 +1,3 @@
-#![feature(once_cell)]
-
use std::{
io::ErrorKind,
sync::OnceLock,
diff --git a/tests/run-make-fulldeps/link-arg/Makefile b/tests/run-make/link-arg/Makefile
index 103527c3e..103527c3e 100644
--- a/tests/run-make-fulldeps/link-arg/Makefile
+++ b/tests/run-make/link-arg/Makefile
diff --git a/tests/run-make-fulldeps/link-arg/empty.rs b/tests/run-make/link-arg/empty.rs
index 45590d86b..45590d86b 100644
--- a/tests/run-make-fulldeps/link-arg/empty.rs
+++ b/tests/run-make/link-arg/empty.rs
diff --git a/tests/run-make-fulldeps/link-args-order/Makefile b/tests/run-make/link-args-order/Makefile
index c562cc1b3..c562cc1b3 100644
--- a/tests/run-make-fulldeps/link-args-order/Makefile
+++ b/tests/run-make/link-args-order/Makefile
diff --git a/tests/run-make-fulldeps/link-args-order/empty.rs b/tests/run-make/link-args-order/empty.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/link-args-order/empty.rs
+++ b/tests/run-make/link-args-order/empty.rs
diff --git a/tests/run-make-fulldeps/link-cfg/Makefile b/tests/run-make/link-cfg/Makefile
index 0b25ccded..a40997011 100644
--- a/tests/run-make-fulldeps/link-cfg/Makefile
+++ b/tests/run-make/link-cfg/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call DYLIB,return1) $(call DYLIB,return2) $(call NATIVE_STATICLIB,return3)
diff --git a/tests/run-make-fulldeps/link-cfg/dep-with-staticlib.rs b/tests/run-make/link-cfg/dep-with-staticlib.rs
index 5ad66475d..5ad66475d 100644
--- a/tests/run-make-fulldeps/link-cfg/dep-with-staticlib.rs
+++ b/tests/run-make/link-cfg/dep-with-staticlib.rs
diff --git a/tests/run-make-fulldeps/link-cfg/dep.rs b/tests/run-make/link-cfg/dep.rs
index 40de77f05..40de77f05 100644
--- a/tests/run-make-fulldeps/link-cfg/dep.rs
+++ b/tests/run-make/link-cfg/dep.rs
diff --git a/tests/run-make-fulldeps/link-cfg/no-deps.rs b/tests/run-make/link-cfg/no-deps.rs
index ba5a8711a..ba5a8711a 100644
--- a/tests/run-make-fulldeps/link-cfg/no-deps.rs
+++ b/tests/run-make/link-cfg/no-deps.rs
diff --git a/tests/run-make-fulldeps/link-cfg/return1.c b/tests/run-make/link-cfg/return1.c
index 41c2809ad..41c2809ad 100644
--- a/tests/run-make-fulldeps/link-cfg/return1.c
+++ b/tests/run-make/link-cfg/return1.c
diff --git a/tests/run-make-fulldeps/link-cfg/return2.c b/tests/run-make/link-cfg/return2.c
index 622aeaa29..622aeaa29 100644
--- a/tests/run-make-fulldeps/link-cfg/return2.c
+++ b/tests/run-make/link-cfg/return2.c
diff --git a/tests/run-make-fulldeps/link-cfg/return3.c b/tests/run-make/link-cfg/return3.c
index f29dc60d5..f29dc60d5 100644
--- a/tests/run-make-fulldeps/link-cfg/return3.c
+++ b/tests/run-make/link-cfg/return3.c
diff --git a/tests/run-make-fulldeps/link-cfg/with-deps.rs b/tests/run-make/link-cfg/with-deps.rs
index 48b782815..48b782815 100644
--- a/tests/run-make-fulldeps/link-cfg/with-deps.rs
+++ b/tests/run-make/link-cfg/with-deps.rs
diff --git a/tests/run-make-fulldeps/link-cfg/with-staticlib-deps.rs b/tests/run-make/link-cfg/with-staticlib-deps.rs
index 23e5926a7..23e5926a7 100644
--- a/tests/run-make-fulldeps/link-cfg/with-staticlib-deps.rs
+++ b/tests/run-make/link-cfg/with-staticlib-deps.rs
diff --git a/tests/run-make-fulldeps/link-dedup/Makefile b/tests/run-make/link-dedup/Makefile
index eff18ab48..eff18ab48 100644
--- a/tests/run-make-fulldeps/link-dedup/Makefile
+++ b/tests/run-make/link-dedup/Makefile
diff --git a/tests/run-make-fulldeps/link-dedup/depa.rs b/tests/run-make/link-dedup/depa.rs
index 19178c5bd..19178c5bd 100644
--- a/tests/run-make-fulldeps/link-dedup/depa.rs
+++ b/tests/run-make/link-dedup/depa.rs
diff --git a/tests/run-make-fulldeps/link-dedup/depb.rs b/tests/run-make/link-dedup/depb.rs
index b1be21fe0..b1be21fe0 100644
--- a/tests/run-make-fulldeps/link-dedup/depb.rs
+++ b/tests/run-make/link-dedup/depb.rs
diff --git a/tests/run-make-fulldeps/link-dedup/depc.rs b/tests/run-make/link-dedup/depc.rs
index 8dcb3dee5..8dcb3dee5 100644
--- a/tests/run-make-fulldeps/link-dedup/depc.rs
+++ b/tests/run-make/link-dedup/depc.rs
diff --git a/tests/run-make-fulldeps/link-dedup/empty.rs b/tests/run-make/link-dedup/empty.rs
index e00ae18f4..e00ae18f4 100644
--- a/tests/run-make-fulldeps/link-dedup/empty.rs
+++ b/tests/run-make/link-dedup/empty.rs
diff --git a/tests/run-make-fulldeps/link-path-order/Makefile b/tests/run-make/link-path-order/Makefile
index ed7c299e6..a3831a63a 100644
--- a/tests/run-make-fulldeps/link-path-order/Makefile
+++ b/tests/run-make/link-path-order/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Verifies that the -L arguments given to the linker is in the same order
diff --git a/tests/run-make-fulldeps/link-path-order/correct.c b/tests/run-make/link-path-order/correct.c
index 3064af952..3064af952 100644
--- a/tests/run-make-fulldeps/link-path-order/correct.c
+++ b/tests/run-make/link-path-order/correct.c
diff --git a/tests/run-make-fulldeps/link-path-order/main.rs b/tests/run-make/link-path-order/main.rs
index 8024e343d..8024e343d 100644
--- a/tests/run-make-fulldeps/link-path-order/main.rs
+++ b/tests/run-make/link-path-order/main.rs
diff --git a/tests/run-make-fulldeps/link-path-order/wrong.c b/tests/run-make/link-path-order/wrong.c
index 64275b3ad..64275b3ad 100644
--- a/tests/run-make-fulldeps/link-path-order/wrong.c
+++ b/tests/run-make/link-path-order/wrong.c
diff --git a/tests/run-make-fulldeps/linkage-attr-on-static/Makefile b/tests/run-make/linkage-attr-on-static/Makefile
index 7cc54e40a..ef50a7ef9 100644
--- a/tests/run-make-fulldeps/linkage-attr-on-static/Makefile
+++ b/tests/run-make/linkage-attr-on-static/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,foo)
diff --git a/tests/run-make-fulldeps/linkage-attr-on-static/bar.rs b/tests/run-make/linkage-attr-on-static/bar.rs
index 68607cbb6..68607cbb6 100644
--- a/tests/run-make-fulldeps/linkage-attr-on-static/bar.rs
+++ b/tests/run-make/linkage-attr-on-static/bar.rs
diff --git a/tests/run-make-fulldeps/linkage-attr-on-static/foo.c b/tests/run-make/linkage-attr-on-static/foo.c
index 78a6934f5..78a6934f5 100644
--- a/tests/run-make-fulldeps/linkage-attr-on-static/foo.c
+++ b/tests/run-make/linkage-attr-on-static/foo.c
diff --git a/tests/run-make/llvm-outputs/Makefile b/tests/run-make/llvm-outputs/Makefile
index a3f25eba0..cccf1dd66 100644
--- a/tests/run-make/llvm-outputs/Makefile
+++ b/tests/run-make/llvm-outputs/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
echo 'fn main() {}' | $(BARE_RUSTC) - --out-dir=$(TMPDIR)/random_directory_that_does_not_exist_ir/ --emit=llvm-ir
diff --git a/tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile b/tests/run-make/long-linker-command-lines-cmd-exe/Makefile
index a38f4fe5d..e43aab7f8 100644
--- a/tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile
+++ b/tests/run-make/long-linker-command-lines-cmd-exe/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/foo.bat b/tests/run-make/long-linker-command-lines-cmd-exe/foo.bat
index a9350f12b..a9350f12b 100644
--- a/tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/foo.bat
+++ b/tests/run-make/long-linker-command-lines-cmd-exe/foo.bat
diff --git a/tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/foo.rs b/tests/run-make/long-linker-command-lines-cmd-exe/foo.rs
index 74d7b9b07..74d7b9b07 100644
--- a/tests/run-make-fulldeps/long-linker-command-lines-cmd-exe/foo.rs
+++ b/tests/run-make/long-linker-command-lines-cmd-exe/foo.rs
diff --git a/tests/run-make-fulldeps/long-linker-command-lines/Makefile b/tests/run-make/long-linker-command-lines/Makefile
index 00199ca97..f864ea74f 100644
--- a/tests/run-make-fulldeps/long-linker-command-lines/Makefile
+++ b/tests/run-make/long-linker-command-lines/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/long-linker-command-lines/foo.rs b/tests/run-make/long-linker-command-lines/foo.rs
index db238c0cf..db238c0cf 100644
--- a/tests/run-make-fulldeps/long-linker-command-lines/foo.rs
+++ b/tests/run-make/long-linker-command-lines/foo.rs
diff --git a/tests/run-make-fulldeps/longjmp-across-rust/Makefile b/tests/run-make/longjmp-across-rust/Makefile
index 848638d82..5fd2d4f85 100644
--- a/tests/run-make-fulldeps/longjmp-across-rust/Makefile
+++ b/tests/run-make/longjmp-across-rust/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,foo)
diff --git a/tests/run-make-fulldeps/longjmp-across-rust/foo.c b/tests/run-make/longjmp-across-rust/foo.c
index bd71cc4d7..bd71cc4d7 100644
--- a/tests/run-make-fulldeps/longjmp-across-rust/foo.c
+++ b/tests/run-make/longjmp-across-rust/foo.c
diff --git a/tests/run-make-fulldeps/longjmp-across-rust/main.rs b/tests/run-make/longjmp-across-rust/main.rs
index cc1d5b126..cc1d5b126 100644
--- a/tests/run-make-fulldeps/longjmp-across-rust/main.rs
+++ b/tests/run-make/longjmp-across-rust/main.rs
diff --git a/tests/run-make-fulldeps/ls-metadata/Makefile b/tests/run-make/ls-metadata/Makefile
index e0f916a24..123dd64e1 100644
--- a/tests/run-make-fulldeps/ls-metadata/Makefile
+++ b/tests/run-make/ls-metadata/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/ls-metadata/foo.rs b/tests/run-make/ls-metadata/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/ls-metadata/foo.rs
+++ b/tests/run-make/ls-metadata/foo.rs
diff --git a/tests/run-make-fulldeps/lto-dylib-dep/Makefile b/tests/run-make/lto-dylib-dep/Makefile
index 41487b23c..a9344597d 100644
--- a/tests/run-make-fulldeps/lto-dylib-dep/Makefile
+++ b/tests/run-make/lto-dylib-dep/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Test that we don't run into an assertion when using a Rust dylib dependency
diff --git a/tests/run-make-fulldeps/lto-dylib-dep/a_dylib.rs b/tests/run-make/lto-dylib-dep/a_dylib.rs
index e63457e6e..e63457e6e 100644
--- a/tests/run-make-fulldeps/lto-dylib-dep/a_dylib.rs
+++ b/tests/run-make/lto-dylib-dep/a_dylib.rs
diff --git a/tests/run-make-fulldeps/lto-dylib-dep/main.rs b/tests/run-make/lto-dylib-dep/main.rs
index 4fb3c4730..4fb3c4730 100644
--- a/tests/run-make-fulldeps/lto-dylib-dep/main.rs
+++ b/tests/run-make/lto-dylib-dep/main.rs
diff --git a/tests/run-make-fulldeps/lto-empty/Makefile b/tests/run-make/lto-empty/Makefile
index b4345ba18..1b795c4b7 100644
--- a/tests/run-make-fulldeps/lto-empty/Makefile
+++ b/tests/run-make/lto-empty/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: cdylib-fat cdylib-thin
diff --git a/tests/run-make-fulldeps/lto-empty/lib.rs b/tests/run-make/lto-empty/lib.rs
index e3663c790..e3663c790 100644
--- a/tests/run-make-fulldeps/lto-empty/lib.rs
+++ b/tests/run-make/lto-empty/lib.rs
diff --git a/tests/run-make-fulldeps/lto-no-link-whole-rlib/Makefile b/tests/run-make/lto-no-link-whole-rlib/Makefile
index e576ee37c..3e82322e7 100644
--- a/tests/run-make-fulldeps/lto-no-link-whole-rlib/Makefile
+++ b/tests/run-make/lto-no-link-whole-rlib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,foo) $(call NATIVE_STATICLIB,bar)
diff --git a/tests/run-make-fulldeps/lto-no-link-whole-rlib/bar.c b/tests/run-make/lto-no-link-whole-rlib/bar.c
index b25011930..b25011930 100644
--- a/tests/run-make-fulldeps/lto-no-link-whole-rlib/bar.c
+++ b/tests/run-make/lto-no-link-whole-rlib/bar.c
diff --git a/tests/run-make-fulldeps/lto-no-link-whole-rlib/foo.c b/tests/run-make/lto-no-link-whole-rlib/foo.c
index 75010458e..75010458e 100644
--- a/tests/run-make-fulldeps/lto-no-link-whole-rlib/foo.c
+++ b/tests/run-make/lto-no-link-whole-rlib/foo.c
diff --git a/tests/run-make-fulldeps/lto-no-link-whole-rlib/lib1.rs b/tests/run-make/lto-no-link-whole-rlib/lib1.rs
index f70bb3382..f70bb3382 100644
--- a/tests/run-make-fulldeps/lto-no-link-whole-rlib/lib1.rs
+++ b/tests/run-make/lto-no-link-whole-rlib/lib1.rs
diff --git a/tests/run-make-fulldeps/lto-no-link-whole-rlib/lib2.rs b/tests/run-make/lto-no-link-whole-rlib/lib2.rs
index 2dec2a271..2dec2a271 100644
--- a/tests/run-make-fulldeps/lto-no-link-whole-rlib/lib2.rs
+++ b/tests/run-make/lto-no-link-whole-rlib/lib2.rs
diff --git a/tests/run-make-fulldeps/lto-no-link-whole-rlib/main.rs b/tests/run-make/lto-no-link-whole-rlib/main.rs
index 0c658808e..0c658808e 100644
--- a/tests/run-make-fulldeps/lto-no-link-whole-rlib/main.rs
+++ b/tests/run-make/lto-no-link-whole-rlib/main.rs
diff --git a/tests/run-make-fulldeps/lto-readonly-lib/Makefile b/tests/run-make/lto-readonly-lib/Makefile
index a20ecea88..11d944e3e 100644
--- a/tests/run-make-fulldeps/lto-readonly-lib/Makefile
+++ b/tests/run-make/lto-readonly-lib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/lto-readonly-lib/lib.rs b/tests/run-make/lto-readonly-lib/lib.rs
index c1bfaa6ca..c1bfaa6ca 100644
--- a/tests/run-make-fulldeps/lto-readonly-lib/lib.rs
+++ b/tests/run-make/lto-readonly-lib/lib.rs
diff --git a/tests/run-make-fulldeps/lto-readonly-lib/main.rs b/tests/run-make/lto-readonly-lib/main.rs
index 69da798b3..69da798b3 100644
--- a/tests/run-make-fulldeps/lto-readonly-lib/main.rs
+++ b/tests/run-make/lto-readonly-lib/main.rs
diff --git a/tests/run-make-fulldeps/lto-smoke-c/Makefile b/tests/run-make/lto-smoke-c/Makefile
index 7c6ee3be8..f1ba3d95d 100644
--- a/tests/run-make-fulldeps/lto-smoke-c/Makefile
+++ b/tests/run-make/lto-smoke-c/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Apparently older versions of GCC segfault if -g is passed...
diff --git a/tests/run-make-fulldeps/lto-smoke-c/bar.c b/tests/run-make/lto-smoke-c/bar.c
index bb4036b06..bb4036b06 100644
--- a/tests/run-make-fulldeps/lto-smoke-c/bar.c
+++ b/tests/run-make/lto-smoke-c/bar.c
diff --git a/tests/run-make-fulldeps/lto-smoke-c/foo.rs b/tests/run-make/lto-smoke-c/foo.rs
index 2e59432cd..2e59432cd 100644
--- a/tests/run-make-fulldeps/lto-smoke-c/foo.rs
+++ b/tests/run-make/lto-smoke-c/foo.rs
diff --git a/tests/run-make-fulldeps/lto-smoke/Makefile b/tests/run-make/lto-smoke/Makefile
index 8bce708b4..13a09fce7 100644
--- a/tests/run-make-fulldeps/lto-smoke/Makefile
+++ b/tests/run-make/lto-smoke/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: noparam bool_true bool_false thin fat
diff --git a/tests/run-make-fulldeps/lto-smoke/lib.rs b/tests/run-make/lto-smoke/lib.rs
index c1bfaa6ca..c1bfaa6ca 100644
--- a/tests/run-make-fulldeps/lto-smoke/lib.rs
+++ b/tests/run-make/lto-smoke/lib.rs
diff --git a/tests/run-make-fulldeps/lto-smoke/main.rs b/tests/run-make/lto-smoke/main.rs
index 69da798b3..69da798b3 100644
--- a/tests/run-make-fulldeps/lto-smoke/main.rs
+++ b/tests/run-make/lto-smoke/main.rs
diff --git a/tests/run-make/macos-deployment-target/Makefile b/tests/run-make/macos-deployment-target/Makefile
index 70fca0436..d0cf836bc 100644
--- a/tests/run-make/macos-deployment-target/Makefile
+++ b/tests/run-make/macos-deployment-target/Makefile
@@ -4,7 +4,7 @@
# This is important since its a compatibility hazard. The linker will
# generate load commands differently based on what minimum OS it can assume.
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
ifeq ($(strip $(shell uname -m)),arm64)
GREP_PATTERN = "minos 11.0"
diff --git a/tests/run-make/macos-fat-archive/Makefile b/tests/run-make/macos-fat-archive/Makefile
index cc99375db..b6582c809 100644
--- a/tests/run-make/macos-fat-archive/Makefile
+++ b/tests/run-make/macos-fat-archive/Makefile
@@ -1,6 +1,6 @@
# only-macos
--include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
"$(TMPDIR)"/libnative-library.a: native-library.c
$(CC) -arch arm64 -arch x86_64 native-library.c -c -o "$(TMPDIR)"/native-library.o
diff --git a/tests/run-make-fulldeps/manual-crate-name/Makefile b/tests/run-make/manual-crate-name/Makefile
index c00e20c7c..c00e20c7c 100644
--- a/tests/run-make-fulldeps/manual-crate-name/Makefile
+++ b/tests/run-make/manual-crate-name/Makefile
diff --git a/tests/run-make-fulldeps/manual-crate-name/bar.rs b/tests/run-make/manual-crate-name/bar.rs
index c1bfaa6ca..c1bfaa6ca 100644
--- a/tests/run-make-fulldeps/manual-crate-name/bar.rs
+++ b/tests/run-make/manual-crate-name/bar.rs
diff --git a/tests/run-make-fulldeps/manual-link/Makefile b/tests/run-make/manual-link/Makefile
index 401f6eb44..8dbf0460f 100644
--- a/tests/run-make-fulldeps/manual-link/Makefile
+++ b/tests/run-make/manual-link/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(TMPDIR)/libbar.a
diff --git a/tests/run-make-fulldeps/manual-link/bar.c b/tests/run-make/manual-link/bar.c
index e42599986..e42599986 100644
--- a/tests/run-make-fulldeps/manual-link/bar.c
+++ b/tests/run-make/manual-link/bar.c
diff --git a/tests/run-make-fulldeps/manual-link/foo.c b/tests/run-make/manual-link/foo.c
index e42599986..e42599986 100644
--- a/tests/run-make-fulldeps/manual-link/foo.c
+++ b/tests/run-make/manual-link/foo.c
diff --git a/tests/run-make-fulldeps/manual-link/foo.rs b/tests/run-make/manual-link/foo.rs
index c1f28236f..c1f28236f 100644
--- a/tests/run-make-fulldeps/manual-link/foo.rs
+++ b/tests/run-make/manual-link/foo.rs
diff --git a/tests/run-make-fulldeps/manual-link/main.rs b/tests/run-make/manual-link/main.rs
index fe35f1f8e..fe35f1f8e 100644
--- a/tests/run-make-fulldeps/manual-link/main.rs
+++ b/tests/run-make/manual-link/main.rs
diff --git a/tests/run-make-fulldeps/many-crates-but-no-match/Makefile b/tests/run-make/many-crates-but-no-match/Makefile
index ca0ab8e9e..ca0ab8e9e 100644
--- a/tests/run-make-fulldeps/many-crates-but-no-match/Makefile
+++ b/tests/run-make/many-crates-but-no-match/Makefile
diff --git a/tests/run-make-fulldeps/many-crates-but-no-match/crateA1.rs b/tests/run-make/many-crates-but-no-match/crateA1.rs
index 3fed5a38e..3fed5a38e 100644
--- a/tests/run-make-fulldeps/many-crates-but-no-match/crateA1.rs
+++ b/tests/run-make/many-crates-but-no-match/crateA1.rs
diff --git a/tests/run-make-fulldeps/many-crates-but-no-match/crateA2.rs b/tests/run-make/many-crates-but-no-match/crateA2.rs
index 8db07a015..8db07a015 100644
--- a/tests/run-make-fulldeps/many-crates-but-no-match/crateA2.rs
+++ b/tests/run-make/many-crates-but-no-match/crateA2.rs
diff --git a/tests/run-make-fulldeps/many-crates-but-no-match/crateA3.rs b/tests/run-make/many-crates-but-no-match/crateA3.rs
index a1e8e40a3..a1e8e40a3 100644
--- a/tests/run-make-fulldeps/many-crates-but-no-match/crateA3.rs
+++ b/tests/run-make/many-crates-but-no-match/crateA3.rs
diff --git a/tests/run-make-fulldeps/many-crates-but-no-match/crateB.rs b/tests/run-make/many-crates-but-no-match/crateB.rs
index 4ccd65d65..4ccd65d65 100644
--- a/tests/run-make-fulldeps/many-crates-but-no-match/crateB.rs
+++ b/tests/run-make/many-crates-but-no-match/crateB.rs
diff --git a/tests/run-make-fulldeps/many-crates-but-no-match/crateC.rs b/tests/run-make/many-crates-but-no-match/crateC.rs
index a8b817ec6..a8b817ec6 100644
--- a/tests/run-make-fulldeps/many-crates-but-no-match/crateC.rs
+++ b/tests/run-make/many-crates-but-no-match/crateC.rs
diff --git a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile b/tests/run-make/metadata-flag-frobs-symbols/Makefile
index dc6b10f4e..53d7d0657 100644
--- a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile
+++ b/tests/run-make/metadata-flag-frobs-symbols/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/bar.rs b/tests/run-make/metadata-flag-frobs-symbols/bar.rs
index 1e6957a36..1e6957a36 100644
--- a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/bar.rs
+++ b/tests/run-make/metadata-flag-frobs-symbols/bar.rs
diff --git a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/foo.rs b/tests/run-make/metadata-flag-frobs-symbols/foo.rs
index 696aed2fa..696aed2fa 100644
--- a/tests/run-make-fulldeps/metadata-flag-frobs-symbols/foo.rs
+++ b/tests/run-make/metadata-flag-frobs-symbols/foo.rs
diff --git a/tests/run-make-fulldeps/min-global-align/Makefile b/tests/run-make/min-global-align/Makefile
index 82f38749e..82f38749e 100644
--- a/tests/run-make-fulldeps/min-global-align/Makefile
+++ b/tests/run-make/min-global-align/Makefile
diff --git a/tests/run-make-fulldeps/min-global-align/min_global_align.rs b/tests/run-make/min-global-align/min_global_align.rs
index 135792e93..135792e93 100644
--- a/tests/run-make-fulldeps/min-global-align/min_global_align.rs
+++ b/tests/run-make/min-global-align/min_global_align.rs
diff --git a/tests/run-make-fulldeps/mingw-export-call-convention/Makefile b/tests/run-make/mingw-export-call-convention/Makefile
index 4a60059cc..4a60059cc 100644
--- a/tests/run-make-fulldeps/mingw-export-call-convention/Makefile
+++ b/tests/run-make/mingw-export-call-convention/Makefile
diff --git a/tests/run-make-fulldeps/mingw-export-call-convention/foo.rs b/tests/run-make/mingw-export-call-convention/foo.rs
index 1fec00311..1fec00311 100644
--- a/tests/run-make-fulldeps/mingw-export-call-convention/foo.rs
+++ b/tests/run-make/mingw-export-call-convention/foo.rs
diff --git a/tests/run-make-fulldeps/mismatching-target-triples/Makefile b/tests/run-make/mismatching-target-triples/Makefile
index 409388e04..409388e04 100644
--- a/tests/run-make-fulldeps/mismatching-target-triples/Makefile
+++ b/tests/run-make/mismatching-target-triples/Makefile
diff --git a/tests/run-make-fulldeps/mismatching-target-triples/bar.rs b/tests/run-make/mismatching-target-triples/bar.rs
index b2c2fc1c4..b2c2fc1c4 100644
--- a/tests/run-make-fulldeps/mismatching-target-triples/bar.rs
+++ b/tests/run-make/mismatching-target-triples/bar.rs
diff --git a/tests/run-make-fulldeps/mismatching-target-triples/foo.rs b/tests/run-make/mismatching-target-triples/foo.rs
index 6fa054914..6fa054914 100644
--- a/tests/run-make-fulldeps/mismatching-target-triples/foo.rs
+++ b/tests/run-make/mismatching-target-triples/foo.rs
diff --git a/tests/run-make-fulldeps/missing-crate-dependency/Makefile b/tests/run-make/missing-crate-dependency/Makefile
index 7c271ab8a..7c271ab8a 100644
--- a/tests/run-make-fulldeps/missing-crate-dependency/Makefile
+++ b/tests/run-make/missing-crate-dependency/Makefile
diff --git a/tests/run-make-fulldeps/missing-crate-dependency/crateA.rs b/tests/run-make/missing-crate-dependency/crateA.rs
index 31433cb60..31433cb60 100644
--- a/tests/run-make-fulldeps/missing-crate-dependency/crateA.rs
+++ b/tests/run-make/missing-crate-dependency/crateA.rs
diff --git a/tests/run-make-fulldeps/missing-crate-dependency/crateB.rs b/tests/run-make/missing-crate-dependency/crateB.rs
index 4ccd65d65..4ccd65d65 100644
--- a/tests/run-make-fulldeps/missing-crate-dependency/crateB.rs
+++ b/tests/run-make/missing-crate-dependency/crateB.rs
diff --git a/tests/run-make-fulldeps/missing-crate-dependency/crateC.rs b/tests/run-make/missing-crate-dependency/crateC.rs
index a8b817ec6..a8b817ec6 100644
--- a/tests/run-make-fulldeps/missing-crate-dependency/crateC.rs
+++ b/tests/run-make/missing-crate-dependency/crateC.rs
diff --git a/tests/run-make-fulldeps/mixing-deps/Makefile b/tests/run-make/mixing-deps/Makefile
index 956e704ee..c2a5a2a0a 100644
--- a/tests/run-make-fulldeps/mixing-deps/Makefile
+++ b/tests/run-make/mixing-deps/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/mixing-deps/both.rs b/tests/run-make/mixing-deps/both.rs
index 6a5818763..6a5818763 100644
--- a/tests/run-make-fulldeps/mixing-deps/both.rs
+++ b/tests/run-make/mixing-deps/both.rs
diff --git a/tests/run-make-fulldeps/mixing-deps/dylib.rs b/tests/run-make/mixing-deps/dylib.rs
index 88976d5b6..88976d5b6 100644
--- a/tests/run-make-fulldeps/mixing-deps/dylib.rs
+++ b/tests/run-make/mixing-deps/dylib.rs
diff --git a/tests/run-make-fulldeps/mixing-deps/prog.rs b/tests/run-make/mixing-deps/prog.rs
index 188981dc1..188981dc1 100644
--- a/tests/run-make-fulldeps/mixing-deps/prog.rs
+++ b/tests/run-make/mixing-deps/prog.rs
diff --git a/tests/run-make-fulldeps/mixing-formats/Makefile b/tests/run-make/mixing-formats/Makefile
index b27e54257..d01978a15 100644
--- a/tests/run-make-fulldeps/mixing-formats/Makefile
+++ b/tests/run-make/mixing-formats/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# Testing various mixings of rlibs and dylibs. Makes sure that it's possible to
diff --git a/tests/run-make-fulldeps/mixing-formats/bar1.rs b/tests/run-make/mixing-formats/bar1.rs
index 49af74e1b..49af74e1b 100644
--- a/tests/run-make-fulldeps/mixing-formats/bar1.rs
+++ b/tests/run-make/mixing-formats/bar1.rs
diff --git a/tests/run-make-fulldeps/mixing-formats/bar2.rs b/tests/run-make/mixing-formats/bar2.rs
index 49af74e1b..49af74e1b 100644
--- a/tests/run-make-fulldeps/mixing-formats/bar2.rs
+++ b/tests/run-make/mixing-formats/bar2.rs
diff --git a/tests/run-make-fulldeps/mixing-formats/baz.rs b/tests/run-make/mixing-formats/baz.rs
index 99a73159e..99a73159e 100644
--- a/tests/run-make-fulldeps/mixing-formats/baz.rs
+++ b/tests/run-make/mixing-formats/baz.rs
diff --git a/tests/run-make-fulldeps/mixing-formats/baz2.rs b/tests/run-make/mixing-formats/baz2.rs
index d0fab1e4c..d0fab1e4c 100644
--- a/tests/run-make-fulldeps/mixing-formats/baz2.rs
+++ b/tests/run-make/mixing-formats/baz2.rs
diff --git a/tests/run-make-fulldeps/mixing-formats/foo.rs b/tests/run-make/mixing-formats/foo.rs
index d11c69f81..d11c69f81 100644
--- a/tests/run-make-fulldeps/mixing-formats/foo.rs
+++ b/tests/run-make/mixing-formats/foo.rs
diff --git a/tests/run-make-fulldeps/mixing-libs/Makefile b/tests/run-make/mixing-libs/Makefile
index 39cc0708c..e8262b284 100644
--- a/tests/run-make-fulldeps/mixing-libs/Makefile
+++ b/tests/run-make/mixing-libs/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/mixing-libs/dylib.rs b/tests/run-make/mixing-libs/dylib.rs
index 685688750..685688750 100644
--- a/tests/run-make-fulldeps/mixing-libs/dylib.rs
+++ b/tests/run-make/mixing-libs/dylib.rs
diff --git a/tests/run-make-fulldeps/mixing-libs/prog.rs b/tests/run-make/mixing-libs/prog.rs
index 14ce5c951..14ce5c951 100644
--- a/tests/run-make-fulldeps/mixing-libs/prog.rs
+++ b/tests/run-make/mixing-libs/prog.rs
diff --git a/tests/run-make-fulldeps/mixing-libs/rlib.rs b/tests/run-make/mixing-libs/rlib.rs
index 96dcd16bb..96dcd16bb 100644
--- a/tests/run-make-fulldeps/mixing-libs/rlib.rs
+++ b/tests/run-make/mixing-libs/rlib.rs
diff --git a/tests/run-make-fulldeps/msvc-opt-minsize/Makefile b/tests/run-make/msvc-opt-minsize/Makefile
index a5f019f24..32e6e2801 100644
--- a/tests/run-make-fulldeps/msvc-opt-minsize/Makefile
+++ b/tests/run-make/msvc-opt-minsize/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/msvc-opt-minsize/foo.rs b/tests/run-make/msvc-opt-minsize/foo.rs
index 3f5496c08..3f5496c08 100644
--- a/tests/run-make-fulldeps/msvc-opt-minsize/foo.rs
+++ b/tests/run-make/msvc-opt-minsize/foo.rs
diff --git a/tests/run-make-fulldeps/multiple-emits/Makefile b/tests/run-make/multiple-emits/Makefile
index d1f297644..d1f297644 100644
--- a/tests/run-make-fulldeps/multiple-emits/Makefile
+++ b/tests/run-make/multiple-emits/Makefile
diff --git a/tests/run-make-fulldeps/multiple-emits/foo.rs b/tests/run-make/multiple-emits/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/multiple-emits/foo.rs
+++ b/tests/run-make/multiple-emits/foo.rs
diff --git a/tests/run-make/native-link-modifier-bundle/Makefile b/tests/run-make/native-link-modifier-bundle/Makefile
index e8a1121bf..527720922 100644
--- a/tests/run-make/native-link-modifier-bundle/Makefile
+++ b/tests/run-make/native-link-modifier-bundle/Makefile
@@ -1,7 +1,7 @@
# ignore-cross-compile
# ignore-windows-msvc
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# We're using the llvm-nm instead of the system nm to ensure it is compatible
# with the LLVM bitcode generated by rustc.
diff --git a/tests/run-make/native-link-modifier-verbatim-linker/Makefile b/tests/run-make/native-link-modifier-verbatim-linker/Makefile
index 666e4084c..256dc2d06 100644
--- a/tests/run-make/native-link-modifier-verbatim-linker/Makefile
+++ b/tests/run-make/native-link-modifier-verbatim-linker/Makefile
@@ -1,7 +1,7 @@
# ignore-cross-compile
# ignore-macos
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
# Verbatim allows specify precise name.
diff --git a/tests/run-make/native-link-modifier-verbatim-rustc/Makefile b/tests/run-make/native-link-modifier-verbatim-rustc/Makefile
index 6f01f3780..dfd6ec50f 100644
--- a/tests/run-make/native-link-modifier-verbatim-rustc/Makefile
+++ b/tests/run-make/native-link-modifier-verbatim-rustc/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
# Verbatim allows specify precise name.
diff --git a/tests/run-make/native-link-modifier-whole-archive/Makefile b/tests/run-make/native-link-modifier-whole-archive/Makefile
index f26bd864c..5eb7a416f 100644
--- a/tests/run-make/native-link-modifier-whole-archive/Makefile
+++ b/tests/run-make/native-link-modifier-whole-archive/Makefile
@@ -8,7 +8,7 @@
# that code would never make it into the final executable and we'd thus be missing some
# of the output.
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all: $(TMPDIR)/$(call BIN,directly_linked) \
$(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive) \
diff --git a/tests/run-make-fulldeps/no-builtins-lto/Makefile b/tests/run-make/no-builtins-lto/Makefile
index c8f05d991..c8f05d991 100644
--- a/tests/run-make-fulldeps/no-builtins-lto/Makefile
+++ b/tests/run-make/no-builtins-lto/Makefile
diff --git a/tests/run-make-fulldeps/no-builtins-lto/main.rs b/tests/run-make/no-builtins-lto/main.rs
index 890c999c8..890c999c8 100644
--- a/tests/run-make-fulldeps/no-builtins-lto/main.rs
+++ b/tests/run-make/no-builtins-lto/main.rs
diff --git a/tests/run-make-fulldeps/no-builtins-lto/no_builtins.rs b/tests/run-make/no-builtins-lto/no_builtins.rs
index 5d001031a..5d001031a 100644
--- a/tests/run-make-fulldeps/no-builtins-lto/no_builtins.rs
+++ b/tests/run-make/no-builtins-lto/no_builtins.rs
diff --git a/tests/run-make-fulldeps/no-duplicate-libs/Makefile b/tests/run-make/no-duplicate-libs/Makefile
index b05aff782..4be8c0262 100644
--- a/tests/run-make-fulldeps/no-duplicate-libs/Makefile
+++ b/tests/run-make/no-duplicate-libs/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
ifdef IS_MSVC
diff --git a/tests/run-make-fulldeps/no-duplicate-libs/bar.c b/tests/run-make/no-duplicate-libs/bar.c
index e36952657..e36952657 100644
--- a/tests/run-make-fulldeps/no-duplicate-libs/bar.c
+++ b/tests/run-make/no-duplicate-libs/bar.c
diff --git a/tests/run-make-fulldeps/no-duplicate-libs/foo.c b/tests/run-make/no-duplicate-libs/foo.c
index 85e6cd8c3..85e6cd8c3 100644
--- a/tests/run-make-fulldeps/no-duplicate-libs/foo.c
+++ b/tests/run-make/no-duplicate-libs/foo.c
diff --git a/tests/run-make-fulldeps/no-duplicate-libs/main.rs b/tests/run-make/no-duplicate-libs/main.rs
index b25ef35ad..b25ef35ad 100644
--- a/tests/run-make-fulldeps/no-duplicate-libs/main.rs
+++ b/tests/run-make/no-duplicate-libs/main.rs
diff --git a/tests/run-make/no-input-file/Makefile b/tests/run-make/no-input-file/Makefile
index 2f0215922..a754573a5 100644
--- a/tests/run-make/no-input-file/Makefile
+++ b/tests/run-make/no-input-file/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) --print crate-name 2>&1 | diff - no-input-file.stderr
diff --git a/tests/run-make-fulldeps/no-intermediate-extras/Makefile b/tests/run-make/no-intermediate-extras/Makefile
index 4116aac1b..83b5cedcf 100644
--- a/tests/run-make-fulldeps/no-intermediate-extras/Makefile
+++ b/tests/run-make/no-intermediate-extras/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
# Regression test for issue #10973
include ../tools.mk
diff --git a/tests/run-make-fulldeps/no-intermediate-extras/foo.rs b/tests/run-make/no-intermediate-extras/foo.rs
index d11c69f81..d11c69f81 100644
--- a/tests/run-make-fulldeps/no-intermediate-extras/foo.rs
+++ b/tests/run-make/no-intermediate-extras/foo.rs
diff --git a/tests/run-make-fulldeps/obey-crate-type-flag/Makefile b/tests/run-make/obey-crate-type-flag/Makefile
index effcfc94c..ecbb2e620 100644
--- a/tests/run-make-fulldeps/obey-crate-type-flag/Makefile
+++ b/tests/run-make/obey-crate-type-flag/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# check that rustc builds all crate_type attributes
diff --git a/tests/run-make-fulldeps/obey-crate-type-flag/test.rs b/tests/run-make/obey-crate-type-flag/test.rs
index 8a768f9de..8a768f9de 100644
--- a/tests/run-make-fulldeps/obey-crate-type-flag/test.rs
+++ b/tests/run-make/obey-crate-type-flag/test.rs
diff --git a/tests/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile b/tests/run-make/output-filename-conflicts-with-directory/Makefile
index 45221356c..45221356c 100644
--- a/tests/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile
+++ b/tests/run-make/output-filename-conflicts-with-directory/Makefile
diff --git a/tests/run-make-fulldeps/output-filename-conflicts-with-directory/foo.rs b/tests/run-make/output-filename-conflicts-with-directory/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/output-filename-conflicts-with-directory/foo.rs
+++ b/tests/run-make/output-filename-conflicts-with-directory/foo.rs
diff --git a/tests/run-make-fulldeps/output-filename-overwrites-input/Makefile b/tests/run-make/output-filename-overwrites-input/Makefile
index 33069c06f..605b86b25 100644
--- a/tests/run-make-fulldeps/output-filename-overwrites-input/Makefile
+++ b/tests/run-make/output-filename-overwrites-input/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/output-filename-overwrites-input/bar.rs b/tests/run-make/output-filename-overwrites-input/bar.rs
index 83be6e807..83be6e807 100644
--- a/tests/run-make-fulldeps/output-filename-overwrites-input/bar.rs
+++ b/tests/run-make/output-filename-overwrites-input/bar.rs
diff --git a/tests/run-make-fulldeps/output-filename-overwrites-input/foo.rs b/tests/run-make/output-filename-overwrites-input/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/output-filename-overwrites-input/foo.rs
+++ b/tests/run-make/output-filename-overwrites-input/foo.rs
diff --git a/tests/run-make-fulldeps/output-type-permutations/Makefile b/tests/run-make/output-type-permutations/Makefile
index 791606c64..035033b9f 100644
--- a/tests/run-make-fulldeps/output-type-permutations/Makefile
+++ b/tests/run-make/output-type-permutations/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/output-type-permutations/foo.rs b/tests/run-make/output-type-permutations/foo.rs
index f0a2cc6ad..f0a2cc6ad 100644
--- a/tests/run-make-fulldeps/output-type-permutations/foo.rs
+++ b/tests/run-make/output-type-permutations/foo.rs
diff --git a/tests/run-make-fulldeps/output-with-hyphens/Makefile b/tests/run-make/output-with-hyphens/Makefile
index 365fb6e59..846c9a66a 100644
--- a/tests/run-make-fulldeps/output-with-hyphens/Makefile
+++ b/tests/run-make/output-with-hyphens/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/output-with-hyphens/foo-bar.rs b/tests/run-make/output-with-hyphens/foo-bar.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/output-with-hyphens/foo-bar.rs
+++ b/tests/run-make/output-with-hyphens/foo-bar.rs
diff --git a/tests/run-make-fulldeps/override-aliased-flags/Makefile b/tests/run-make/override-aliased-flags/Makefile
index 186b8c7c8..db1ff1ff9 100644
--- a/tests/run-make-fulldeps/override-aliased-flags/Makefile
+++ b/tests/run-make/override-aliased-flags/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# FIXME: it would be good to check that it's actually the rightmost flags
diff --git a/tests/run-make-fulldeps/override-aliased-flags/main.rs b/tests/run-make/override-aliased-flags/main.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/override-aliased-flags/main.rs
+++ b/tests/run-make/override-aliased-flags/main.rs
diff --git a/tests/run-make/overwrite-input/Makefile b/tests/run-make/overwrite-input/Makefile
index 03b03eb14..c62b5aab1 100644
--- a/tests/run-make/overwrite-input/Makefile
+++ b/tests/run-make/overwrite-input/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) main.rs -o main.rs 2> $(TMPDIR)/file.stderr || echo "failed successfully"
diff --git a/tests/run-make-fulldeps/panic-impl-transitive/Makefile b/tests/run-make/panic-impl-transitive/Makefile
index c3192efcb..9a271a22e 100644
--- a/tests/run-make-fulldeps/panic-impl-transitive/Makefile
+++ b/tests/run-make/panic-impl-transitive/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# NOTE we use --emit=llvm-ir to avoid running the linker (linking will fail because there's no main
# in this crate)
diff --git a/tests/run-make-fulldeps/panic-impl-transitive/panic-impl-consumer.rs b/tests/run-make/panic-impl-transitive/panic-impl-consumer.rs
index 82a98b12d..82a98b12d 100644
--- a/tests/run-make-fulldeps/panic-impl-transitive/panic-impl-consumer.rs
+++ b/tests/run-make/panic-impl-transitive/panic-impl-consumer.rs
diff --git a/tests/run-make-fulldeps/panic-impl-transitive/panic-impl-provider.rs b/tests/run-make/panic-impl-transitive/panic-impl-provider.rs
index f1b9873c8..f1b9873c8 100644
--- a/tests/run-make-fulldeps/panic-impl-transitive/panic-impl-provider.rs
+++ b/tests/run-make/panic-impl-transitive/panic-impl-provider.rs
diff --git a/tests/run-make/pass-linker-flags-from-dep/Makefile b/tests/run-make/pass-linker-flags-from-dep/Makefile
index b9426326a..b57389bb7 100644
--- a/tests/run-make/pass-linker-flags-from-dep/Makefile
+++ b/tests/run-make/pass-linker-flags-from-dep/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
# Build deps
diff --git a/tests/run-make/pass-linker-flags/Makefile b/tests/run-make/pass-linker-flags/Makefile
index a3efb8df6..6ddbcbb1b 100644
--- a/tests/run-make/pass-linker-flags/Makefile
+++ b/tests/run-make/pass-linker-flags/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) rs.rs -Z unstable-options -l static=l1 -l link-arg=a1 -l static=l2 -l link-arg=a2 -l dylib=d1 -l link-arg=a3 --print link-args | $(CGREP) -e 'l1.*a1.*l2.*a2.*d1.*a3'
diff --git a/tests/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile b/tests/run-make/pass-non-c-like-enum-to-c/Makefile
index 42d3c977f..bd441d321 100644
--- a/tests/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile
+++ b/tests/run-make/pass-non-c-like-enum-to-c/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
diff --git a/tests/run-make-fulldeps/pass-non-c-like-enum-to-c/nonclike.rs b/tests/run-make/pass-non-c-like-enum-to-c/nonclike.rs
index 517286a86..517286a86 100644
--- a/tests/run-make-fulldeps/pass-non-c-like-enum-to-c/nonclike.rs
+++ b/tests/run-make/pass-non-c-like-enum-to-c/nonclike.rs
diff --git a/tests/run-make-fulldeps/pass-non-c-like-enum-to-c/test.c b/tests/run-make/pass-non-c-like-enum-to-c/test.c
index 99511b253..99511b253 100644
--- a/tests/run-make-fulldeps/pass-non-c-like-enum-to-c/test.c
+++ b/tests/run-make/pass-non-c-like-enum-to-c/test.c
diff --git a/tests/run-make-fulldeps/pgo-branch-weights/Makefile b/tests/run-make/pgo-branch-weights/Makefile
index c60206a1f..c60206a1f 100644
--- a/tests/run-make-fulldeps/pgo-branch-weights/Makefile
+++ b/tests/run-make/pgo-branch-weights/Makefile
diff --git a/tests/run-make-fulldeps/pgo-branch-weights/filecheck-patterns.txt b/tests/run-make/pgo-branch-weights/filecheck-patterns.txt
index 70d5a645c..70d5a645c 100644
--- a/tests/run-make-fulldeps/pgo-branch-weights/filecheck-patterns.txt
+++ b/tests/run-make/pgo-branch-weights/filecheck-patterns.txt
diff --git a/tests/run-make-fulldeps/pgo-branch-weights/interesting.rs b/tests/run-make/pgo-branch-weights/interesting.rs
index a26d6fd69..a26d6fd69 100644
--- a/tests/run-make-fulldeps/pgo-branch-weights/interesting.rs
+++ b/tests/run-make/pgo-branch-weights/interesting.rs
diff --git a/tests/run-make-fulldeps/pgo-branch-weights/main.rs b/tests/run-make/pgo-branch-weights/main.rs
index 619cf9c69..619cf9c69 100644
--- a/tests/run-make-fulldeps/pgo-branch-weights/main.rs
+++ b/tests/run-make/pgo-branch-weights/main.rs
diff --git a/tests/run-make-fulldeps/pgo-branch-weights/opaque.rs b/tests/run-make/pgo-branch-weights/opaque.rs
index 72f93c9fe..72f93c9fe 100644
--- a/tests/run-make-fulldeps/pgo-branch-weights/opaque.rs
+++ b/tests/run-make/pgo-branch-weights/opaque.rs
diff --git a/tests/run-make-fulldeps/pgo-gen-lto/Makefile b/tests/run-make/pgo-gen-lto/Makefile
index 3f2f6a838..3f2f6a838 100644
--- a/tests/run-make-fulldeps/pgo-gen-lto/Makefile
+++ b/tests/run-make/pgo-gen-lto/Makefile
diff --git a/tests/run-make-fulldeps/pgo-gen-lto/test.rs b/tests/run-make/pgo-gen-lto/test.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/pgo-gen-lto/test.rs
+++ b/tests/run-make/pgo-gen-lto/test.rs
diff --git a/tests/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile b/tests/run-make/pgo-gen-no-imp-symbols/Makefile
index 7f72b11b6..7f72b11b6 100644
--- a/tests/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
+++ b/tests/run-make/pgo-gen-no-imp-symbols/Makefile
diff --git a/tests/run-make-fulldeps/pgo-gen-no-imp-symbols/test.rs b/tests/run-make/pgo-gen-no-imp-symbols/test.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/pgo-gen-no-imp-symbols/test.rs
+++ b/tests/run-make/pgo-gen-no-imp-symbols/test.rs
diff --git a/tests/run-make-fulldeps/pgo-gen/Makefile b/tests/run-make/pgo-gen/Makefile
index 4623a7495..4623a7495 100644
--- a/tests/run-make-fulldeps/pgo-gen/Makefile
+++ b/tests/run-make/pgo-gen/Makefile
diff --git a/tests/run-make-fulldeps/pgo-gen/test.rs b/tests/run-make/pgo-gen/test.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/pgo-gen/test.rs
+++ b/tests/run-make/pgo-gen/test.rs
diff --git a/tests/run-make-fulldeps/pgo-indirect-call-promotion/Makefile b/tests/run-make/pgo-indirect-call-promotion/Makefile
index 45302215c..45302215c 100644
--- a/tests/run-make-fulldeps/pgo-indirect-call-promotion/Makefile
+++ b/tests/run-make/pgo-indirect-call-promotion/Makefile
diff --git a/tests/run-make-fulldeps/pgo-indirect-call-promotion/filecheck-patterns.txt b/tests/run-make/pgo-indirect-call-promotion/filecheck-patterns.txt
index e19c78350..e19c78350 100644
--- a/tests/run-make-fulldeps/pgo-indirect-call-promotion/filecheck-patterns.txt
+++ b/tests/run-make/pgo-indirect-call-promotion/filecheck-patterns.txt
diff --git a/tests/run-make-fulldeps/pgo-indirect-call-promotion/interesting.rs b/tests/run-make/pgo-indirect-call-promotion/interesting.rs
index 4fd096d62..4fd096d62 100644
--- a/tests/run-make-fulldeps/pgo-indirect-call-promotion/interesting.rs
+++ b/tests/run-make/pgo-indirect-call-promotion/interesting.rs
diff --git a/tests/run-make-fulldeps/pgo-indirect-call-promotion/main.rs b/tests/run-make/pgo-indirect-call-promotion/main.rs
index 27181f307..27181f307 100644
--- a/tests/run-make-fulldeps/pgo-indirect-call-promotion/main.rs
+++ b/tests/run-make/pgo-indirect-call-promotion/main.rs
diff --git a/tests/run-make-fulldeps/pgo-indirect-call-promotion/opaque.rs b/tests/run-make/pgo-indirect-call-promotion/opaque.rs
index 9628d711c..9628d711c 100644
--- a/tests/run-make-fulldeps/pgo-indirect-call-promotion/opaque.rs
+++ b/tests/run-make/pgo-indirect-call-promotion/opaque.rs
diff --git a/tests/run-make-fulldeps/pgo-use/Makefile b/tests/run-make/pgo-use/Makefile
index 3bac9b77a..3bac9b77a 100644
--- a/tests/run-make-fulldeps/pgo-use/Makefile
+++ b/tests/run-make/pgo-use/Makefile
diff --git a/tests/run-make-fulldeps/pgo-use/filecheck-patterns.txt b/tests/run-make/pgo-use/filecheck-patterns.txt
index 6da34f88f..6da34f88f 100644
--- a/tests/run-make-fulldeps/pgo-use/filecheck-patterns.txt
+++ b/tests/run-make/pgo-use/filecheck-patterns.txt
diff --git a/tests/run-make-fulldeps/pgo-use/main.rs b/tests/run-make/pgo-use/main.rs
index eb9192c87..eb9192c87 100644
--- a/tests/run-make-fulldeps/pgo-use/main.rs
+++ b/tests/run-make/pgo-use/main.rs
diff --git a/tests/run-make-fulldeps/pointer-auth-link-with-c/Makefile b/tests/run-make/pointer-auth-link-with-c/Makefile
index 7acea0380..7acea0380 100644
--- a/tests/run-make-fulldeps/pointer-auth-link-with-c/Makefile
+++ b/tests/run-make/pointer-auth-link-with-c/Makefile
diff --git a/tests/run-make-fulldeps/pointer-auth-link-with-c/test.c b/tests/run-make/pointer-auth-link-with-c/test.c
index 9fe07f82f..9fe07f82f 100644
--- a/tests/run-make-fulldeps/pointer-auth-link-with-c/test.c
+++ b/tests/run-make/pointer-auth-link-with-c/test.c
diff --git a/tests/run-make-fulldeps/pointer-auth-link-with-c/test.rs b/tests/run-make/pointer-auth-link-with-c/test.rs
index 615ad0aeb..615ad0aeb 100644
--- a/tests/run-make-fulldeps/pointer-auth-link-with-c/test.rs
+++ b/tests/run-make/pointer-auth-link-with-c/test.rs
diff --git a/tests/run-make-fulldeps/prefer-dylib/Makefile b/tests/run-make/prefer-dylib/Makefile
index 3817ca195..cc26e70ae 100644
--- a/tests/run-make-fulldeps/prefer-dylib/Makefile
+++ b/tests/run-make/prefer-dylib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/prefer-dylib/bar.rs b/tests/run-make/prefer-dylib/bar.rs
index c5c0bc606..c5c0bc606 100644
--- a/tests/run-make-fulldeps/prefer-dylib/bar.rs
+++ b/tests/run-make/prefer-dylib/bar.rs
diff --git a/tests/run-make-fulldeps/prefer-dylib/foo.rs b/tests/run-make/prefer-dylib/foo.rs
index 8d68535e3..8d68535e3 100644
--- a/tests/run-make-fulldeps/prefer-dylib/foo.rs
+++ b/tests/run-make/prefer-dylib/foo.rs
diff --git a/tests/run-make-fulldeps/prefer-rlib/Makefile b/tests/run-make/prefer-rlib/Makefile
index adc345d76..2e86b9c1d 100644
--- a/tests/run-make-fulldeps/prefer-rlib/Makefile
+++ b/tests/run-make/prefer-rlib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/prefer-rlib/bar.rs b/tests/run-make/prefer-rlib/bar.rs
index c5c0bc606..c5c0bc606 100644
--- a/tests/run-make-fulldeps/prefer-rlib/bar.rs
+++ b/tests/run-make/prefer-rlib/bar.rs
diff --git a/tests/run-make-fulldeps/prefer-rlib/foo.rs b/tests/run-make/prefer-rlib/foo.rs
index 8d68535e3..8d68535e3 100644
--- a/tests/run-make-fulldeps/prefer-rlib/foo.rs
+++ b/tests/run-make/prefer-rlib/foo.rs
diff --git a/tests/run-make-fulldeps/pretty-print-to-file/Makefile b/tests/run-make/pretty-print-to-file/Makefile
index ca11b8c47..ca11b8c47 100644
--- a/tests/run-make-fulldeps/pretty-print-to-file/Makefile
+++ b/tests/run-make/pretty-print-to-file/Makefile
diff --git a/tests/run-make-fulldeps/pretty-print-to-file/input.pp b/tests/run-make/pretty-print-to-file/input.pp
index e3f03242a..e3f03242a 100644
--- a/tests/run-make-fulldeps/pretty-print-to-file/input.pp
+++ b/tests/run-make/pretty-print-to-file/input.pp
diff --git a/tests/run-make-fulldeps/pretty-print-to-file/input.rs b/tests/run-make/pretty-print-to-file/input.rs
index aa828155b..aa828155b 100644
--- a/tests/run-make-fulldeps/pretty-print-to-file/input.rs
+++ b/tests/run-make/pretty-print-to-file/input.rs
diff --git a/tests/run-make-fulldeps/print-calling-conventions/Makefile b/tests/run-make/print-calling-conventions/Makefile
index d3fd06392..27b87e610 100644
--- a/tests/run-make-fulldeps/print-calling-conventions/Makefile
+++ b/tests/run-make/print-calling-conventions/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --print calling-conventions
diff --git a/tests/run-make-fulldeps/print-cfg/Makefile b/tests/run-make/print-cfg/Makefile
index 126f5768c..126f5768c 100644
--- a/tests/run-make-fulldeps/print-cfg/Makefile
+++ b/tests/run-make/print-cfg/Makefile
diff --git a/tests/run-make-fulldeps/print-target-list/Makefile b/tests/run-make/print-target-list/Makefile
index f23c40d42..f23c40d42 100644
--- a/tests/run-make-fulldeps/print-target-list/Makefile
+++ b/tests/run-make/print-target-list/Makefile
diff --git a/tests/run-make-fulldeps/profile/Makefile b/tests/run-make/profile/Makefile
index fffc051ad..fffc051ad 100644
--- a/tests/run-make-fulldeps/profile/Makefile
+++ b/tests/run-make/profile/Makefile
diff --git a/tests/run-make-fulldeps/profile/test.rs b/tests/run-make/profile/test.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/profile/test.rs
+++ b/tests/run-make/profile/test.rs
diff --git a/tests/run-make-fulldeps/prune-link-args/Makefile b/tests/run-make/prune-link-args/Makefile
index a359dc5ae..c21ba6ace 100644
--- a/tests/run-make-fulldeps/prune-link-args/Makefile
+++ b/tests/run-make/prune-link-args/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows
diff --git a/tests/run-make-fulldeps/prune-link-args/empty.rs b/tests/run-make/prune-link-args/empty.rs
index 45590d86b..45590d86b 100644
--- a/tests/run-make-fulldeps/prune-link-args/empty.rs
+++ b/tests/run-make/prune-link-args/empty.rs
diff --git a/tests/run-make/raw-dylib-alt-calling-convention/Makefile b/tests/run-make/raw-dylib-alt-calling-convention/Makefile
index 03f8778d2..1744c431f 100644
--- a/tests/run-make/raw-dylib-alt-calling-convention/Makefile
+++ b/tests/run-make/raw-dylib-alt-calling-convention/Makefile
@@ -3,7 +3,7 @@
# only-x86
# only-windows
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type lib --crate-name raw_dylib_alt_calling_convention_test lib.rs
diff --git a/tests/run-make/raw-dylib-c/Makefile b/tests/run-make/raw-dylib-c/Makefile
index f47ab24f4..06e7935c0 100644
--- a/tests/run-make/raw-dylib-c/Makefile
+++ b/tests/run-make/raw-dylib-c/Makefile
@@ -2,7 +2,7 @@
# only-windows
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
diff --git a/tests/run-make/raw-dylib-cross-compilation/Makefile b/tests/run-make/raw-dylib-cross-compilation/Makefile
new file mode 100644
index 000000000..a8f97edd6
--- /dev/null
+++ b/tests/run-make/raw-dylib-cross-compilation/Makefile
@@ -0,0 +1,22 @@
+# Tests that raw-dylib cross compilation works correctly
+
+# only-gnu
+# needs-i686-dlltool
+# needs-x86_64-dlltool
+
+# i686 dlltool.exe can't product x64 binaries.
+# ignore-i686-pc-windows-gnu
+
+include ../tools.mk
+
+all:
+ # Build as x86 and make sure that we have x86 objects only.
+ $(RUSTC) --crate-type lib --crate-name i686_raw_dylib_test --target i686-pc-windows-gnu lib.rs
+ "$(LLVM_BIN_DIR)"/llvm-objdump -a $(TMPDIR)/libi686_raw_dylib_test.rlib > $(TMPDIR)/i686.objdump.txt
+ $(CGREP) "file format coff-i386" < $(TMPDIR)/i686.objdump.txt
+ $(CGREP) -v "file format coff-x86-64" < $(TMPDIR)/i686.objdump.txt
+ # Build as x64 and make sure that we have x64 objects only.
+ $(RUSTC) --crate-type lib --crate-name x64_raw_dylib_test --target x86_64-pc-windows-gnu lib.rs
+ "$(LLVM_BIN_DIR)"/llvm-objdump -a $(TMPDIR)/libx64_raw_dylib_test.rlib > $(TMPDIR)/x64.objdump.txt
+ $(CGREP) "file format coff-x86-64" < $(TMPDIR)/x64.objdump.txt
+ $(CGREP) -v "file format coff-i386" < $(TMPDIR)/x64.objdump.txt
diff --git a/tests/run-make/raw-dylib-cross-compilation/lib.rs b/tests/run-make/raw-dylib-cross-compilation/lib.rs
new file mode 100644
index 000000000..51bf2ec6b
--- /dev/null
+++ b/tests/run-make/raw-dylib-cross-compilation/lib.rs
@@ -0,0 +1,20 @@
+#![feature(raw_dylib)]
+#![feature(no_core, lang_items)]
+#![no_std]
+#![no_core]
+#![crate_type = "lib"]
+
+// This is needed because of #![no_core]:
+#[lang = "sized"]
+trait Sized {}
+
+#[link(name = "extern_1", kind = "raw-dylib")]
+extern {
+ fn extern_fn();
+}
+
+pub fn extern_fn_caller() {
+ unsafe {
+ extern_fn();
+ }
+}
diff --git a/tests/run-make/raw-dylib-import-name-type/Makefile b/tests/run-make/raw-dylib-import-name-type/Makefile
index fcc60e88e..671523298 100644
--- a/tests/run-make/raw-dylib-import-name-type/Makefile
+++ b/tests/run-make/raw-dylib-import-name-type/Makefile
@@ -3,7 +3,7 @@
# only-x86
# only-windows
--include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
diff --git a/tests/run-make/raw-dylib-inline-cross-dylib/Makefile b/tests/run-make/raw-dylib-inline-cross-dylib/Makefile
index 722a49b02..6d1d04bfd 100644
--- a/tests/run-make/raw-dylib-inline-cross-dylib/Makefile
+++ b/tests/run-make/raw-dylib-inline-cross-dylib/Makefile
@@ -2,7 +2,7 @@
# only-windows
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# We'd be using the llvm-objdump instead of the system objdump to ensure compatibility
# with the LLVM bitcode generated by rustc but on Windows piping/IO redirection under MSYS2 is wonky with llvm-objdump.
diff --git a/tests/run-make/raw-dylib-link-ordinal/Makefile b/tests/run-make/raw-dylib-link-ordinal/Makefile
index b55a94dbc..374a0b59d 100644
--- a/tests/run-make/raw-dylib-link-ordinal/Makefile
+++ b/tests/run-make/raw-dylib-link-ordinal/Makefile
@@ -2,7 +2,7 @@
# only-windows
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
diff --git a/tests/run-make/raw-dylib-stdcall-ordinal/Makefile b/tests/run-make/raw-dylib-stdcall-ordinal/Makefile
index b9deb7729..178c15ab3 100644
--- a/tests/run-make/raw-dylib-stdcall-ordinal/Makefile
+++ b/tests/run-make/raw-dylib-stdcall-ordinal/Makefile
@@ -3,7 +3,7 @@
# only-x86
# only-windows
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
diff --git a/tests/run-make-fulldeps/redundant-libs/Makefile b/tests/run-make/redundant-libs/Makefile
index b2dff05d1..0a48b2b28 100644
--- a/tests/run-make-fulldeps/redundant-libs/Makefile
+++ b/tests/run-make/redundant-libs/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows-msvc
diff --git a/tests/run-make-fulldeps/redundant-libs/bar.c b/tests/run-make/redundant-libs/bar.c
index e42599986..e42599986 100644
--- a/tests/run-make-fulldeps/redundant-libs/bar.c
+++ b/tests/run-make/redundant-libs/bar.c
diff --git a/tests/run-make-fulldeps/redundant-libs/baz.c b/tests/run-make/redundant-libs/baz.c
index a4e2c2b71..a4e2c2b71 100644
--- a/tests/run-make-fulldeps/redundant-libs/baz.c
+++ b/tests/run-make/redundant-libs/baz.c
diff --git a/tests/run-make-fulldeps/redundant-libs/foo.c b/tests/run-make/redundant-libs/foo.c
index 339ee86c9..339ee86c9 100644
--- a/tests/run-make-fulldeps/redundant-libs/foo.c
+++ b/tests/run-make/redundant-libs/foo.c
diff --git a/tests/run-make-fulldeps/redundant-libs/main.rs b/tests/run-make/redundant-libs/main.rs
index 90d185ff5..90d185ff5 100644
--- a/tests/run-make-fulldeps/redundant-libs/main.rs
+++ b/tests/run-make/redundant-libs/main.rs
diff --git a/tests/run-make-fulldeps/relocation-model/Makefile b/tests/run-make/relocation-model/Makefile
index a31dbfd91..8cc5205ed 100644
--- a/tests/run-make-fulldeps/relocation-model/Makefile
+++ b/tests/run-make/relocation-model/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: others
diff --git a/tests/run-make-fulldeps/relocation-model/foo.rs b/tests/run-make/relocation-model/foo.rs
index da0f5d925..da0f5d925 100644
--- a/tests/run-make-fulldeps/relocation-model/foo.rs
+++ b/tests/run-make/relocation-model/foo.rs
diff --git a/tests/run-make-fulldeps/relro-levels/Makefile b/tests/run-make/relro-levels/Makefile
index 6176fc1a5..e0402f59f 100644
--- a/tests/run-make-fulldeps/relro-levels/Makefile
+++ b/tests/run-make/relro-levels/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# only-linux
diff --git a/tests/run-make-fulldeps/relro-levels/hello.rs b/tests/run-make/relro-levels/hello.rs
index e7a11a969..e7a11a969 100644
--- a/tests/run-make-fulldeps/relro-levels/hello.rs
+++ b/tests/run-make/relro-levels/hello.rs
diff --git a/tests/run-make/remap-path-prefix-dwarf/Makefile b/tests/run-make/remap-path-prefix-dwarf/Makefile
index fbaea7b68..c9ede1b60 100644
--- a/tests/run-make/remap-path-prefix-dwarf/Makefile
+++ b/tests/run-make/remap-path-prefix-dwarf/Makefile
@@ -6,7 +6,7 @@
SRC_DIR := $(abspath .)
SRC_DIR_PARENT := $(abspath ..)
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all: \
abs_input_outside_working_dir \
diff --git a/tests/run-make-fulldeps/remap-path-prefix/Makefile b/tests/run-make/remap-path-prefix/Makefile
index 2a7378fdf..2a7378fdf 100644
--- a/tests/run-make-fulldeps/remap-path-prefix/Makefile
+++ b/tests/run-make/remap-path-prefix/Makefile
diff --git a/tests/run-make-fulldeps/remap-path-prefix/auxiliary/lib.rs b/tests/run-make/remap-path-prefix/auxiliary/lib.rs
index 019c786a9..019c786a9 100644
--- a/tests/run-make-fulldeps/remap-path-prefix/auxiliary/lib.rs
+++ b/tests/run-make/remap-path-prefix/auxiliary/lib.rs
diff --git a/tests/run-make/repr128-dwarf/Makefile b/tests/run-make/repr128-dwarf/Makefile
index 2b03c22c0..3f9330427 100644
--- a/tests/run-make/repr128-dwarf/Makefile
+++ b/tests/run-make/repr128-dwarf/Makefile
@@ -2,7 +2,7 @@
# This test should be replaced with one in tests/debuginfo once GDB or LLDB support 128-bit
# enums.
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) -Cdebuginfo=2 lib.rs -o $(TMPDIR)/repr128.rlib
diff --git a/tests/run-make-fulldeps/reproducible-build-2/Makefile b/tests/run-make/reproducible-build-2/Makefile
index 1df5e102c..68fcac8b4 100644
--- a/tests/run-make-fulldeps/reproducible-build-2/Makefile
+++ b/tests/run-make/reproducible-build-2/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-musl
diff --git a/tests/run-make-fulldeps/reproducible-build-2/linker.rs b/tests/run-make/reproducible-build-2/linker.rs
index 998d1f328..998d1f328 100644
--- a/tests/run-make-fulldeps/reproducible-build-2/linker.rs
+++ b/tests/run-make/reproducible-build-2/linker.rs
diff --git a/tests/run-make-fulldeps/reproducible-build-2/reproducible-build-aux.rs b/tests/run-make/reproducible-build-2/reproducible-build-aux.rs
index 8105b3d2b..8105b3d2b 100644
--- a/tests/run-make-fulldeps/reproducible-build-2/reproducible-build-aux.rs
+++ b/tests/run-make/reproducible-build-2/reproducible-build-aux.rs
diff --git a/tests/run-make-fulldeps/reproducible-build-2/reproducible-build.rs b/tests/run-make/reproducible-build-2/reproducible-build.rs
index a6c04774c..a6c04774c 100644
--- a/tests/run-make-fulldeps/reproducible-build-2/reproducible-build.rs
+++ b/tests/run-make/reproducible-build-2/reproducible-build.rs
diff --git a/tests/run-make-fulldeps/reproducible-build/Makefile b/tests/run-make/reproducible-build/Makefile
index 642a48081..f5d17a234 100644
--- a/tests/run-make-fulldeps/reproducible-build/Makefile
+++ b/tests/run-make/reproducible-build/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-musl
diff --git a/tests/run-make-fulldeps/reproducible-build/linker.rs b/tests/run-make/reproducible-build/linker.rs
index 3dda6f190..3dda6f190 100644
--- a/tests/run-make-fulldeps/reproducible-build/linker.rs
+++ b/tests/run-make/reproducible-build/linker.rs
diff --git a/tests/run-make-fulldeps/reproducible-build/reproducible-build-aux.rs b/tests/run-make/reproducible-build/reproducible-build-aux.rs
index 8105b3d2b..8105b3d2b 100644
--- a/tests/run-make-fulldeps/reproducible-build/reproducible-build-aux.rs
+++ b/tests/run-make/reproducible-build/reproducible-build-aux.rs
diff --git a/tests/run-make-fulldeps/reproducible-build/reproducible-build.rs b/tests/run-make/reproducible-build/reproducible-build.rs
index a6c04774c..a6c04774c 100644
--- a/tests/run-make-fulldeps/reproducible-build/reproducible-build.rs
+++ b/tests/run-make/reproducible-build/reproducible-build.rs
diff --git a/tests/run-make-fulldeps/resolve-rename/Makefile b/tests/run-make/resolve-rename/Makefile
index 00f83a5d6..00f83a5d6 100644
--- a/tests/run-make-fulldeps/resolve-rename/Makefile
+++ b/tests/run-make/resolve-rename/Makefile
diff --git a/tests/run-make-fulldeps/resolve-rename/bar.rs b/tests/run-make/resolve-rename/bar.rs
index 4a09ce355..4a09ce355 100644
--- a/tests/run-make-fulldeps/resolve-rename/bar.rs
+++ b/tests/run-make/resolve-rename/bar.rs
diff --git a/tests/run-make-fulldeps/resolve-rename/baz.rs b/tests/run-make/resolve-rename/baz.rs
index 9176073ef..9176073ef 100644
--- a/tests/run-make-fulldeps/resolve-rename/baz.rs
+++ b/tests/run-make/resolve-rename/baz.rs
diff --git a/tests/run-make-fulldeps/resolve-rename/foo.rs b/tests/run-make/resolve-rename/foo.rs
index bd6820098..bd6820098 100644
--- a/tests/run-make-fulldeps/resolve-rename/foo.rs
+++ b/tests/run-make/resolve-rename/foo.rs
diff --git a/tests/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile b/tests/run-make/return-non-c-like-enum-from-c/Makefile
index 42d3c977f..bd441d321 100644
--- a/tests/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile
+++ b/tests/run-make/return-non-c-like-enum-from-c/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
diff --git a/tests/run-make-fulldeps/return-non-c-like-enum-from-c/nonclike.rs b/tests/run-make/return-non-c-like-enum-from-c/nonclike.rs
index ea22a2a56..ea22a2a56 100644
--- a/tests/run-make-fulldeps/return-non-c-like-enum-from-c/nonclike.rs
+++ b/tests/run-make/return-non-c-like-enum-from-c/nonclike.rs
diff --git a/tests/run-make-fulldeps/return-non-c-like-enum-from-c/test.c b/tests/run-make/return-non-c-like-enum-from-c/test.c
index 3ad135bab..3ad135bab 100644
--- a/tests/run-make-fulldeps/return-non-c-like-enum-from-c/test.c
+++ b/tests/run-make/return-non-c-like-enum-from-c/test.c
diff --git a/tests/run-make-fulldeps/arguments-non-c-like-enum/Makefile b/tests/run-make/return-non-c-like-enum/Makefile
index 513311c82..0c8d8bf3a 100644
--- a/tests/run-make-fulldeps/arguments-non-c-like-enum/Makefile
+++ b/tests/run-make/return-non-c-like-enum/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/return-non-c-like-enum/nonclike.rs b/tests/run-make/return-non-c-like-enum/nonclike.rs
index de529cf64..de529cf64 100644
--- a/tests/run-make-fulldeps/return-non-c-like-enum/nonclike.rs
+++ b/tests/run-make/return-non-c-like-enum/nonclike.rs
diff --git a/tests/run-make-fulldeps/return-non-c-like-enum/test.c b/tests/run-make/return-non-c-like-enum/test.c
index afadd3c10..afadd3c10 100644
--- a/tests/run-make-fulldeps/return-non-c-like-enum/test.c
+++ b/tests/run-make/return-non-c-like-enum/test.c
diff --git a/tests/run-make-fulldeps/rlib-chain/Makefile b/tests/run-make/rlib-chain/Makefile
index 236943a2a..7a1f887fa 100644
--- a/tests/run-make-fulldeps/rlib-chain/Makefile
+++ b/tests/run-make/rlib-chain/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/rlib-chain/m1.rs b/tests/run-make/rlib-chain/m1.rs
index 665b206cc..665b206cc 100644
--- a/tests/run-make-fulldeps/rlib-chain/m1.rs
+++ b/tests/run-make/rlib-chain/m1.rs
diff --git a/tests/run-make-fulldeps/rlib-chain/m2.rs b/tests/run-make/rlib-chain/m2.rs
index eba12fe12..eba12fe12 100644
--- a/tests/run-make-fulldeps/rlib-chain/m2.rs
+++ b/tests/run-make/rlib-chain/m2.rs
diff --git a/tests/run-make-fulldeps/rlib-chain/m3.rs b/tests/run-make/rlib-chain/m3.rs
index ade191db4..ade191db4 100644
--- a/tests/run-make-fulldeps/rlib-chain/m3.rs
+++ b/tests/run-make/rlib-chain/m3.rs
diff --git a/tests/run-make-fulldeps/rlib-chain/m4.rs b/tests/run-make/rlib-chain/m4.rs
index fa8ec6079..fa8ec6079 100644
--- a/tests/run-make-fulldeps/rlib-chain/m4.rs
+++ b/tests/run-make/rlib-chain/m4.rs
diff --git a/tests/run-make/rlib-format-packed-bundled-libs-2/Makefile b/tests/run-make/rlib-format-packed-bundled-libs-2/Makefile
index 37b8d809a..d2a740b06 100644
--- a/tests/run-make/rlib-format-packed-bundled-libs-2/Makefile
+++ b/tests/run-make/rlib-format-packed-bundled-libs-2/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-cross-compile
diff --git a/tests/run-make/rlib-format-packed-bundled-libs-3/Makefile b/tests/run-make/rlib-format-packed-bundled-libs-3/Makefile
index 62dc1b5f6..1f2812cb0 100644
--- a/tests/run-make/rlib-format-packed-bundled-libs-3/Makefile
+++ b/tests/run-make/rlib-format-packed-bundled-libs-3/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-cross-compile
# only-linux
diff --git a/tests/run-make/rlib-format-packed-bundled-libs/Makefile b/tests/run-make/rlib-format-packed-bundled-libs/Makefile
index 7fb6ce8d1..f454da678 100644
--- a/tests/run-make/rlib-format-packed-bundled-libs/Makefile
+++ b/tests/run-make/rlib-format-packed-bundled-libs/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-cross-compile
diff --git a/tests/run-make/rustc-macro-dep-files/Makefile b/tests/run-make/rustc-macro-dep-files/Makefile
index 6ae659db2..76d713c4b 100644
--- a/tests/run-make/rustc-macro-dep-files/Makefile
+++ b/tests/run-make/rustc-macro-dep-files/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
# instead of hardcoding them everywhere they're needed.
diff --git a/tests/run-make-fulldeps/rustdoc-determinism/Makefile b/tests/run-make/rustdoc-determinism/Makefile
index a3ef16906..a3ef16906 100644
--- a/tests/run-make-fulldeps/rustdoc-determinism/Makefile
+++ b/tests/run-make/rustdoc-determinism/Makefile
diff --git a/tests/run-make-fulldeps/rustdoc-determinism/bar.rs b/tests/run-make/rustdoc-determinism/bar.rs
index ca05a6a90..ca05a6a90 100644
--- a/tests/run-make-fulldeps/rustdoc-determinism/bar.rs
+++ b/tests/run-make/rustdoc-determinism/bar.rs
diff --git a/tests/run-make-fulldeps/rustdoc-determinism/foo.rs b/tests/run-make/rustdoc-determinism/foo.rs
index 4a835673a..4a835673a 100644
--- a/tests/run-make-fulldeps/rustdoc-determinism/foo.rs
+++ b/tests/run-make/rustdoc-determinism/foo.rs
diff --git a/tests/run-make-fulldeps/rustdoc-error-lines/Makefile b/tests/run-make/rustdoc-error-lines/Makefile
index 2dc30f56b..2dc30f56b 100644
--- a/tests/run-make-fulldeps/rustdoc-error-lines/Makefile
+++ b/tests/run-make/rustdoc-error-lines/Makefile
diff --git a/tests/run-make-fulldeps/rustdoc-error-lines/input.rs b/tests/run-make/rustdoc-error-lines/input.rs
index b4db182e8..b4db182e8 100644
--- a/tests/run-make-fulldeps/rustdoc-error-lines/input.rs
+++ b/tests/run-make/rustdoc-error-lines/input.rs
diff --git a/tests/run-make-fulldeps/rustdoc-io-error/Makefile b/tests/run-make/rustdoc-io-error/Makefile
index 27f5ecf94..27f5ecf94 100644
--- a/tests/run-make-fulldeps/rustdoc-io-error/Makefile
+++ b/tests/run-make/rustdoc-io-error/Makefile
diff --git a/tests/run-make-fulldeps/rustdoc-io-error/foo.rs b/tests/run-make/rustdoc-io-error/foo.rs
index 4a835673a..4a835673a 100644
--- a/tests/run-make-fulldeps/rustdoc-io-error/foo.rs
+++ b/tests/run-make/rustdoc-io-error/foo.rs
diff --git a/tests/run-make-fulldeps/rustdoc-map-file/Makefile b/tests/run-make/rustdoc-map-file/Makefile
index 5cbf7747a..5cbf7747a 100644
--- a/tests/run-make-fulldeps/rustdoc-map-file/Makefile
+++ b/tests/run-make/rustdoc-map-file/Makefile
diff --git a/tests/run-make-fulldeps/rustdoc-map-file/expected.json b/tests/run-make/rustdoc-map-file/expected.json
index 6b1ccbeac..6b1ccbeac 100644
--- a/tests/run-make-fulldeps/rustdoc-map-file/expected.json
+++ b/tests/run-make/rustdoc-map-file/expected.json
diff --git a/tests/run-make-fulldeps/rustdoc-map-file/foo.rs b/tests/run-make/rustdoc-map-file/foo.rs
index e12b9d229..e12b9d229 100644
--- a/tests/run-make-fulldeps/rustdoc-map-file/foo.rs
+++ b/tests/run-make/rustdoc-map-file/foo.rs
diff --git a/tests/run-make-fulldeps/rustdoc-map-file/validate_json.py b/tests/run-make/rustdoc-map-file/validate_json.py
index 5c14c90b7..5c14c90b7 100755
--- a/tests/run-make-fulldeps/rustdoc-map-file/validate_json.py
+++ b/tests/run-make/rustdoc-map-file/validate_json.py
diff --git a/tests/run-make-fulldeps/rustdoc-output-path/Makefile b/tests/run-make/rustdoc-output-path/Makefile
index 8f5cda9e5..8f5cda9e5 100644
--- a/tests/run-make-fulldeps/rustdoc-output-path/Makefile
+++ b/tests/run-make/rustdoc-output-path/Makefile
diff --git a/tests/run-make-fulldeps/rustdoc-output-path/foo.rs b/tests/run-make/rustdoc-output-path/foo.rs
index 4a835673a..4a835673a 100644
--- a/tests/run-make-fulldeps/rustdoc-output-path/foo.rs
+++ b/tests/run-make/rustdoc-output-path/foo.rs
diff --git a/tests/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile b/tests/run-make/rustdoc-scrape-examples-macros/Makefile
index c857aa4b9..edc19d8cb 100644
--- a/tests/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile
+++ b/tests/run-make/rustdoc-scrape-examples-macros/Makefile
@@ -1,4 +1,5 @@
-include ../../run-make-fulldeps/tools.mk
+# ignore-cross-compile
+include ../../run-make/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
DYLIB_NAME := $(shell echo | $(RUSTC) --crate-name foobar_macro --crate-type dylib --print file-names -)
diff --git a/tests/run-make-fulldeps/rustdoc-scrape-examples-macros/examples/ex.rs b/tests/run-make/rustdoc-scrape-examples-macros/examples/ex.rs
index 4d8c8b30e..4d8c8b30e 100644
--- a/tests/run-make-fulldeps/rustdoc-scrape-examples-macros/examples/ex.rs
+++ b/tests/run-make/rustdoc-scrape-examples-macros/examples/ex.rs
diff --git a/tests/run-make-fulldeps/rustdoc-scrape-examples-macros/src/lib.rs b/tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs
index d8658a0f2..d8658a0f2 100644
--- a/tests/run-make-fulldeps/rustdoc-scrape-examples-macros/src/lib.rs
+++ b/tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs
diff --git a/tests/run-make-fulldeps/rustdoc-scrape-examples-macros/src/proc.rs b/tests/run-make/rustdoc-scrape-examples-macros/src/proc.rs
index 46e518fdf..46e518fdf 100644
--- a/tests/run-make-fulldeps/rustdoc-scrape-examples-macros/src/proc.rs
+++ b/tests/run-make/rustdoc-scrape-examples-macros/src/proc.rs
diff --git a/tests/run-make/rustdoc-scrape-examples-multiple/scrape.mk b/tests/run-make/rustdoc-scrape-examples-multiple/scrape.mk
index 7a28d2145..57220bc66 100644
--- a/tests/run-make/rustdoc-scrape-examples-multiple/scrape.mk
+++ b/tests/run-make/rustdoc-scrape-examples-multiple/scrape.mk
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
diff --git a/tests/run-make/rustdoc-shared-flags/Makefile b/tests/run-make/rustdoc-shared-flags/Makefile
new file mode 100644
index 000000000..a2a7d7b36
--- /dev/null
+++ b/tests/run-make/rustdoc-shared-flags/Makefile
@@ -0,0 +1,18 @@
+include ../tools.mk
+
+all: z_help c_help list_passes
+
+c_help:
+ $(RUSTC) -C help > $(TMPDIR)/rustc.c_help.txt
+ $(RUSTDOC) -C help > $(TMPDIR)/rustdoc.c_help.txt
+ $(DIFF) $(TMPDIR)/rustc.c_help.txt $(TMPDIR)/rustdoc.c_help.txt
+
+z_help:
+ $(RUSTC) -Z help > $(TMPDIR)/rustc.z_help.txt
+ $(RUSTDOC) -Z help > $(TMPDIR)/rustdoc.z_help.txt
+ $(DIFF) $(TMPDIR)/rustc.z_help.txt $(TMPDIR)/rustdoc.z_help.txt
+
+list_passes:
+ $(RUSTC) -C passes=list > $(TMPDIR)/rustc.passes.txt
+ $(RUSTDOC) -C passes=list > $(TMPDIR)/rustdoc.passes.txt
+ $(DIFF) $(TMPDIR)/rustc.passes.txt $(TMPDIR)/rustdoc.passes.txt
diff --git a/tests/run-make-fulldeps/rustdoc-target-spec-json-path/Makefile b/tests/run-make/rustdoc-target-spec-json-path/Makefile
index 6d0bc4186..6d0bc4186 100644
--- a/tests/run-make-fulldeps/rustdoc-target-spec-json-path/Makefile
+++ b/tests/run-make/rustdoc-target-spec-json-path/Makefile
diff --git a/tests/run-make-fulldeps/rustdoc-target-spec-json-path/dummy_core.rs b/tests/run-make/rustdoc-target-spec-json-path/dummy_core.rs
index da27b7f34..da27b7f34 100644
--- a/tests/run-make-fulldeps/rustdoc-target-spec-json-path/dummy_core.rs
+++ b/tests/run-make/rustdoc-target-spec-json-path/dummy_core.rs
diff --git a/tests/run-make-fulldeps/rustdoc-target-spec-json-path/my_crate.rs b/tests/run-make/rustdoc-target-spec-json-path/my_crate.rs
index 12aa08220..12aa08220 100644
--- a/tests/run-make-fulldeps/rustdoc-target-spec-json-path/my_crate.rs
+++ b/tests/run-make/rustdoc-target-spec-json-path/my_crate.rs
diff --git a/tests/run-make-fulldeps/rustdoc-target-spec-json-path/target.json b/tests/run-make/rustdoc-target-spec-json-path/target.json
index 34357182c..34357182c 100644
--- a/tests/run-make-fulldeps/rustdoc-target-spec-json-path/target.json
+++ b/tests/run-make/rustdoc-target-spec-json-path/target.json
diff --git a/tests/run-make-fulldeps/rustdoc-themes/Makefile b/tests/run-make/rustdoc-themes/Makefile
index a6d9a43ad..a6d9a43ad 100644
--- a/tests/run-make-fulldeps/rustdoc-themes/Makefile
+++ b/tests/run-make/rustdoc-themes/Makefile
diff --git a/tests/run-make-fulldeps/rustdoc-themes/foo.rs b/tests/run-make/rustdoc-themes/foo.rs
index 58efaf7d5..995544aef 100644
--- a/tests/run-make-fulldeps/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 - '//link[@rel="stylesheet"]/@href' '../test.css'
+// @has - '//*[@id="rustdoc-vars"]/@data-themes' 'test'
pub struct Foo;
diff --git a/tests/run-make/rustdoc-verify-output-files/Makefile b/tests/run-make/rustdoc-verify-output-files/Makefile
index bfabbbc65..76f233ab4 100644
--- a/tests/run-make/rustdoc-verify-output-files/Makefile
+++ b/tests/run-make/rustdoc-verify-output-files/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
TMP_OUTPUT_DIR := "$(TMPDIR)/tmp-rustdoc"
@@ -14,7 +14,7 @@ all:
$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --out-dir $(OUTPUT_DIR)
# Check if everything exactly same
- $(DIFF) -r -q $(OUTPUT_DIR) $(TMP_OUTPUT_DIR)
+ $(DIFF) -r $(OUTPUT_DIR) $(TMP_OUTPUT_DIR)
# Generate json doc on the same output
$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --out-dir $(OUTPUT_DIR) -Z unstable-options --output-format json
@@ -22,15 +22,11 @@ all:
# Check if expected json file is generated
[ -e $(OUTPUT_DIR)/foobar.json ]
- # TODO
- # We should re-generate json doc once again and compare the diff with previously
- # generated one. Because layout of json docs changes in each compilation, we can't
- # do that currently.
- #
- # See https://github.com/rust-lang/rust/issues/103785#issuecomment-1307425590 for details.
+ # Copy first json output to check if it's exactly same after second compilation
+ cp -R $(OUTPUT_DIR)/foobar.json $(TMP_OUTPUT_DIR)/foobar.json
- # remove generated json doc
- rm $(OUTPUT_DIR)/foobar.json
+ # Generate json doc on the same output
+ $(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --out-dir $(OUTPUT_DIR) -Z unstable-options --output-format json
- # Check if json doc compilation broke any of the html files generated previously
- $(DIFF) -r -q $(OUTPUT_DIR) $(TMP_OUTPUT_DIR)
+ # Check if all docs(including both json and html formats) are still the same after multiple compilations
+ $(DIFF) -r $(OUTPUT_DIR) $(TMP_OUTPUT_DIR)
diff --git a/tests/run-make/rustdoc-with-out-dir-option/Makefile b/tests/run-make/rustdoc-with-out-dir-option/Makefile
index b3c3f5230..f5d5060ed 100644
--- a/tests/run-make/rustdoc-with-out-dir-option/Makefile
+++ b/tests/run-make/rustdoc-with-out-dir-option/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
diff --git a/tests/run-make/rustdoc-with-output-option/Makefile b/tests/run-make/rustdoc-with-output-option/Makefile
index 02093a35c..d0a8205a8 100644
--- a/tests/run-make/rustdoc-with-output-option/Makefile
+++ b/tests/run-make/rustdoc-with-output-option/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
diff --git a/tests/run-make/rustdoc-with-short-out-dir-option/Makefile b/tests/run-make/rustdoc-with-short-out-dir-option/Makefile
index dc5056a86..1b9327bce 100644
--- a/tests/run-make/rustdoc-with-short-out-dir-option/Makefile
+++ b/tests/run-make/rustdoc-with-short-out-dir-option/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
diff --git a/tests/run-make-fulldeps/sanitizer-cdylib-link/Makefile b/tests/run-make/sanitizer-cdylib-link/Makefile
index 691585268..691585268 100644
--- a/tests/run-make-fulldeps/sanitizer-cdylib-link/Makefile
+++ b/tests/run-make/sanitizer-cdylib-link/Makefile
diff --git a/tests/run-make-fulldeps/sanitizer-cdylib-link/library.rs b/tests/run-make/sanitizer-cdylib-link/library.rs
index f2a52cb5c..f2a52cb5c 100644
--- a/tests/run-make-fulldeps/sanitizer-cdylib-link/library.rs
+++ b/tests/run-make/sanitizer-cdylib-link/library.rs
diff --git a/tests/run-make-fulldeps/sanitizer-cdylib-link/program.rs b/tests/run-make/sanitizer-cdylib-link/program.rs
index ef053aa2e..ef053aa2e 100644
--- a/tests/run-make-fulldeps/sanitizer-cdylib-link/program.rs
+++ b/tests/run-make/sanitizer-cdylib-link/program.rs
diff --git a/tests/run-make-fulldeps/sanitizer-dylib-link/Makefile b/tests/run-make/sanitizer-dylib-link/Makefile
index b0a91e5b1..b0a91e5b1 100644
--- a/tests/run-make-fulldeps/sanitizer-dylib-link/Makefile
+++ b/tests/run-make/sanitizer-dylib-link/Makefile
diff --git a/tests/run-make-fulldeps/sanitizer-dylib-link/library.rs b/tests/run-make/sanitizer-dylib-link/library.rs
index f2a52cb5c..f2a52cb5c 100644
--- a/tests/run-make-fulldeps/sanitizer-dylib-link/library.rs
+++ b/tests/run-make/sanitizer-dylib-link/library.rs
diff --git a/tests/run-make-fulldeps/sanitizer-dylib-link/program.rs b/tests/run-make/sanitizer-dylib-link/program.rs
index ef053aa2e..ef053aa2e 100644
--- a/tests/run-make-fulldeps/sanitizer-dylib-link/program.rs
+++ b/tests/run-make/sanitizer-dylib-link/program.rs
diff --git a/tests/run-make-fulldeps/sanitizer-staticlib-link/Makefile b/tests/run-make/sanitizer-staticlib-link/Makefile
index 7b1a286ed..7b1a286ed 100644
--- a/tests/run-make-fulldeps/sanitizer-staticlib-link/Makefile
+++ b/tests/run-make/sanitizer-staticlib-link/Makefile
diff --git a/tests/run-make-fulldeps/sanitizer-staticlib-link/library.rs b/tests/run-make/sanitizer-staticlib-link/library.rs
index f2a52cb5c..f2a52cb5c 100644
--- a/tests/run-make-fulldeps/sanitizer-staticlib-link/library.rs
+++ b/tests/run-make/sanitizer-staticlib-link/library.rs
diff --git a/tests/run-make-fulldeps/sanitizer-staticlib-link/program.c b/tests/run-make/sanitizer-staticlib-link/program.c
index 735e2b147..735e2b147 100644
--- a/tests/run-make-fulldeps/sanitizer-staticlib-link/program.c
+++ b/tests/run-make/sanitizer-staticlib-link/program.c
diff --git a/tests/run-make-fulldeps/sanitizer-staticlib-link/program.rs b/tests/run-make/sanitizer-staticlib-link/program.rs
index ec59bdb11..ec59bdb11 100644
--- a/tests/run-make-fulldeps/sanitizer-staticlib-link/program.rs
+++ b/tests/run-make/sanitizer-staticlib-link/program.rs
diff --git a/tests/run-make-fulldeps/separate-link-fail/Makefile b/tests/run-make/separate-link-fail/Makefile
index bfd18fbf9..bfd18fbf9 100644
--- a/tests/run-make-fulldeps/separate-link-fail/Makefile
+++ b/tests/run-make/separate-link-fail/Makefile
diff --git a/tests/run-make-fulldeps/separate-link/Makefile b/tests/run-make/separate-link/Makefile
index 3ccdb6275..d01158d9f 100644
--- a/tests/run-make-fulldeps/separate-link/Makefile
+++ b/tests/run-make/separate-link/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/sepcomp-cci-copies/Makefile b/tests/run-make/sepcomp-cci-copies/Makefile
index df289d0b0..df289d0b0 100644
--- a/tests/run-make-fulldeps/sepcomp-cci-copies/Makefile
+++ b/tests/run-make/sepcomp-cci-copies/Makefile
diff --git a/tests/run-make-fulldeps/sepcomp-cci-copies/cci_lib.rs b/tests/run-make/sepcomp-cci-copies/cci_lib.rs
index 869d4a6cd..869d4a6cd 100644
--- a/tests/run-make-fulldeps/sepcomp-cci-copies/cci_lib.rs
+++ b/tests/run-make/sepcomp-cci-copies/cci_lib.rs
diff --git a/tests/run-make-fulldeps/sepcomp-cci-copies/foo.rs b/tests/run-make/sepcomp-cci-copies/foo.rs
index ba251fcb0..ba251fcb0 100644
--- a/tests/run-make-fulldeps/sepcomp-cci-copies/foo.rs
+++ b/tests/run-make/sepcomp-cci-copies/foo.rs
diff --git a/tests/run-make-fulldeps/sepcomp-inlining/Makefile b/tests/run-make/sepcomp-inlining/Makefile
index 327aeb75e..327aeb75e 100644
--- a/tests/run-make-fulldeps/sepcomp-inlining/Makefile
+++ b/tests/run-make/sepcomp-inlining/Makefile
diff --git a/tests/run-make-fulldeps/sepcomp-inlining/foo.rs b/tests/run-make/sepcomp-inlining/foo.rs
index 2fe5f9cb7..2fe5f9cb7 100644
--- a/tests/run-make-fulldeps/sepcomp-inlining/foo.rs
+++ b/tests/run-make/sepcomp-inlining/foo.rs
diff --git a/tests/run-make-fulldeps/sepcomp-separate/Makefile b/tests/run-make/sepcomp-separate/Makefile
index 62cf54a88..62cf54a88 100644
--- a/tests/run-make-fulldeps/sepcomp-separate/Makefile
+++ b/tests/run-make/sepcomp-separate/Makefile
diff --git a/tests/run-make-fulldeps/sepcomp-separate/foo.rs b/tests/run-make/sepcomp-separate/foo.rs
index 169bafa9b..169bafa9b 100644
--- a/tests/run-make-fulldeps/sepcomp-separate/foo.rs
+++ b/tests/run-make/sepcomp-separate/foo.rs
diff --git a/tests/run-make-fulldeps/share-generics-dylib/Makefile b/tests/run-make/share-generics-dylib/Makefile
index 065fb574c..9d97eca80 100644
--- a/tests/run-make-fulldeps/share-generics-dylib/Makefile
+++ b/tests/run-make/share-generics-dylib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
# This test makes sure all generic instances get re-exported from Rust dylibs for use by
# `-Zshare-generics`. There are two rlibs (`instance_provider_a` and `instance_provider_b`)
# which both provide an instance of `Cell<i32>::set`. There is `instance_user_dylib` which is
@@ -9,7 +10,7 @@
#
# This is regression test for https://github.com/rust-lang/rust/issues/67276.
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Csymbol-mangling-version=v0
diff --git a/tests/run-make-fulldeps/share-generics-dylib/instance_provider_a.rs b/tests/run-make/share-generics-dylib/instance_provider_a.rs
index b4e125ac0..b4e125ac0 100644
--- a/tests/run-make-fulldeps/share-generics-dylib/instance_provider_a.rs
+++ b/tests/run-make/share-generics-dylib/instance_provider_a.rs
diff --git a/tests/run-make-fulldeps/share-generics-dylib/instance_provider_b.rs b/tests/run-make/share-generics-dylib/instance_provider_b.rs
index f613db873..f613db873 100644
--- a/tests/run-make-fulldeps/share-generics-dylib/instance_provider_b.rs
+++ b/tests/run-make/share-generics-dylib/instance_provider_b.rs
diff --git a/tests/run-make-fulldeps/share-generics-dylib/instance_user_a_rlib.rs b/tests/run-make/share-generics-dylib/instance_user_a_rlib.rs
index c8e6ab95c..c8e6ab95c 100644
--- a/tests/run-make-fulldeps/share-generics-dylib/instance_user_a_rlib.rs
+++ b/tests/run-make/share-generics-dylib/instance_user_a_rlib.rs
diff --git a/tests/run-make-fulldeps/share-generics-dylib/instance_user_b_rlib.rs b/tests/run-make/share-generics-dylib/instance_user_b_rlib.rs
index 7c34af6d0..7c34af6d0 100644
--- a/tests/run-make-fulldeps/share-generics-dylib/instance_user_b_rlib.rs
+++ b/tests/run-make/share-generics-dylib/instance_user_b_rlib.rs
diff --git a/tests/run-make-fulldeps/share-generics-dylib/instance_user_dylib.rs b/tests/run-make/share-generics-dylib/instance_user_dylib.rs
index 7c8368eec..7c8368eec 100644
--- a/tests/run-make-fulldeps/share-generics-dylib/instance_user_dylib.rs
+++ b/tests/run-make/share-generics-dylib/instance_user_dylib.rs
diff --git a/tests/run-make-fulldeps/share-generics-dylib/linked_leaf.rs b/tests/run-make/share-generics-dylib/linked_leaf.rs
index e510dad69..e510dad69 100644
--- a/tests/run-make-fulldeps/share-generics-dylib/linked_leaf.rs
+++ b/tests/run-make/share-generics-dylib/linked_leaf.rs
diff --git a/tests/run-make-fulldeps/simd-ffi/Makefile b/tests/run-make/simd-ffi/Makefile
index 297353470..297353470 100644
--- a/tests/run-make-fulldeps/simd-ffi/Makefile
+++ b/tests/run-make/simd-ffi/Makefile
diff --git a/tests/run-make-fulldeps/simd-ffi/simd.rs b/tests/run-make/simd-ffi/simd.rs
index d11cfd77c..d11cfd77c 100644
--- a/tests/run-make-fulldeps/simd-ffi/simd.rs
+++ b/tests/run-make/simd-ffi/simd.rs
diff --git a/tests/run-make-fulldeps/simple-dylib/Makefile b/tests/run-make/simple-dylib/Makefile
index 5dda5d66d..f3e1c1da8 100644
--- a/tests/run-make-fulldeps/simple-dylib/Makefile
+++ b/tests/run-make/simple-dylib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=dylib -C prefer-dynamic
diff --git a/tests/run-make-fulldeps/simple-dylib/bar.rs b/tests/run-make/simple-dylib/bar.rs
index c5c0bc606..c5c0bc606 100644
--- a/tests/run-make-fulldeps/simple-dylib/bar.rs
+++ b/tests/run-make/simple-dylib/bar.rs
diff --git a/tests/run-make-fulldeps/simple-dylib/foo.rs b/tests/run-make/simple-dylib/foo.rs
index 8d68535e3..8d68535e3 100644
--- a/tests/run-make-fulldeps/simple-dylib/foo.rs
+++ b/tests/run-make/simple-dylib/foo.rs
diff --git a/tests/run-make-fulldeps/simple-rlib/Makefile b/tests/run-make/simple-rlib/Makefile
index d912b8a7b..28df61a15 100644
--- a/tests/run-make-fulldeps/simple-rlib/Makefile
+++ b/tests/run-make/simple-rlib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=rlib
diff --git a/tests/run-make-fulldeps/simple-rlib/bar.rs b/tests/run-make/simple-rlib/bar.rs
index c5c0bc606..c5c0bc606 100644
--- a/tests/run-make-fulldeps/simple-rlib/bar.rs
+++ b/tests/run-make/simple-rlib/bar.rs
diff --git a/tests/run-make-fulldeps/simple-rlib/foo.rs b/tests/run-make/simple-rlib/foo.rs
index 8d68535e3..8d68535e3 100644
--- a/tests/run-make-fulldeps/simple-rlib/foo.rs
+++ b/tests/run-make/simple-rlib/foo.rs
diff --git a/tests/run-make-fulldeps/split-debuginfo/Makefile b/tests/run-make/split-debuginfo/Makefile
index 44cda0d3d..71e014c1f 100644
--- a/tests/run-make-fulldeps/split-debuginfo/Makefile
+++ b/tests/run-make/split-debuginfo/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: off packed unpacked
diff --git a/tests/run-make-fulldeps/split-debuginfo/bar.rs b/tests/run-make/split-debuginfo/bar.rs
index 07dd07152..07dd07152 100644
--- a/tests/run-make-fulldeps/split-debuginfo/bar.rs
+++ b/tests/run-make/split-debuginfo/bar.rs
diff --git a/tests/run-make-fulldeps/split-debuginfo/baz.rs b/tests/run-make/split-debuginfo/baz.rs
index 8b1a39374..8b1a39374 100644
--- a/tests/run-make-fulldeps/split-debuginfo/baz.rs
+++ b/tests/run-make/split-debuginfo/baz.rs
diff --git a/tests/run-make-fulldeps/split-debuginfo/foo.rs b/tests/run-make/split-debuginfo/foo.rs
index b058e5408..b058e5408 100644
--- a/tests/run-make-fulldeps/split-debuginfo/foo.rs
+++ b/tests/run-make/split-debuginfo/foo.rs
diff --git a/tests/run-make-fulldeps/split-debuginfo/main.rs b/tests/run-make/split-debuginfo/main.rs
index 21fa16e40..21fa16e40 100644
--- a/tests/run-make-fulldeps/split-debuginfo/main.rs
+++ b/tests/run-make/split-debuginfo/main.rs
diff --git a/tests/run-make-fulldeps/stable-symbol-names/Makefile b/tests/run-make/stable-symbol-names/Makefile
index bbfb8e388..bbfb8e388 100644
--- a/tests/run-make-fulldeps/stable-symbol-names/Makefile
+++ b/tests/run-make/stable-symbol-names/Makefile
diff --git a/tests/run-make-fulldeps/stable-symbol-names/stable-symbol-names1.rs b/tests/run-make/stable-symbol-names/stable-symbol-names1.rs
index b85a42827..b85a42827 100644
--- a/tests/run-make-fulldeps/stable-symbol-names/stable-symbol-names1.rs
+++ b/tests/run-make/stable-symbol-names/stable-symbol-names1.rs
diff --git a/tests/run-make-fulldeps/stable-symbol-names/stable-symbol-names2.rs b/tests/run-make/stable-symbol-names/stable-symbol-names2.rs
index 33df9d6c6..33df9d6c6 100644
--- a/tests/run-make-fulldeps/stable-symbol-names/stable-symbol-names2.rs
+++ b/tests/run-make/stable-symbol-names/stable-symbol-names2.rs
diff --git a/tests/run-make-fulldeps/static-dylib-by-default/Makefile b/tests/run-make/static-dylib-by-default/Makefile
index eedd0b320..cdaab42d0 100644
--- a/tests/run-make-fulldeps/static-dylib-by-default/Makefile
+++ b/tests/run-make/static-dylib-by-default/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
TO_LINK := $(call DYLIB,bar)
diff --git a/tests/run-make-fulldeps/static-dylib-by-default/bar.rs b/tests/run-make/static-dylib-by-default/bar.rs
index 14421165e..14421165e 100644
--- a/tests/run-make-fulldeps/static-dylib-by-default/bar.rs
+++ b/tests/run-make/static-dylib-by-default/bar.rs
diff --git a/tests/run-make-fulldeps/static-dylib-by-default/foo.rs b/tests/run-make/static-dylib-by-default/foo.rs
index 7ebec8720..7ebec8720 100644
--- a/tests/run-make-fulldeps/static-dylib-by-default/foo.rs
+++ b/tests/run-make/static-dylib-by-default/foo.rs
diff --git a/tests/run-make-fulldeps/static-dylib-by-default/main.c b/tests/run-make/static-dylib-by-default/main.c
index 5f7f2c27c..5f7f2c27c 100644
--- a/tests/run-make-fulldeps/static-dylib-by-default/main.c
+++ b/tests/run-make/static-dylib-by-default/main.c
diff --git a/tests/run-make-fulldeps/static-extern-type/Makefile b/tests/run-make/static-extern-type/Makefile
index e9aa95e63..778971543 100644
--- a/tests/run-make-fulldeps/static-extern-type/Makefile
+++ b/tests/run-make/static-extern-type/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,define-foo)
diff --git a/tests/run-make-fulldeps/static-extern-type/define-foo.c b/tests/run-make/static-extern-type/define-foo.c
index 39be5acfa..39be5acfa 100644
--- a/tests/run-make-fulldeps/static-extern-type/define-foo.c
+++ b/tests/run-make/static-extern-type/define-foo.c
diff --git a/tests/run-make-fulldeps/static-extern-type/use-foo.rs b/tests/run-make/static-extern-type/use-foo.rs
index 932b5b594..932b5b594 100644
--- a/tests/run-make-fulldeps/static-extern-type/use-foo.rs
+++ b/tests/run-make/static-extern-type/use-foo.rs
diff --git a/tests/run-make/static-pie/Makefile b/tests/run-make/static-pie/Makefile
index f4e6adf1b..8379730cc 100644
--- a/tests/run-make/static-pie/Makefile
+++ b/tests/run-make/static-pie/Makefile
@@ -1,8 +1,8 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-x86_64
# only-linux
-# ignore-gnux32
+# ignore-32bit
# How to manually run this
# $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] tests/run-make/static-pie
diff --git a/tests/run-make-fulldeps/static-unwinding/Makefile b/tests/run-make/static-unwinding/Makefile
index 9c755d4ab..dec94fb16 100644
--- a/tests/run-make-fulldeps/static-unwinding/Makefile
+++ b/tests/run-make/static-unwinding/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/static-unwinding/lib.rs b/tests/run-make/static-unwinding/lib.rs
index 3fb1117a1..3fb1117a1 100644
--- a/tests/run-make-fulldeps/static-unwinding/lib.rs
+++ b/tests/run-make/static-unwinding/lib.rs
diff --git a/tests/run-make-fulldeps/static-unwinding/main.rs b/tests/run-make/static-unwinding/main.rs
index 0c66ea1aa..0c66ea1aa 100644
--- a/tests/run-make-fulldeps/static-unwinding/main.rs
+++ b/tests/run-make/static-unwinding/main.rs
diff --git a/tests/run-make-fulldeps/staticlib-blank-lib/Makefile b/tests/run-make/staticlib-blank-lib/Makefile
index fcbf87758..fcbf87758 100644
--- a/tests/run-make-fulldeps/staticlib-blank-lib/Makefile
+++ b/tests/run-make/staticlib-blank-lib/Makefile
diff --git a/tests/run-make-fulldeps/staticlib-blank-lib/foo.rs b/tests/run-make/staticlib-blank-lib/foo.rs
index bf48d069d..bf48d069d 100644
--- a/tests/run-make-fulldeps/staticlib-blank-lib/foo.rs
+++ b/tests/run-make/staticlib-blank-lib/foo.rs
diff --git a/tests/run-make-fulldeps/std-core-cycle/Makefile b/tests/run-make/std-core-cycle/Makefile
index 4f2528637..5ed6be905 100644
--- a/tests/run-make-fulldeps/std-core-cycle/Makefile
+++ b/tests/run-make/std-core-cycle/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
ifeq ($(UNAME),Darwin)
diff --git a/tests/run-make-fulldeps/std-core-cycle/bar.rs b/tests/run-make/std-core-cycle/bar.rs
index 9f5e7c29b..9f5e7c29b 100644
--- a/tests/run-make-fulldeps/std-core-cycle/bar.rs
+++ b/tests/run-make/std-core-cycle/bar.rs
diff --git a/tests/run-make-fulldeps/std-core-cycle/foo.rs b/tests/run-make/std-core-cycle/foo.rs
index 6aa6e1ac3..6aa6e1ac3 100644
--- a/tests/run-make-fulldeps/std-core-cycle/foo.rs
+++ b/tests/run-make/std-core-cycle/foo.rs
diff --git a/tests/run-make-fulldeps/stdin-non-utf8/Makefile b/tests/run-make/stdin-non-utf8/Makefile
index 709d4cf14..709d4cf14 100644
--- a/tests/run-make-fulldeps/stdin-non-utf8/Makefile
+++ b/tests/run-make/stdin-non-utf8/Makefile
diff --git a/tests/run-make-fulldeps/stdin-non-utf8/non-utf8 b/tests/run-make/stdin-non-utf8/non-utf8
index bc87051a8..bc87051a8 100644
--- a/tests/run-make-fulldeps/stdin-non-utf8/non-utf8
+++ b/tests/run-make/stdin-non-utf8/non-utf8
diff --git a/tests/run-make-fulldeps/suspicious-library/Makefile b/tests/run-make/suspicious-library/Makefile
index 2af9e85c2..3b5ab3c53 100644
--- a/tests/run-make-fulldeps/suspicious-library/Makefile
+++ b/tests/run-make/suspicious-library/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/suspicious-library/bar.rs b/tests/run-make/suspicious-library/bar.rs
index 550c94cd0..550c94cd0 100644
--- a/tests/run-make-fulldeps/suspicious-library/bar.rs
+++ b/tests/run-make/suspicious-library/bar.rs
diff --git a/tests/run-make-fulldeps/suspicious-library/foo.rs b/tests/run-make/suspicious-library/foo.rs
index a382d8f2c..a382d8f2c 100644
--- a/tests/run-make-fulldeps/suspicious-library/foo.rs
+++ b/tests/run-make/suspicious-library/foo.rs
diff --git a/tests/run-make-fulldeps/symbol-visibility/Makefile b/tests/run-make/symbol-visibility/Makefile
index 17052ef4e..9159af214 100644
--- a/tests/run-make-fulldeps/symbol-visibility/Makefile
+++ b/tests/run-make/symbol-visibility/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows-msvc
diff --git a/tests/run-make-fulldeps/symbol-visibility/a_cdylib.rs b/tests/run-make/symbol-visibility/a_cdylib.rs
index d4fbff85b..d4fbff85b 100644
--- a/tests/run-make-fulldeps/symbol-visibility/a_cdylib.rs
+++ b/tests/run-make/symbol-visibility/a_cdylib.rs
diff --git a/tests/run-make-fulldeps/symbol-visibility/a_proc_macro.rs b/tests/run-make/symbol-visibility/a_proc_macro.rs
index 9fd1a8a67..9fd1a8a67 100644
--- a/tests/run-make-fulldeps/symbol-visibility/a_proc_macro.rs
+++ b/tests/run-make/symbol-visibility/a_proc_macro.rs
diff --git a/tests/run-make-fulldeps/symbol-visibility/a_rust_dylib.rs b/tests/run-make/symbol-visibility/a_rust_dylib.rs
index a47df0ab7..a47df0ab7 100644
--- a/tests/run-make-fulldeps/symbol-visibility/a_rust_dylib.rs
+++ b/tests/run-make/symbol-visibility/a_rust_dylib.rs
diff --git a/tests/run-make-fulldeps/symbol-visibility/an_executable.rs b/tests/run-make/symbol-visibility/an_executable.rs
index 3f5e125ad..3f5e125ad 100644
--- a/tests/run-make-fulldeps/symbol-visibility/an_executable.rs
+++ b/tests/run-make/symbol-visibility/an_executable.rs
diff --git a/tests/run-make-fulldeps/symbol-visibility/an_rlib.rs b/tests/run-make/symbol-visibility/an_rlib.rs
index 3696422b1..3696422b1 100644
--- a/tests/run-make-fulldeps/symbol-visibility/an_rlib.rs
+++ b/tests/run-make/symbol-visibility/an_rlib.rs
diff --git a/tests/run-make-fulldeps/symbols-include-type-name/Makefile b/tests/run-make/symbols-include-type-name/Makefile
index ac26a852e..ac26a852e 100644
--- a/tests/run-make-fulldeps/symbols-include-type-name/Makefile
+++ b/tests/run-make/symbols-include-type-name/Makefile
diff --git a/tests/run-make-fulldeps/symbols-include-type-name/lib.rs b/tests/run-make/symbols-include-type-name/lib.rs
index 37d445917..37d445917 100644
--- a/tests/run-make-fulldeps/symbols-include-type-name/lib.rs
+++ b/tests/run-make/symbols-include-type-name/lib.rs
diff --git a/tests/run-make-fulldeps/symlinked-extern/Makefile b/tests/run-make/symlinked-extern/Makefile
index 058f43e85..28c764b84 100644
--- a/tests/run-make-fulldeps/symlinked-extern/Makefile
+++ b/tests/run-make/symlinked-extern/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows
diff --git a/tests/run-make-fulldeps/symlinked-extern/bar.rs b/tests/run-make/symlinked-extern/bar.rs
index cd9c959d5..cd9c959d5 100644
--- a/tests/run-make-fulldeps/symlinked-extern/bar.rs
+++ b/tests/run-make/symlinked-extern/bar.rs
diff --git a/tests/run-make-fulldeps/symlinked-extern/baz.rs b/tests/run-make/symlinked-extern/baz.rs
index cd433a3ac..cd433a3ac 100644
--- a/tests/run-make-fulldeps/symlinked-extern/baz.rs
+++ b/tests/run-make/symlinked-extern/baz.rs
diff --git a/tests/run-make-fulldeps/symlinked-extern/foo.rs b/tests/run-make/symlinked-extern/foo.rs
index c00700b8c..c00700b8c 100644
--- a/tests/run-make-fulldeps/symlinked-extern/foo.rs
+++ b/tests/run-make/symlinked-extern/foo.rs
diff --git a/tests/run-make-fulldeps/symlinked-libraries/Makefile b/tests/run-make/symlinked-libraries/Makefile
index 576bf7e54..fb0b6127e 100644
--- a/tests/run-make-fulldeps/symlinked-libraries/Makefile
+++ b/tests/run-make/symlinked-libraries/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows
diff --git a/tests/run-make-fulldeps/symlinked-libraries/bar.rs b/tests/run-make/symlinked-libraries/bar.rs
index fde0d7466..fde0d7466 100644
--- a/tests/run-make-fulldeps/symlinked-libraries/bar.rs
+++ b/tests/run-make/symlinked-libraries/bar.rs
diff --git a/tests/run-make-fulldeps/symlinked-libraries/foo.rs b/tests/run-make/symlinked-libraries/foo.rs
index cde9e291b..cde9e291b 100644
--- a/tests/run-make-fulldeps/symlinked-libraries/foo.rs
+++ b/tests/run-make/symlinked-libraries/foo.rs
diff --git a/tests/run-make-fulldeps/symlinked-rlib/Makefile b/tests/run-make/symlinked-rlib/Makefile
index 49d3f220a..a8565f683 100644
--- a/tests/run-make-fulldeps/symlinked-rlib/Makefile
+++ b/tests/run-make/symlinked-rlib/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
# ignore-windows
diff --git a/tests/run-make-fulldeps/symlinked-rlib/bar.rs b/tests/run-make/symlinked-rlib/bar.rs
index fde0d7466..fde0d7466 100644
--- a/tests/run-make-fulldeps/symlinked-rlib/bar.rs
+++ b/tests/run-make/symlinked-rlib/bar.rs
diff --git a/tests/run-make-fulldeps/symlinked-rlib/foo.rs b/tests/run-make/symlinked-rlib/foo.rs
index c5c0bc606..c5c0bc606 100644
--- a/tests/run-make-fulldeps/symlinked-rlib/foo.rs
+++ b/tests/run-make/symlinked-rlib/foo.rs
diff --git a/tests/run-make-fulldeps/sysroot-crates-are-unstable/Makefile b/tests/run-make/sysroot-crates-are-unstable/Makefile
index 1e267fb95..1e267fb95 100644
--- a/tests/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+++ b/tests/run-make/sysroot-crates-are-unstable/Makefile
diff --git a/tests/run-make-fulldeps/sysroot-crates-are-unstable/test.py b/tests/run-make/sysroot-crates-are-unstable/test.py
index cb77eb34f..cab4faa4e 100644
--- a/tests/run-make-fulldeps/sysroot-crates-are-unstable/test.py
+++ b/tests/run-make/sysroot-crates-are-unstable/test.py
@@ -43,6 +43,7 @@ def check_lib(lib):
return True
print('verifying if {} is an unstable crate'.format(lib['name']))
stdout, stderr = exec_command([os.environ['RUSTC'], '-', '--crate-type', 'rlib',
+ '--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):
diff --git a/tests/run-make-fulldeps/target-cpu-native/Makefile b/tests/run-make/target-cpu-native/Makefile
index eb3ca1e13..eb3ca1e13 100644
--- a/tests/run-make-fulldeps/target-cpu-native/Makefile
+++ b/tests/run-make/target-cpu-native/Makefile
diff --git a/tests/run-make-fulldeps/target-cpu-native/foo.rs b/tests/run-make/target-cpu-native/foo.rs
index f79c691f0..f79c691f0 100644
--- a/tests/run-make-fulldeps/target-cpu-native/foo.rs
+++ b/tests/run-make/target-cpu-native/foo.rs
diff --git a/tests/run-make-fulldeps/target-specs/Makefile b/tests/run-make/target-specs/Makefile
index a33f5368e..a33f5368e 100644
--- a/tests/run-make-fulldeps/target-specs/Makefile
+++ b/tests/run-make/target-specs/Makefile
diff --git a/tests/run-make-fulldeps/target-specs/definitely-not-builtin-target.json b/tests/run-make/target-specs/definitely-not-builtin-target.json
index b36fa993d..b36fa993d 100644
--- a/tests/run-make-fulldeps/target-specs/definitely-not-builtin-target.json
+++ b/tests/run-make/target-specs/definitely-not-builtin-target.json
diff --git a/tests/run-make-fulldeps/target-specs/foo.rs b/tests/run-make/target-specs/foo.rs
index 22939e879..22939e879 100644
--- a/tests/run-make-fulldeps/target-specs/foo.rs
+++ b/tests/run-make/target-specs/foo.rs
diff --git a/tests/run-make-fulldeps/target-specs/mismatching-data-layout.json b/tests/run-make/target-specs/mismatching-data-layout.json
index d12caaad1..d12caaad1 100644
--- a/tests/run-make-fulldeps/target-specs/mismatching-data-layout.json
+++ b/tests/run-make/target-specs/mismatching-data-layout.json
diff --git a/tests/run-make-fulldeps/target-specs/my-awesome-platform.json b/tests/run-make/target-specs/my-awesome-platform.json
index 00de3de05..00de3de05 100644
--- a/tests/run-make-fulldeps/target-specs/my-awesome-platform.json
+++ b/tests/run-make/target-specs/my-awesome-platform.json
diff --git a/tests/run-make-fulldeps/target-specs/my-incomplete-platform.json b/tests/run-make/target-specs/my-incomplete-platform.json
index ceaa25cdf..ceaa25cdf 100644
--- a/tests/run-make-fulldeps/target-specs/my-incomplete-platform.json
+++ b/tests/run-make/target-specs/my-incomplete-platform.json
diff --git a/tests/run-make-fulldeps/target-specs/my-invalid-platform.json b/tests/run-make/target-specs/my-invalid-platform.json
index 3feac45b7..3feac45b7 100644
--- a/tests/run-make-fulldeps/target-specs/my-invalid-platform.json
+++ b/tests/run-make/target-specs/my-invalid-platform.json
diff --git a/tests/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json
index 6d5e964ed..6d5e964ed 100644
--- a/tests/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json
+++ b/tests/run-make/target-specs/my-x86_64-unknown-linux-gnu-platform.json
diff --git a/tests/run-make-fulldeps/target-without-atomic-cas/Makefile b/tests/run-make/target-without-atomic-cas/Makefile
index 451f03d66..451f03d66 100644
--- a/tests/run-make-fulldeps/target-without-atomic-cas/Makefile
+++ b/tests/run-make/target-without-atomic-cas/Makefile
diff --git a/tests/run-make/test-benches/Makefile b/tests/run-make/test-benches/Makefile
index 8fc122515..0253a5263 100644
--- a/tests/run-make/test-benches/Makefile
+++ b/tests/run-make/test-benches/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# ignore-cross-compile
diff --git a/tests/run-make-fulldeps/test-harness/Makefile b/tests/run-make/test-harness/Makefile
index 1fe059b07..ee8c9294f 100644
--- a/tests/run-make-fulldeps/test-harness/Makefile
+++ b/tests/run-make/test-harness/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/test-harness/test-ignore-cfg.rs b/tests/run-make/test-harness/test-ignore-cfg.rs
index 31ef131f2..31ef131f2 100644
--- a/tests/run-make-fulldeps/test-harness/test-ignore-cfg.rs
+++ b/tests/run-make/test-harness/test-ignore-cfg.rs
diff --git a/tests/run-make/thumb-none-cortex-m/Makefile b/tests/run-make/thumb-none-cortex-m/Makefile
index 3065141c0..e941fc4a7 100644
--- a/tests/run-make/thumb-none-cortex-m/Makefile
+++ b/tests/run-make/thumb-none-cortex-m/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# How to run this
# $ ./x.py clean
diff --git a/tests/run-make/thumb-none-qemu/Makefile b/tests/run-make/thumb-none-qemu/Makefile
index a1c2ba12c..eea6ca349 100644
--- a/tests/run-make/thumb-none-qemu/Makefile
+++ b/tests/run-make/thumb-none-qemu/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-thumb
diff --git a/tests/run-make-fulldeps/tools.mk b/tests/run-make/tools.mk
index 0f5425daa..ea06b620c 100644
--- a/tests/run-make-fulldeps/tools.mk
+++ b/tests/run-make/tools.mk
@@ -112,9 +112,9 @@ endif
# Extra flags needed to compile a working executable with the standard library
ifdef IS_WINDOWS
ifdef IS_MSVC
- EXTRACFLAGS := ws2_32.lib userenv.lib advapi32.lib bcrypt.lib
+ EXTRACFLAGS := ws2_32.lib userenv.lib advapi32.lib bcrypt.lib ntdll.lib
else
- EXTRACFLAGS := -lws2_32 -luserenv -lbcrypt
+ EXTRACFLAGS := -lws2_32 -luserenv -lbcrypt -lntdll
EXTRACXXFLAGS := -lstdc++
# So this is a bit hacky: we can't use the DLL version of libstdc++ because
# it pulls in the DLL version of libgcc, which means that we end up with 2
diff --git a/tests/run-make/track-path-dep-info/Makefile b/tests/run-make/track-path-dep-info/Makefile
index ee853943f..0d6c9b1d2 100644
--- a/tests/run-make/track-path-dep-info/Makefile
+++ b/tests/run-make/track-path-dep-info/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
# instead of hardcoding them everywhere they're needed.
diff --git a/tests/run-make/track-pgo-dep-info/Makefile b/tests/run-make/track-pgo-dep-info/Makefile
index 60b59c04a..6c7f67d0f 100644
--- a/tests/run-make/track-pgo-dep-info/Makefile
+++ b/tests/run-make/track-pgo-dep-info/Makefile
@@ -1,7 +1,7 @@
# needs-profiler-support
# ignore-windows-gnu
--include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
# instead of hardcoding them everywhere they're needed.
diff --git a/tests/run-make/translation/Makefile b/tests/run-make/translation/Makefile
index 5b0b331ca..0acf64e5d 100644
--- a/tests/run-make/translation/Makefile
+++ b/tests/run-make/translation/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# This test uses `ln -s` rather than copying to save testing time, but its
# usage doesn't work on Windows.
@@ -13,22 +13,22 @@ all: normal custom missing broken sysroot sysroot-invalid sysroot-missing
# Check that the test works normally, using the built-in fallback bundle.
normal: test.rs
- $(RUSTC) $< 2>&1 | grep "struct literal body without path"
+ $(RUSTC) $< 2>&1 | $(CGREP) "struct literal body without path"
# Check that a primary bundle can be loaded and will be preferentially used
# where possible.
custom: test.rs working.ftl
- $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/working.ftl 2>&1 | grep "this is a test message"
+ $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/working.ftl 2>&1 | $(CGREP) "this is a test message"
# Check that a primary bundle with a broken message (e.g. a interpolated
# variable is missing) will use the fallback bundle.
missing: test.rs missing.ftl
- $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/missing.ftl 2>&1 | grep "struct literal body without path"
+ $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/missing.ftl 2>&1 | $(CGREP) "struct literal body without path"
# Check that a primary bundle without the desired message will use the fallback
# bundle.
broken: test.rs broken.ftl
- $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/broken.ftl 2>&1 | grep "struct literal body without path"
+ $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/broken.ftl 2>&1 | $(CGREP) "struct literal body without path"
# Check that a locale can be loaded from the sysroot given a language
# identifier by making a local copy of the sysroot and adding the custom locale
@@ -48,13 +48,13 @@ sysroot: test.rs working.ftl
ln -s $(SYSROOT)/lib/rustlib/src/* $(FAKEROOT)/lib/rustlib/src
mkdir -p $(FAKEROOT)/share/locale/zh-CN/
ln -s $(CURDIR)/working.ftl $(FAKEROOT)/share/locale/zh-CN/basic-translation.ftl
- $(RUSTC) $< --sysroot $(FAKEROOT) -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message"
+ $(RUSTC) $< --sysroot $(FAKEROOT) -Ztranslate-lang=zh-CN 2>&1 | $(CGREP) "this is a test message"
# Check that the compiler errors out when the sysroot requested cannot be
# found. This test might start failing if there actually exists a Klingon
# translation of rustc's error messages.
-sysroot-missing:
- $(RUSTC) $< -Ztranslate-lang=tlh 2>&1 | grep "missing locale directory"
+sysroot-missing:
+ $(RUSTC) $< -Ztranslate-lang=tlh 2>&1 | $(CGREP) "missing locale directory"
# Check that the compiler errors out when the directory for the locale in the
# sysroot is actually a file.
@@ -73,4 +73,4 @@ sysroot-invalid: test.rs working.ftl
ln -s $(SYSROOT)/lib/rustlib/src/* $(FAKEROOT)/lib/rustlib/src
mkdir -p $(FAKEROOT)/share/locale
touch $(FAKEROOT)/share/locale/zh-CN
- $(RUSTC) $< --sysroot $(FAKEROOT) -Ztranslate-lang=zh-CN 2>&1 | grep "`\$sysroot/share/locales/\$locale` is not a directory"
+ $(RUSTC) $< --sysroot $(FAKEROOT) -Ztranslate-lang=zh-CN 2>&1 | $(CGREP) "`\$sysroot/share/locales/\$locale` is not a directory"
diff --git a/tests/run-make-fulldeps/type-mismatch-same-crate-name/Makefile b/tests/run-make/type-mismatch-same-crate-name/Makefile
index a2a2a41c7..a2a2a41c7 100644
--- a/tests/run-make-fulldeps/type-mismatch-same-crate-name/Makefile
+++ b/tests/run-make/type-mismatch-same-crate-name/Makefile
diff --git a/tests/run-make-fulldeps/type-mismatch-same-crate-name/crateA.rs b/tests/run-make/type-mismatch-same-crate-name/crateA.rs
index 4871c8c2e..4871c8c2e 100644
--- a/tests/run-make-fulldeps/type-mismatch-same-crate-name/crateA.rs
+++ b/tests/run-make/type-mismatch-same-crate-name/crateA.rs
diff --git a/tests/run-make-fulldeps/type-mismatch-same-crate-name/crateB.rs b/tests/run-make/type-mismatch-same-crate-name/crateB.rs
index 24fcc7cad..24fcc7cad 100644
--- a/tests/run-make-fulldeps/type-mismatch-same-crate-name/crateB.rs
+++ b/tests/run-make/type-mismatch-same-crate-name/crateB.rs
diff --git a/tests/run-make-fulldeps/type-mismatch-same-crate-name/crateC.rs b/tests/run-make/type-mismatch-same-crate-name/crateC.rs
index 71b38a9f8..71b38a9f8 100644
--- a/tests/run-make-fulldeps/type-mismatch-same-crate-name/crateC.rs
+++ b/tests/run-make/type-mismatch-same-crate-name/crateC.rs
diff --git a/tests/run-make/unstable-flag-required/Makefile b/tests/run-make/unstable-flag-required/Makefile
index d3a734fae..17dd15b07 100644
--- a/tests/run-make/unstable-flag-required/Makefile
+++ b/tests/run-make/unstable-flag-required/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTDOC) --output-format=json x.html 2>&1 | diff - output-format-json.stderr
diff --git a/tests/run-make-fulldeps/use-extern-for-plugins/Makefile b/tests/run-make/use-extern-for-plugins/Makefile
index 6ae53afad..b8ec7e8dc 100644
--- a/tests/run-make-fulldeps/use-extern-for-plugins/Makefile
+++ b/tests/run-make/use-extern-for-plugins/Makefile
@@ -2,7 +2,7 @@ include ../tools.mk
# ignore-freebsd
# ignore-openbsd
-# ignore-sunos
+# ignore-solaris
HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //')
ifeq ($(findstring i686,$(HOST)),i686)
diff --git a/tests/run-make-fulldeps/use-extern-for-plugins/bar.rs b/tests/run-make/use-extern-for-plugins/bar.rs
index 704d21203..704d21203 100644
--- a/tests/run-make-fulldeps/use-extern-for-plugins/bar.rs
+++ b/tests/run-make/use-extern-for-plugins/bar.rs
diff --git a/tests/run-make-fulldeps/use-extern-for-plugins/baz.rs b/tests/run-make/use-extern-for-plugins/baz.rs
index 49a96a0c8..49a96a0c8 100644
--- a/tests/run-make-fulldeps/use-extern-for-plugins/baz.rs
+++ b/tests/run-make/use-extern-for-plugins/baz.rs
diff --git a/tests/run-make-fulldeps/use-extern-for-plugins/foo.rs b/tests/run-make/use-extern-for-plugins/foo.rs
index dffdc0798..dffdc0798 100644
--- a/tests/run-make-fulldeps/use-extern-for-plugins/foo.rs
+++ b/tests/run-make/use-extern-for-plugins/foo.rs
diff --git a/tests/run-make-fulldeps/use-suggestions-rust-2018/Makefile b/tests/run-make/use-suggestions-rust-2018/Makefile
index 37cd6283c..37cd6283c 100644
--- a/tests/run-make-fulldeps/use-suggestions-rust-2018/Makefile
+++ b/tests/run-make/use-suggestions-rust-2018/Makefile
diff --git a/tests/run-make-fulldeps/use-suggestions-rust-2018/ep-nested-lib.rs b/tests/run-make/use-suggestions-rust-2018/ep-nested-lib.rs
index 62a0a9d8f..62a0a9d8f 100644
--- a/tests/run-make-fulldeps/use-suggestions-rust-2018/ep-nested-lib.rs
+++ b/tests/run-make/use-suggestions-rust-2018/ep-nested-lib.rs
diff --git a/tests/run-make-fulldeps/use-suggestions-rust-2018/use-suggestions.rs b/tests/run-make/use-suggestions-rust-2018/use-suggestions.rs
index d262d6f98..d262d6f98 100644
--- a/tests/run-make-fulldeps/use-suggestions-rust-2018/use-suggestions.rs
+++ b/tests/run-make/use-suggestions-rust-2018/use-suggestions.rs
diff --git a/tests/run-make-fulldeps/used-cdylib-macos/Makefile b/tests/run-make/used-cdylib-macos/Makefile
index 38a4c31c7..38a4c31c7 100644
--- a/tests/run-make-fulldeps/used-cdylib-macos/Makefile
+++ b/tests/run-make/used-cdylib-macos/Makefile
diff --git a/tests/run-make-fulldeps/used-cdylib-macos/dylib_used.rs b/tests/run-make/used-cdylib-macos/dylib_used.rs
index 85f0ff92f..85f0ff92f 100644
--- a/tests/run-make-fulldeps/used-cdylib-macos/dylib_used.rs
+++ b/tests/run-make/used-cdylib-macos/dylib_used.rs
diff --git a/tests/run-make-fulldeps/used/Makefile b/tests/run-make/used/Makefile
index e80eb9e40..e80eb9e40 100644
--- a/tests/run-make-fulldeps/used/Makefile
+++ b/tests/run-make/used/Makefile
diff --git a/tests/run-make-fulldeps/used/used.rs b/tests/run-make/used/used.rs
index dca0a5e11..dca0a5e11 100644
--- a/tests/run-make-fulldeps/used/used.rs
+++ b/tests/run-make/used/used.rs
diff --git a/tests/run-make/valid-print-requests/Makefile b/tests/run-make/valid-print-requests/Makefile
index c325e536e..99430e98d 100644
--- a/tests/run-make/valid-print-requests/Makefile
+++ b/tests/run-make/valid-print-requests/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
all:
$(RUSTC) --print uwu 2>&1 | diff - valid-print-requests.stderr
diff --git a/tests/run-make/valid-print-requests/valid-print-requests.stderr b/tests/run-make/valid-print-requests/valid-print-requests.stderr
index 5191e4676..bea6ce067 100644
--- a/tests/run-make/valid-print-requests/valid-print-requests.stderr
+++ b/tests/run-make/valid-print-requests/valid-print-requests.stderr
@@ -1,2 +1,2 @@
-error: unknown print request `uwu`. Valid print requests are: `crate-name`, `file-names`, `sysroot`, `target-libdir`, `cfg`, `calling-conventions`, `target-list`, `target-cpus`, `target-features`, `relocation-models`, `code-models`, `tls-models`, `native-static-libs`, `stack-protector-strategies`, `target-spec-json`, `link-args`, `split-debuginfo`
+error: unknown print request `uwu`. Valid print requests are: `crate-name`, `file-names`, `sysroot`, `target-libdir`, `cfg`, `calling-conventions`, `target-list`, `target-cpus`, `target-features`, `relocation-models`, `code-models`, `tls-models`, `native-static-libs`, `stack-protector-strategies`, `target-spec-json`, `all-target-specs-json`, `link-args`, `split-debuginfo`
diff --git a/tests/run-make-fulldeps/version/Makefile b/tests/run-make/version/Makefile
index 3a130545d..3a130545d 100644
--- a/tests/run-make-fulldeps/version/Makefile
+++ b/tests/run-make/version/Makefile
diff --git a/tests/run-make-fulldeps/volatile-intrinsics/Makefile b/tests/run-make/volatile-intrinsics/Makefile
index 2a78c7b9c..5672a0458 100644
--- a/tests/run-make-fulldeps/volatile-intrinsics/Makefile
+++ b/tests/run-make/volatile-intrinsics/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/volatile-intrinsics/main.rs b/tests/run-make/volatile-intrinsics/main.rs
index 4295d95f3..4295d95f3 100644
--- a/tests/run-make-fulldeps/volatile-intrinsics/main.rs
+++ b/tests/run-make/volatile-intrinsics/main.rs
diff --git a/tests/run-make/wasm-abi/Makefile b/tests/run-make/wasm-abi/Makefile
index e713ca187..ed95464ef 100644
--- a/tests/run-make/wasm-abi/Makefile
+++ b/tests/run-make/wasm-abi/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-custom-section/Makefile b/tests/run-make/wasm-custom-section/Makefile
index 92b0802e3..2f7d38c27 100644
--- a/tests/run-make/wasm-custom-section/Makefile
+++ b/tests/run-make/wasm-custom-section/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-custom-sections-opt/Makefile b/tests/run-make/wasm-custom-sections-opt/Makefile
index e5b45d963..a0d437813 100644
--- a/tests/run-make/wasm-custom-sections-opt/Makefile
+++ b/tests/run-make/wasm-custom-sections-opt/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-export-all-symbols/Makefile b/tests/run-make/wasm-export-all-symbols/Makefile
index 834f4d258..86713bc80 100644
--- a/tests/run-make/wasm-export-all-symbols/Makefile
+++ b/tests/run-make/wasm-export-all-symbols/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-import-module/Makefile b/tests/run-make/wasm-import-module/Makefile
index 18cef16aa..a0b4d920b 100644
--- a/tests/run-make/wasm-import-module/Makefile
+++ b/tests/run-make/wasm-import-module/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-panic-small/Makefile b/tests/run-make/wasm-panic-small/Makefile
index 2af9f7135..16f545218 100644
--- a/tests/run-make/wasm-panic-small/Makefile
+++ b/tests/run-make/wasm-panic-small/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-spurious-import/Makefile b/tests/run-make/wasm-spurious-import/Makefile
index 6f50e6e55..ff9dfeac6 100644
--- a/tests/run-make/wasm-spurious-import/Makefile
+++ b/tests/run-make/wasm-spurious-import/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-stringify-ints-small/Makefile b/tests/run-make/wasm-stringify-ints-small/Makefile
index 2fa2c954d..f959dbd42 100644
--- a/tests/run-make/wasm-stringify-ints-small/Makefile
+++ b/tests/run-make/wasm-stringify-ints-small/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
all:
diff --git a/tests/run-make/wasm-symbols-different-module/Makefile b/tests/run-make/wasm-symbols-different-module/Makefile
index 9e657222d..0f86914c7 100644
--- a/tests/run-make/wasm-symbols-different-module/Makefile
+++ b/tests/run-make/wasm-symbols-different-module/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-symbols-not-exported/Makefile b/tests/run-make/wasm-symbols-not-exported/Makefile
index 60b0dee00..024ad7797 100644
--- a/tests/run-make/wasm-symbols-not-exported/Makefile
+++ b/tests/run-make/wasm-symbols-not-exported/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make/wasm-symbols-not-imported/Makefile b/tests/run-make/wasm-symbols-not-imported/Makefile
index dc7618c19..38440a8b0 100644
--- a/tests/run-make/wasm-symbols-not-imported/Makefile
+++ b/tests/run-make/wasm-symbols-not-imported/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
# only-wasm32-bare
diff --git a/tests/run-make-fulldeps/weird-output-filenames/Makefile b/tests/run-make/weird-output-filenames/Makefile
index d3a34e3b4..d3a34e3b4 100644
--- a/tests/run-make-fulldeps/weird-output-filenames/Makefile
+++ b/tests/run-make/weird-output-filenames/Makefile
diff --git a/tests/run-make-fulldeps/weird-output-filenames/foo.rs b/tests/run-make/weird-output-filenames/foo.rs
index f328e4d9d..f328e4d9d 100644
--- a/tests/run-make-fulldeps/weird-output-filenames/foo.rs
+++ b/tests/run-make/weird-output-filenames/foo.rs
diff --git a/tests/run-make-fulldeps/windows-binary-no-external-deps/Makefile b/tests/run-make/windows-binary-no-external-deps/Makefile
index 8960020fe..8960020fe 100644
--- a/tests/run-make-fulldeps/windows-binary-no-external-deps/Makefile
+++ b/tests/run-make/windows-binary-no-external-deps/Makefile
diff --git a/tests/run-make-fulldeps/windows-binary-no-external-deps/hello.rs b/tests/run-make/windows-binary-no-external-deps/hello.rs
index 47ad8c634..47ad8c634 100644
--- a/tests/run-make-fulldeps/windows-binary-no-external-deps/hello.rs
+++ b/tests/run-make/windows-binary-no-external-deps/hello.rs
diff --git a/tests/run-make-fulldeps/windows-spawn/Makefile b/tests/run-make/windows-spawn/Makefile
index b6cdb169b..b6cdb169b 100644
--- a/tests/run-make-fulldeps/windows-spawn/Makefile
+++ b/tests/run-make/windows-spawn/Makefile
diff --git a/tests/run-make-fulldeps/windows-spawn/hello.rs b/tests/run-make/windows-spawn/hello.rs
index 47ad8c634..47ad8c634 100644
--- a/tests/run-make-fulldeps/windows-spawn/hello.rs
+++ b/tests/run-make/windows-spawn/hello.rs
diff --git a/tests/run-make-fulldeps/windows-spawn/spawn.rs b/tests/run-make/windows-spawn/spawn.rs
index c34da3d5f..c34da3d5f 100644
--- a/tests/run-make-fulldeps/windows-spawn/spawn.rs
+++ b/tests/run-make/windows-spawn/spawn.rs
diff --git a/tests/run-make-fulldeps/windows-subsystem/Makefile b/tests/run-make/windows-subsystem/Makefile
index 78c4e2ac1..e3cf9181d 100644
--- a/tests/run-make-fulldeps/windows-subsystem/Makefile
+++ b/tests/run-make/windows-subsystem/Makefile
@@ -1,3 +1,4 @@
+# ignore-cross-compile
include ../tools.mk
all:
diff --git a/tests/run-make-fulldeps/windows-subsystem/console.rs b/tests/run-make/windows-subsystem/console.rs
index 61a92eb6a..61a92eb6a 100644
--- a/tests/run-make-fulldeps/windows-subsystem/console.rs
+++ b/tests/run-make/windows-subsystem/console.rs
diff --git a/tests/run-make-fulldeps/windows-subsystem/windows.rs b/tests/run-make/windows-subsystem/windows.rs
index 1138248f0..1138248f0 100644
--- a/tests/run-make-fulldeps/windows-subsystem/windows.rs
+++ b/tests/run-make/windows-subsystem/windows.rs
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
index 84dcd2393..3c88ec34f 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
@@ -1,4 +1,4 @@
-include ../../run-make-fulldeps/tools.mk
+include ../tools.mk
#only-x86_64-fortanix-unknown-sgx
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_asm.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_asm.checks
index e839c200b..d2e53bee0 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_asm.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_asm.checks
@@ -1,8 +1,7 @@
CHECK: cc_plus_one_asm
CHECK-NEXT: movl
CHECK-NEXT: lfence
-CHECK-NEXT: inc
-CHECK-NEXT: notq (%rsp)
-CHECK-NEXT: notq (%rsp)
+CHECK-NEXT: incl
+CHECK-NEXT: shlq $0x0, (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c_asm.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c_asm.checks
index d1fae3d49..0a3d1dced 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c_asm.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_c_asm.checks
@@ -6,7 +6,7 @@ CHECK: lfence
CHECK: lfence
CHECK-NEXT: incl
CHECK-NEXT: jmp
-CHECK-NEXT: shlq $0, (%rsp)
+CHECK-NEXT: shlq $0x0, (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq
CHECK: popq
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx_asm.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx_asm.checks
index e704bf417..0126cd8ee 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx_asm.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cc_plus_one_cxx_asm.checks
@@ -7,7 +7,7 @@ CHECK: lfence
CHECK: lfence
CHECK-NEXT: incl
CHECK-NEXT: jmp 0x{{[[:xdigit:]]+}} <cc_plus_one_cxx_asm+0x{{[[:xdigit:]]+}}>
-CHECK-NEXT: shlq $0, (%rsp)
+CHECK-NEXT: shlq $0x0, (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq
CHECK: popq
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_asm.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_asm.checks
index 78b18ccbf..615675488 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_asm.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_asm.checks
@@ -2,6 +2,6 @@ CHECK: cmake_plus_one_asm
CHECK-NEXT: movl
CHECK-NEXT: lfence
CHECK-NEXT: incl
-CHECK-NEXT: shlq $0, (%rsp)
+CHECK-NEXT: shlq $0x0, (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_asm.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_asm.checks
index 87c806f13..17312b912 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_asm.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_c_asm.checks
@@ -7,7 +7,7 @@ CHECK: movl
CHECK: lfence
CHECK-NEXT: incl
CHECK-NEXT: jmp 0x{{[[:xdigit:]]+}} <cmake_plus_one_c_asm+0x{{[[:xdigit:]]+}}>
-CHECK-NEXT: shlq $0, (%rsp)
+CHECK-NEXT: shlq $0x0, (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq
CHECK: popq
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_asm.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_asm.checks
index 9cac8711e..222e4ef79 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_asm.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_asm.checks
@@ -7,7 +7,7 @@ CHECK: movl
CHECK: lfence
CHECK-NEXT: incl
CHECK-NEXT: jmp 0x{{[[:xdigit:]]+}} <cmake_plus_one_cxx_asm+0x{{[[:xdigit:]]+}}>
-CHECK-NEXT: shlq $0, (%rsp)
+CHECK-NEXT: shlq $0x0, (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq
CHECK: popq
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks
index 15211e3ad..885bf461b 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks
@@ -1,8 +1,24 @@
-CHECK: libunwind::Registers_x86_64::jumpto
+CHECK: __libunwind_Registers_x86_64_jumpto
CHECK: lfence
CHECK: lfence
CHECK: lfence
CHECK: lfence
-CHECK: shlq $0, (%rsp)
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK: lfence
+CHECK-NEXT: popq [[REGISTER:%[a-z]+]]
+CHECK-NEXT: lfence
+CHECK-NEXT: popq [[REGISTER:%[a-z]+]]
CHECK-NEXT: lfence
-CHECK-NEXT: retq
+CHECK-NEXT: jmpq *[[REGISTER]]
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 0fe88141b..8a5493650 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
@@ -2,6 +2,5 @@ CHECK: print
CHECK: lfence
CHECK: lfence
CHECK: lfence
-CHECK: popq
CHECK: callq 0x{{[[:xdigit:]]*}} <_Unwind_Resume>
CHECK-NEXT: ud2
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 944343df6..235bb603b 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
@@ -20,39 +20,38 @@ function build {
}
function check {
- local func=$1
+ local func_re="$1"
local checks="${TEST_DIR}/$2"
local asm=$(mktemp)
- local objdump="${BUILD_DIR}/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-objdump"
- local filecheck="${BUILD_DIR}/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck"
-
- ${objdump} --disassemble-symbols=${func} --demangle \
- ${WORK_DIR}/enclave/target/x86_64-fortanix-unknown-sgx/debug/enclave > ${asm}
+ local objdump="${LLVM_BIN_DIR}/llvm-objdump"
+ local filecheck="${LLVM_BIN_DIR}/FileCheck"
+ local enclave=${WORK_DIR}/enclave/target/x86_64-fortanix-unknown-sgx/debug/enclave
+
+ func="$(${objdump} --syms --demangle ${enclave} | \
+ grep --only-matching -E "[[:blank:]]+${func_re}\$" | \
+ sed -e 's/^[[:space:]]*//' )"
+ ${objdump} --disassemble-symbols="${func}" --demangle \
+ ${enclave} > ${asm}
${filecheck} --input-file ${asm} ${checks}
}
build
-check unw_getcontext unw_getcontext.checks
-check "libunwind::Registers_x86_64::jumpto()" jumpto.checks
-check "std::io::stdio::_print::h87f0c238421c45bc" print.checks
-check rust_plus_one_global_asm rust_plus_one_global_asm.checks \
- || echo "warning: module level assembly currently not hardened"
+check "unw_getcontext" unw_getcontext.checks
+check "__libunwind_Registers_x86_64_jumpto" jumpto.checks
+check 'std::io::stdio::_print::[[:alnum:]]+' print.checks
+check rust_plus_one_global_asm rust_plus_one_global_asm.checks
check cc_plus_one_c cc_plus_one_c.checks
check cc_plus_one_c_asm cc_plus_one_c_asm.checks
check cc_plus_one_cxx cc_plus_one_cxx.checks
check cc_plus_one_cxx_asm cc_plus_one_cxx_asm.checks
-check cc_plus_one_asm cc_plus_one_asm.checks \
- || echo "warning: the cc crate forwards assembly files to the CC compiler." \
- "Clang uses its own integrated assembler, which does not include the LVI passes."
+check cc_plus_one_asm cc_plus_one_asm.checks
check cmake_plus_one_c cmake_plus_one_c.checks
check cmake_plus_one_c_asm cmake_plus_one_c_asm.checks
-check cmake_plus_one_c_global_asm cmake_plus_one_c_global_asm.checks \
- || echo "warning: module level assembly currently not hardened"
+check cmake_plus_one_c_global_asm cmake_plus_one_c_global_asm.checks
check cmake_plus_one_cxx cmake_plus_one_cxx.checks
check cmake_plus_one_cxx_asm cmake_plus_one_cxx_asm.checks
-check cmake_plus_one_cxx_global_asm cmake_plus_one_cxx_global_asm.checks \
- || echo "warning: module level assembly currently not hardened"
+check cmake_plus_one_cxx_global_asm cmake_plus_one_cxx_global_asm.checks
check cmake_plus_one_asm cmake_plus_one_asm.checks
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks
index 4b7615b11..b46cf7583 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks
@@ -1,6 +1,6 @@
CHECK: unw_getcontext
CHECK: lfence
CHECK: lfence
-CHECK: shlq $0, (%rsp)
+CHECK: shlq $0x0, (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq
diff --git a/tests/rustdoc-gui/anchor-navigable.goml b/tests/rustdoc-gui/anchor-navigable.goml
index 9d5c55a1e..61d7c89d4 100644
--- a/tests/rustdoc-gui/anchor-navigable.goml
+++ b/tests/rustdoc-gui/anchor-navigable.goml
@@ -4,7 +4,7 @@
// anchor and the `impl Foo`. If there were a gap, this would cause an annoying
// problem: you hover `impl Foo` to see the anchor, then when you move your
// mouse to the left, the anchor disappears before you reach it.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// We check that ".item-info" is bigger than its content.
move-cursor-to: ".impl"
assert-property: (".impl > a.anchor", {"offsetWidth": "8"})
diff --git a/tests/rustdoc-gui/anchors.goml b/tests/rustdoc-gui/anchors.goml
index 85cb72274..0904aa90e 100644
--- a/tests/rustdoc-gui/anchors.goml
+++ b/tests/rustdoc-gui/anchors.goml
@@ -4,12 +4,12 @@ define-function: (
"check-colors",
(theme, main_color, title_color, main_heading_color, main_heading_type_color, src_link_color, sidebar_link_color),
block {
- goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
+ go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
// This is needed to ensure that the text color is computed.
show-text: true
// Setting the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
@@ -48,9 +48,9 @@ define-function: (
{"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|},
)
- goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
// Since we changed page, we need to set the theme again.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
diff --git a/tests/rustdoc-gui/auto-hide-trait-implementations.goml b/tests/rustdoc-gui/auto-hide-trait-implementations.goml
deleted file mode 100644
index 0a619c352..000000000
--- a/tests/rustdoc-gui/auto-hide-trait-implementations.goml
+++ /dev/null
@@ -1,13 +0,0 @@
-// Checks that the setting "auto hide trait implementations" is working as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
-
-// By default, the trait implementations are not collapsed.
-assert-attribute: ("#trait-implementations-list > details", {"open": ""}, ALL)
-
-// We now set the setting to auto hide all trait implementations.
-local-storage: {"rustdoc-auto-hide-trait-implementations": "true" }
-// We reload to ensure the trait implementations are collapsed as expected.
-reload:
-
-// We now check that all matching elements don't have the open attributes.
-assert-attribute-false: ("#trait-implementations-list > details", {"open": ""}, ALL)
diff --git a/tests/rustdoc-gui/basic-code.goml b/tests/rustdoc-gui/basic-code.goml
index 971c2f948..e372f7119 100644
--- a/tests/rustdoc-gui/basic-code.goml
+++ b/tests/rustdoc-gui/basic-code.goml
@@ -1,6 +1,6 @@
// Small test to ensure the "src-line-numbers" element is only present once on
// the page.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
click: ".srclink"
wait-for: ".src-line-numbers"
assert-count: (".src-line-numbers", 1)
diff --git a/tests/rustdoc-gui/check-code-blocks-margin.goml b/tests/rustdoc-gui/check-code-blocks-margin.goml
index c2cec0020..8c2cbc4d9 100644
--- a/tests/rustdoc-gui/check-code-blocks-margin.goml
+++ b/tests/rustdoc-gui/check-code-blocks-margin.goml
@@ -1,5 +1,5 @@
// This test ensures that the docblock elements have the appropriate left margin.
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
// The top docblock elements shouldn't have left margin...
assert-css: ("#main-content .item-decl", {"margin-left": "0px"})
// ... but all the others should!
diff --git a/tests/rustdoc-gui/check-stab-in-docblock.goml b/tests/rustdoc-gui/check-stab-in-docblock.goml
index 266fa9997..2f6263621 100644
--- a/tests/rustdoc-gui/check-stab-in-docblock.goml
+++ b/tests/rustdoc-gui/check-stab-in-docblock.goml
@@ -1,9 +1,9 @@
// This test checks that using `.stab` attributes in `.docblock` elements doesn't
// create scrollable paragraphs.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Needs the text to be display to check for scrollable content.
show-text: true
-size: (786, 600)
+set-window-size: (786, 600)
// Confirms that there 3 paragraphs.
assert-count: (".top-doc .docblock p", 3)
// Checking that there is no scrollable content.
diff --git a/tests/rustdoc-gui/check_info_sign_position.goml b/tests/rustdoc-gui/check_info_sign_position.goml
index f36e73fc5..c9a4ea94c 100644
--- a/tests/rustdoc-gui/check_info_sign_position.goml
+++ b/tests/rustdoc-gui/check_info_sign_position.goml
@@ -1,7 +1,7 @@
// This test checks the position of the information on the code blocks (like
// `compile_fail` or `ignore`).
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
-goto: "./fn.check_list_code_block.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "./fn.check_list_code_block.html"
// If the codeblock is the first element of the docblock, the information tooltip must have
// have some top margin to avoid going over the toggle (the "[+]").
assert-css: (".docblock > .example-wrap.compile_fail .tooltip", { "margin-top": "16px" })
diff --git a/tests/rustdoc-gui/code-blocks-overflow.goml b/tests/rustdoc-gui/code-blocks-overflow.goml
index fbf0e890b..a23136f4b 100644
--- a/tests/rustdoc-gui/code-blocks-overflow.goml
+++ b/tests/rustdoc-gui/code-blocks-overflow.goml
@@ -1,6 +1,6 @@
// This test ensures that codeblocks content don't overflow.
-goto: "file://" + |DOC_PATH| + "/lib2/sub_mod/struct.Foo.html"
-size: (1080, 600)
+go-to: "file://" + |DOC_PATH| + "/lib2/sub_mod/struct.Foo.html"
+set-window-size: (1080, 600)
// There should be two codeblocks: a rust one and a non-rust one.
assert-count: (".docblock > .example-wrap", 2)
assert: ".docblock > .example-wrap > .language-txt"
diff --git a/tests/rustdoc-gui/code-color.goml b/tests/rustdoc-gui/code-color.goml
index cb550a457..833fa05db 100644
--- a/tests/rustdoc-gui/code-color.goml
+++ b/tests/rustdoc-gui/code-color.goml
@@ -2,7 +2,7 @@
// check that the rule isn't applied on other "<code>" elements.
//
// While we're at it, we also check it for the other themes.
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
// If the text isn't displayed, the browser doesn't compute color style correctly...
show-text: true
@@ -11,7 +11,7 @@ define-function: (
(theme, doc_code_color, doc_inline_code_color),
block {
// Set the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
assert-css: (".docblock pre > code", {"color": |doc_code_color|}, ALL)
diff --git a/tests/rustdoc-gui/code-sidebar-toggle.goml b/tests/rustdoc-gui/code-sidebar-toggle.goml
index df665bd46..28c3712f3 100644
--- a/tests/rustdoc-gui/code-sidebar-toggle.goml
+++ b/tests/rustdoc-gui/code-sidebar-toggle.goml
@@ -1,7 +1,7 @@
// This test checks that the source code pages sidebar toggle is working as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
click: ".srclink"
wait-for: "#src-sidebar-toggle"
click: "#src-sidebar-toggle"
-fail: true
+expect-failure: true
assert-css: ("#source-sidebar", { "left": "-300px" })
diff --git a/tests/rustdoc-gui/code-tags.goml b/tests/rustdoc-gui/code-tags.goml
index ca337cbc3..3405d3295 100644
--- a/tests/rustdoc-gui/code-tags.goml
+++ b/tests/rustdoc-gui/code-tags.goml
@@ -3,22 +3,22 @@
// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
// doesn't exist.
fail-on-request-error: false
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
-size: (1080, 600)
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+set-window-size: (1080, 600)
// There should be four doc codeblocks.
// Check that their content is inside <pre><code>
assert-count: (".example-wrap pre > code", 4)
// Check that function signature is inside <pre><code>
assert: "pre.rust.item-decl > code"
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert: "pre.rust.item-decl > code"
-goto: "file://" + |DOC_PATH| + "/test_docs/enum.AnEnum.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/enum.AnEnum.html"
assert: "pre.rust.item-decl > code"
-goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
assert: "pre.rust.item-decl > code"
-goto: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
assert: "pre.rust.item-decl > code"
diff --git a/tests/rustdoc-gui/codeblock-sub.goml b/tests/rustdoc-gui/codeblock-sub.goml
index cbd314d27..03575cc6a 100644
--- a/tests/rustdoc-gui/codeblock-sub.goml
+++ b/tests/rustdoc-gui/codeblock-sub.goml
@@ -1,5 +1,5 @@
// Test that code blocks nested within <sub> do not have a line height of 0.
-goto: "file://" + |DOC_PATH| + "/test_docs/codeblock_sub/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/codeblock_sub/index.html"
store-property: (codeblock_sub_1, "#codeblock-sub-1", "offsetHeight")
assert-property-false: ("#codeblock-sub-3", { "offsetHeight": |codeblock_sub_1| })
diff --git a/tests/rustdoc-gui/codeblock-tooltip.goml b/tests/rustdoc-gui/codeblock-tooltip.goml
index 36b67073a..2ed0579d3 100644
--- a/tests/rustdoc-gui/codeblock-tooltip.goml
+++ b/tests/rustdoc-gui/codeblock-tooltip.goml
@@ -1,5 +1,5 @@
// Checking the colors of the codeblocks tooltips.
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
show-text: true
define-function: (
@@ -7,7 +7,7 @@ define-function: (
(theme, background, color, border),
block {
// Setting the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
// compile_fail block
diff --git a/tests/rustdoc-gui/cursor.goml b/tests/rustdoc-gui/cursor.goml
index 59b139797..f318b05ce 100644
--- a/tests/rustdoc-gui/cursor.goml
+++ b/tests/rustdoc-gui/cursor.goml
@@ -1,5 +1,5 @@
// This test ensures that several clickable items actually have the pointer cursor.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
// the `[+]/[-]` button
assert-css: ("#toggle-all-docs", {"cursor": "pointer"})
@@ -16,9 +16,9 @@ wait-for: "#search-tabs"
assert-css: ("#search-tabs > button", {"cursor": "pointer"})
// mobile sidebar toggle button
-size: (500, 700)
+set-window-size: (500, 700)
assert-css: (".sidebar-menu-toggle", {"cursor": "pointer"})
// the sidebar toggle button on the source code pages
-goto: "file://" + |DOC_PATH| + "/src/lib2/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/lib2/lib.rs.html"
assert-css: ("#src-sidebar-toggle > button", {"cursor": "pointer"})
diff --git a/tests/rustdoc-gui/default-settings.goml b/tests/rustdoc-gui/default-settings.goml
index ab27b001e..3466f3693 100644
--- a/tests/rustdoc-gui/default-settings.goml
+++ b/tests/rustdoc-gui/default-settings.goml
@@ -2,7 +2,7 @@
//
// The "settings" crate uses "ayu" as default setting, which is what we will
// check.
-goto: "file://" + |DOC_PATH| + "/settings/index.html"
+go-to: "file://" + |DOC_PATH| + "/settings/index.html"
// Wait a bit to be sure the default theme is applied.
// If the theme isn't applied, the command will time out.
wait-for-css: ("body", {"background-color": "rgb(15, 20, 25)"})
diff --git a/tests/rustdoc-gui/docblock-big-code-mobile.goml b/tests/rustdoc-gui/docblock-big-code-mobile.goml
index 3ce921c2c..6fc683476 100644
--- a/tests/rustdoc-gui/docblock-big-code-mobile.goml
+++ b/tests/rustdoc-gui/docblock-big-code-mobile.goml
@@ -1,7 +1,7 @@
// If we have a long `<code>`, we need to ensure that it'll be fully displayed on mobile, meaning
// that it'll be on two lines.
emulate: "iPhone 8" // it has the following size: (375, 667)
-goto: "file://" + |DOC_PATH| + "/test_docs/long_code_block/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/long_code_block/index.html"
// We now check that the block is on two lines:
show-text: true // We need to enable text draw to be able to have the "real" size
// Little explanations for this test: if the text wasn't displayed on two lines, it would take
@@ -9,5 +9,5 @@ show-text: true // We need to enable text draw to be able to have the "real" siz
assert-property: (".docblock p > code", {"offsetHeight": "44"})
// Same check, but where the long code block is also a link
-goto: "file://" + |DOC_PATH| + "/test_docs/long_code_block_link/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/long_code_block_link/index.html"
assert-property: (".docblock p > a > code", {"offsetHeight": "44"})
diff --git a/tests/rustdoc-gui/docblock-code-block-line-number.goml b/tests/rustdoc-gui/docblock-code-block-line-number.goml
index 69bcf5339..4c36394a3 100644
--- a/tests/rustdoc-gui/docblock-code-block-line-number.goml
+++ b/tests/rustdoc-gui/docblock-code-block-line-number.goml
@@ -1,5 +1,5 @@
// Checks that the setting "line numbers" is working as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
// Otherwise, we can't check text color
show-text: true
@@ -13,7 +13,7 @@ define-function: (
(theme, color),
block {
// We now set the setting to show the line numbers on code examples.
- local-storage: {
+ set-local-storage: {
"rustdoc-theme": |theme|,
"rustdoc-use-system-theme": "false",
"rustdoc-line-numbers": "true"
diff --git a/tests/rustdoc-gui/docblock-details.goml b/tests/rustdoc-gui/docblock-details.goml
index 9ae571efb..58ff17619 100644
--- a/tests/rustdoc-gui/docblock-details.goml
+++ b/tests/rustdoc-gui/docblock-details.goml
@@ -1,7 +1,7 @@
// This ensures that the `<details>`/`<summary>` elements are displayed as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/details/struct.Details.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/details/struct.Details.html"
show-text: true
-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
+set-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
reload:
// We first check that the headers in the `.top-doc` doc block still have their
diff --git a/tests/rustdoc-gui/docblock-table-overflow.goml b/tests/rustdoc-gui/docblock-table-overflow.goml
index d8670089a..1ca919d1e 100644
--- a/tests/rustdoc-gui/docblock-table-overflow.goml
+++ b/tests/rustdoc-gui/docblock-table-overflow.goml
@@ -1,7 +1,7 @@
// This test ensures that the type declaration content overflow is handled inside the <pre> directly.
-goto: "file://" + |DOC_PATH| + "/lib2/long_table/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/long_table/struct.Foo.html"
// We set a fixed size so there is no chance of "random" resize.
-size: (1100, 800)
+set-window-size: (1100, 800)
// Logically, the ".docblock" and the "<p>" should have the same scroll width.
compare-elements-property: (".top-doc .docblock", ".top-doc .docblock > p", ["scrollWidth"])
assert-property: (".top-doc .docblock", {"scrollWidth": "816"})
diff --git a/tests/rustdoc-gui/docblock-table.goml b/tests/rustdoc-gui/docblock-table.goml
index 3dcb8abd4..011451ef4 100644
--- a/tests/rustdoc-gui/docblock-table.goml
+++ b/tests/rustdoc-gui/docblock-table.goml
@@ -1,5 +1,5 @@
// This test checks the appearance of the tables in the doc comments.
-goto: "file://" + |DOC_PATH| + "/test_docs/doc_block_table/struct.DocBlockTable.html#method.func"
+go-to: "file://" + |DOC_PATH| + "/test_docs/doc_block_table/struct.DocBlockTable.html#method.func"
compare-elements-css: (".impl-items .docblock table th", ".top-doc .docblock table th", ["border"])
compare-elements-css: (".impl-items .docblock table td", ".top-doc .docblock table td", ["border"])
@@ -8,7 +8,7 @@ define-function: (
"check-colors",
(theme, border_color, zebra_stripe_color),
block {
- local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
+ set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
reload:
assert-css: (".top-doc .docblock table tbody tr:nth-child(1)", {
"background-color": "rgba(0, 0, 0, 0)",
diff --git a/tests/rustdoc-gui/duplicate-macro-reexport.goml b/tests/rustdoc-gui/duplicate-macro-reexport.goml
index 496203c12..7d01c88f3 100644
--- a/tests/rustdoc-gui/duplicate-macro-reexport.goml
+++ b/tests/rustdoc-gui/duplicate-macro-reexport.goml
@@ -1,5 +1,5 @@
// This test ensures that there is no macro duplicates in the sidebar.
-goto: "file://" + |DOC_PATH| + "/test_docs/macro.a.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/macro.a.html"
// Waiting for the elements in the sidebar to be rendered.
wait-for: ".sidebar-elems .macro"
// Check there is only one macro named "a" listed in the sidebar.
diff --git a/tests/rustdoc-gui/enum-variants.goml b/tests/rustdoc-gui/enum-variants.goml
index 8dfc49285..a1f60986a 100644
--- a/tests/rustdoc-gui/enum-variants.goml
+++ b/tests/rustdoc-gui/enum-variants.goml
@@ -1,5 +1,5 @@
// Verifies that there is non-zero margin on variants and their docblocks.
-goto: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/enum.WhoLetTheDogOut.html"
assert-css: (".variants > .variant", {"margin": "0px 0px 12px"})
assert-css: (".variants > .docblock", {"margin": "0px 0px 32px 24px"})
diff --git a/tests/rustdoc-gui/escape-key.goml b/tests/rustdoc-gui/escape-key.goml
index 5d80d2496..3ea20fd11 100644
--- a/tests/rustdoc-gui/escape-key.goml
+++ b/tests/rustdoc-gui/escape-key.goml
@@ -1,6 +1,6 @@
// This test ensures that the "Escape" shortcut is handled correctly based on the
// current content displayed.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// First, we check that the search results are hidden when the Escape key is pressed.
write: (".search-input", "test")
// To be SURE that the search will be run.
diff --git a/tests/rustdoc-gui/extend-css.goml b/tests/rustdoc-gui/extend-css.goml
new file mode 100644
index 000000000..fb34469df
--- /dev/null
+++ b/tests/rustdoc-gui/extend-css.goml
@@ -0,0 +1,5 @@
+// Test to ensure that the `--extend-css` option is working as expected.
+go-to: "file://" + |DOC_PATH| + "/extend_css/index.html"
+show-text: true
+// The text from the `.extend` element should be red.
+assert-css: (".extend", {"color": "rgb(255, 0, 0)"})
diff --git a/tests/rustdoc-gui/font-weight.goml b/tests/rustdoc-gui/font-weight.goml
index aad334d2b..6fad128da 100644
--- a/tests/rustdoc-gui/font-weight.goml
+++ b/tests/rustdoc-gui/font-weight.goml
@@ -1,5 +1,5 @@
// This test checks that the font weight is correctly applied.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
assert-css: ("//*[@class='rust item-decl']//a[text()='Alias']", {"font-weight": "400"})
assert-css: (
"//*[@class='structfield small-section-header']//a[text()='Alias']",
@@ -9,13 +9,13 @@ assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"})
assert-css: ("#associatedtype\.X > .code-header", {"font-weight": "600"})
assert-css: ("#associatedconstant\.Y > .code-header", {"font-weight": "600"})
-goto: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
assert-css: (".top-doc .docblock p", {"font-weight": "400"}, ALL)
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-css: (".impl-items .method > .code-header", {"font-weight": "600"}, ALL)
-goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
// This is a complex selector, so here's how it works:
//
diff --git a/tests/rustdoc-gui/go-to-collapsed-elem.goml b/tests/rustdoc-gui/go-to-collapsed-elem.goml
new file mode 100644
index 000000000..80e979177
--- /dev/null
+++ b/tests/rustdoc-gui/go-to-collapsed-elem.goml
@@ -0,0 +1,40 @@
+// This test ensures that when clicking on a link which leads to an item inside a collapsed element,
+// the collapsed element will be expanded.
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+// We check that the implementors block is expanded.
+assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
+// We now collapse the implementors block.
+set-property: ("#implementations-list .implementors-toggle", {"open": "false"})
+// And now we click on the link to the method to ensure it'll expand the implementors block.
+click: "//*[@class='sidebar']//a[@href='#method.must_use']"
+assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
+
+define-function: ("collapsed-from-search", (), block {
+ // Now we do the same through search result.
+ // First we reload the page without the anchor in the URL.
+ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+ // Then we collapse the section again...
+ set-property: ("#implementations-list .implementors-toggle", {"open": "false"})
+ // Then we run the search.
+ write: (".search-input", "foo::must_use")
+ wait-for: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"
+ click: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"
+ assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
+})
+
+call-function: ("collapsed-from-search", {})
+
+// Now running the same check but with mobile.
+set-window-size: (600, 600)
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+// We check that the implementors block is expanded.
+assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
+// We now collapse the implementors block.
+set-property: ("#implementations-list .implementors-toggle", {"open": "false"})
+// First we expand the mobile menu.
+click: ".sidebar-menu-toggle"
+// Then we click on the link to the method to ensure it'll expand the implementors block.
+click: "//*[@class='sidebar shown']//a[@href='#method.must_use']"
+assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
+
+call-function: ("collapsed-from-search", {})
diff --git a/tests/rustdoc-gui/hash-item-expansion.goml b/tests/rustdoc-gui/hash-item-expansion.goml
index 3cf94f624..a7a5c3cb4 100644
--- a/tests/rustdoc-gui/hash-item-expansion.goml
+++ b/tests/rustdoc-gui/hash-item-expansion.goml
@@ -1,5 +1,5 @@
// This test ensures that the element corresponding to the hash is displayed.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.borrow"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.borrow"
// In the blanket implementations list, "Borrow" is the second one, hence the ":nth(2)".
assert-attribute: ("#blanket-implementations-list > details:nth-child(2)", {"open": ""})
// We first check that the impl block is open by default.
diff --git a/tests/rustdoc-gui/headers-color.goml b/tests/rustdoc-gui/headers-color.goml
index 92cf050a5..7d83833a8 100644
--- a/tests/rustdoc-gui/headers-color.goml
+++ b/tests/rustdoc-gui/headers-color.goml
@@ -4,10 +4,10 @@ define-function: (
"check-colors",
(theme, color, code_header_color, focus_background_color, headings_color),
block {
- goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// This is needed so that the text color is computed.
show-text: true
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: (
".impl",
@@ -19,20 +19,20 @@ define-function: (
{"color": |code_header_color|, "background-color": "rgba(0, 0, 0, 0)"},
ALL,
)
- goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
assert-css: (
"#impl-Foo",
{"color": |color|, "background-color": |focus_background_color|},
)
- goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
assert-css: (
"#method\.must_use",
{"color": |color|, "background-color": |focus_background_color|},
ALL,
)
- goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-css: (".small-section-header a", {"color": |color|}, ALL)
- goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
// We select headings (h2, h3, h...).
assert-css: (".docblock > :not(p) > a", {"color": |headings_color|}, ALL)
},
diff --git a/tests/rustdoc-gui/headings.goml b/tests/rustdoc-gui/headings.goml
index e4ba5f124..089e2203a 100644
--- a/tests/rustdoc-gui/headings.goml
+++ b/tests/rustdoc-gui/headings.goml
@@ -11,7 +11,7 @@
// 18px 1.125em
// 16px 1rem
// 14px 0.875rem
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
assert-css: (".main-heading h1", {"font-size": "24px"})
@@ -50,7 +50,7 @@ assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"font-size": "14px"})
assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"border-bottom-width": "0px"})
assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "14px"})
-goto: "file://" + |DOC_PATH| + "/test_docs/enum.HeavilyDocumentedEnum.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/enum.HeavilyDocumentedEnum.html"
assert-css: (".main-heading h1", {"font-size": "24px"})
@@ -109,7 +109,7 @@ assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"border-bottom-width"
assert-text: ("//ul[@class='block mod']/preceding-sibling::h3", "Modules")
assert-css: ("//ul[@class='block mod']/preceding-sibling::h3", {"border-bottom-width": "0px"}, ALL)
-goto: "file://" + |DOC_PATH| + "/test_docs/union.HeavilyDocumentedUnion.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/union.HeavilyDocumentedUnion.html"
assert-css: (".main-heading h1", {"font-size": "24px"})
@@ -141,7 +141,7 @@ assert-css: ("h5#title-for-union-impl-item-doc", {"border-bottom-width": "0px"})
assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"font-size": "14px"})
assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"border-bottom-width": "0px"})
-goto: "file://" + |DOC_PATH| + "/test_docs/macro.heavily_documented_macro.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/macro.heavily_documented_macro.html"
assert-css: (".main-heading h1", {"font-size": "24px"})
@@ -152,13 +152,13 @@ assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
// Needed to check colors
show-text: true
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
define-function: (
"check-colors",
(theme, heading_color, small_heading_color, heading_border_color),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: (
".top-doc .docblock h2",
@@ -222,13 +222,13 @@ define-function: (
"check-since-color",
(theme),
block {
- local-storage: {"rustdoc-theme": |theme|}
+ set-local-storage: {"rustdoc-theme": |theme|}
reload:
assert-css: (".since", {"color": "rgb(128, 128, 128)"}, ALL)
},
)
-goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
call-function: ("check-since-color", ("ayu"))
call-function: ("check-since-color", ("dark"))
call-function: ("check-since-color", ("light"))
diff --git a/tests/rustdoc-gui/help-page.goml b/tests/rustdoc-gui/help-page.goml
index 6e2321a69..1a1c1b28f 100644
--- a/tests/rustdoc-gui/help-page.goml
+++ b/tests/rustdoc-gui/help-page.goml
@@ -1,6 +1,6 @@
// This test ensures that opening the help page in its own tab works.
-goto: "file://" + |DOC_PATH| + "/help.html"
-size: (1000, 1000) // Try desktop size first.
+go-to: "file://" + |DOC_PATH| + "/help.html"
+set-window-size: (1000, 1000) // Try desktop size first.
wait-for: "#help"
assert-css: ("#help", {"display": "block"})
assert-css: ("#help dd", {"font-size": "16px"})
@@ -8,7 +8,7 @@ click: "#help-button > a"
assert-css: ("#help", {"display": "block"})
compare-elements-property: (".sub", "#help", ["offsetWidth"])
compare-elements-position: (".sub", "#help", ("x"))
-size: (500, 1000) // Try mobile next.
+set-window-size: (500, 1000) // Try mobile next.
assert-css: ("#help", {"display": "block"})
compare-elements-property: (".sub", "#help", ["offsetWidth"])
compare-elements-position: (".sub", "#help", ("x"))
@@ -20,7 +20,7 @@ define-function: (
(theme, color, background, box_shadow),
block {
// Setting the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
assert-css: ("#help kbd", {
@@ -51,8 +51,8 @@ call-function: ("check-colors", {
})
// This test ensures that opening the help popover without switching pages works.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
-size: (1000, 1000) // Only supported on desktop.
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+set-window-size: (1000, 1000) // Only supported on desktop.
assert-false: "#help"
click: "#help-button > a"
assert-css: ("#help", {"display": "block"})
@@ -63,8 +63,8 @@ compare-elements-property-false: (".sub", "#help", ["offsetWidth"])
compare-elements-position-false: (".sub", "#help", ("x"))
// This test ensures that the "the rustdoc book" anchor link within the help popover works.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
-size: (1000, 1000) // Popover only appears when the screen width is >700px.
+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/']"
diff --git a/tests/rustdoc-gui/highlight-colors.goml b/tests/rustdoc-gui/highlight-colors.goml
index b182150a5..4f5e1c110 100644
--- a/tests/rustdoc-gui/highlight-colors.goml
+++ b/tests/rustdoc-gui/highlight-colors.goml
@@ -1,5 +1,5 @@
// This test checks the highlight colors in the source code pages.
-goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
show-text: true
define-function: (
@@ -22,7 +22,7 @@ define-function: (
doc_comment,
),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: ("pre.rust .kw", {"color": |kw|}, ALL)
assert-css: ("pre.rust .kw-2", {"color": |kw2|}, ALL)
diff --git a/tests/rustdoc-gui/huge-collection-of-constants.goml b/tests/rustdoc-gui/huge-collection-of-constants.goml
index 636382a91..387aca6f6 100644
--- a/tests/rustdoc-gui/huge-collection-of-constants.goml
+++ b/tests/rustdoc-gui/huge-collection-of-constants.goml
@@ -1,6 +1,6 @@
// Make sure that the last two entries are more than 12 pixels apart and not stacked on each other.
-goto: "file://" + |DOC_PATH| + "/test_docs/huge_amount_of_consts/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/huge_amount_of_consts/index.html"
compare-elements-position-near-false: (
"//ul[@class='item-table']/li[last()-1]",
diff --git a/tests/rustdoc-gui/huge-logo.goml b/tests/rustdoc-gui/huge-logo.goml
index 01f06771c..6d3eb6606 100644
--- a/tests/rustdoc-gui/huge-logo.goml
+++ b/tests/rustdoc-gui/huge-logo.goml
@@ -1,21 +1,23 @@
// huge_logo crate has a custom 712x860 logo
// test to ensure the maximum size in the layout works correctly
-goto: "file://" + |DOC_PATH| + "/huge_logo/index.html"
+go-to: "file://" + |DOC_PATH| + "/huge_logo/index.html"
-size: (1280, 1024)
+set-window-size: (1280, 1024)
// offsetWidth = width of sidebar
assert-property: (".sidebar .logo-container", {"offsetWidth": "200", "offsetHeight": 100})
assert-property: (".sidebar .logo-container img", {"offsetWidth": "100", "offsetHeight": 100})
-size: (400, 600)
+set-window-size: (400, 600)
// offset = size + margin
assert-property: (".mobile-topbar .logo-container", {"offsetWidth": "55", "offsetHeight": 45})
assert-property: (".mobile-topbar .logo-container img", {"offsetWidth": "35", "offsetHeight": 35})
-goto: "file://" + |DOC_PATH| + "/src/huge_logo/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/huge_logo/lib.rs.html"
-size: (1280, 1024)
+set-window-size: (1280, 1024)
assert-property: (".sub-logo-container", {"offsetWidth": "60", "offsetHeight": 60})
-size: (400, 600)
-assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 35})
+set-window-size: (400, 600)
+// 43 because 35px + 8px of margin
+assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"})
+assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 43})
diff --git a/tests/rustdoc-gui/impl-default-expansion.goml b/tests/rustdoc-gui/impl-default-expansion.goml
index c3f9240cc..45bd7beb6 100644
--- a/tests/rustdoc-gui/impl-default-expansion.goml
+++ b/tests/rustdoc-gui/impl-default-expansion.goml
@@ -1,3 +1,3 @@
// This test ensures that the impl blocks are open by default.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-attribute: ("#implementations-list details.implementors-toggle", {"open": ""})
diff --git a/tests/rustdoc-gui/impl-doc.goml b/tests/rustdoc-gui/impl-doc.goml
index 6caffb9c3..4ec46de40 100644
--- a/tests/rustdoc-gui/impl-doc.goml
+++ b/tests/rustdoc-gui/impl-doc.goml
@@ -1,5 +1,5 @@
// A docblock on an impl must have a margin to separate it from the contents.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithImplDoc.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithImplDoc.html"
// The text is about 24px tall, so if there's a margin, then their position will be >24px apart
compare-elements-position-near-false: (
diff --git a/tests/rustdoc-gui/implementors.goml b/tests/rustdoc-gui/implementors.goml
index 997c0ed8f..b39b95c1a 100644
--- a/tests/rustdoc-gui/implementors.goml
+++ b/tests/rustdoc-gui/implementors.goml
@@ -1,6 +1,6 @@
// The goal of this test is to check that the external trait implementors, generated with JS,
// have the same display than the "local" ones.
-goto: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html"
+go-to: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html"
assert: "#implementors-list"
// There are supposed to be two implementors listed.
assert-count: ("#implementors-list .impl", 2)
@@ -15,7 +15,7 @@ assert-attribute: ("#implementors-list .impl:nth-child(2)", {"id": "impl-Whateve
assert-attribute: ("#implementors-list .impl:nth-child(2) > a.anchor", {"href": "#impl-Whatever-1"})
assert: "#implementors-list .impl:nth-child(2) > .code-header"
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.HasEmptyTraits.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HasEmptyTraits.html"
compare-elements-position-near-false: (
"#impl-EmptyTrait1-for-HasEmptyTraits",
"#impl-EmptyTrait2-for-HasEmptyTraits",
@@ -29,13 +29,13 @@ compare-elements-position-near: (
// Now check that re-exports work correctly.
// There should be exactly one impl shown on both of these pages.
-goto: "file://" + |DOC_PATH| + "/lib2/trait.TraitToReexport.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/trait.TraitToReexport.html"
assert-count: ("#implementors-list .impl", 1)
-goto: "file://" + |DOC_PATH| + "/implementors/trait.TraitToReexport.html"
+go-to: "file://" + |DOC_PATH| + "/implementors/trait.TraitToReexport.html"
assert-count: ("#implementors-list .impl", 1)
// Now check that the link is properly rewritten for a crate called `http`.
// An older version of rustdoc had a buggy check for absolute links.
-goto: "file://" + |DOC_PATH| + "/http/trait.HttpTrait.html"
+go-to: "file://" + |DOC_PATH| + "/http/trait.HttpTrait.html"
assert-count: ("#implementors-list .impl", 1)
assert-attribute: ("#implementors-list .impl a.trait", {"href": "../http/trait.HttpTrait.html"})
diff --git a/tests/rustdoc-gui/item-decl-colors.goml b/tests/rustdoc-gui/item-decl-colors.goml
index c58e3eb7c..5732dd8ee 100644
--- a/tests/rustdoc-gui/item-decl-colors.goml
+++ b/tests/rustdoc-gui/item-decl-colors.goml
@@ -18,9 +18,9 @@ define-function: (
assoc_type_color,
),
block {
- goto: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"
show-text: true
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: (".item-decl .code-attribute", {"color": |attr_color|}, ALL)
assert-css: (".item-decl .trait", {"color": |trait_color|}, ALL)
@@ -29,7 +29,7 @@ define-function: (
assert-css: (".item-decl .enum", {"color": |enum_color|}, ALL)
assert-css: (".item-decl .primitive", {"color": |primitive_color|}, ALL)
- goto: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html"
assert-css: (".item-decl .constant", {"color": |constant_color|}, ALL)
assert-css: (".item-decl .fn", {"color": |fn_color|}, ALL)
assert-css: (".item-decl .associatedtype", {"color": |assoc_type_color|}, ALL)
diff --git a/tests/rustdoc-gui/item-info-alignment.goml b/tests/rustdoc-gui/item-info-alignment.goml
index 94b52f005..6fc365d1f 100644
--- a/tests/rustdoc-gui/item-info-alignment.goml
+++ b/tests/rustdoc-gui/item-info-alignment.goml
@@ -1,10 +1,10 @@
// This test ensures that the "item-info" looks about the same
// whether or not it's inside a toggle.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.ItemInfoAlignmentTest.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.ItemInfoAlignmentTest.html"
// First, we try it in "desktop" mode.
-size: (1200, 870)
+set-window-size: (1200, 870)
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
// Next, we try it in "mobile" mode (max-width: 700px).
-size: (650, 650)
+set-window-size: (650, 650)
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
diff --git a/tests/rustdoc-gui/item-info-overflow.goml b/tests/rustdoc-gui/item-info-overflow.goml
index 8ea14621c..23c53c037 100644
--- a/tests/rustdoc-gui/item-info-overflow.goml
+++ b/tests/rustdoc-gui/item-info-overflow.goml
@@ -1,7 +1,7 @@
// This test ensures that the "item-info" elements don't overflow.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo.html"
// We set a fixed size so there is no chance of "random" resize.
-size: (1200, 870)
+set-window-size: (1200, 870)
// Logically, the "item-decl" and the "item-info" should have the same scroll width.
compare-elements-property: (".item-decl", ".item-info", ["scrollWidth"])
assert-property: (".item-info", {"scrollWidth": "940"})
@@ -13,7 +13,7 @@ assert-text: (
)
// Checking the "item-info" on an impl block as well:
-goto: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo2.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo2.html"
compare-elements-property: (
"#impl-SimpleTrait-for-LongItemInfo2 .item-info",
"#impl-SimpleTrait-for-LongItemInfo2 + .docblock",
diff --git a/tests/rustdoc-gui/item-info.goml b/tests/rustdoc-gui/item-info.goml
index 6780dfca6..60fd7c4e1 100644
--- a/tests/rustdoc-gui/item-info.goml
+++ b/tests/rustdoc-gui/item-info.goml
@@ -1,15 +1,15 @@
// This test ensures a few things for item info elements.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
// Ensuring that the item information don't take 100% of the width if unnecessary.
// We set a fixed size so there is no chance of "random" resize.
-size: (1100, 800)
+set-window-size: (1100, 800)
// We check that ".item-info" is bigger than its content.
assert-css: (".item-info", {"width": "840px"})
assert-css: (".item-info .stab", {"width": "289px"})
assert-position: (".item-info .stab", {"x": 245})
// Now we ensure that they're not rendered on the same line.
-goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
// We first ensure that there are two item info on the trait.
assert-count: ("#main-content > .item-info .stab", 2)
// They should not have the same `y` position!
diff --git a/tests/rustdoc-gui/item-summary-table.goml b/tests/rustdoc-gui/item-summary-table.goml
index 7a219bd54..893060303 100644
--- a/tests/rustdoc-gui/item-summary-table.goml
+++ b/tests/rustdoc-gui/item-summary-table.goml
@@ -1,5 +1,5 @@
// This test ensures that <table> elements aren't display in items summary.
-goto: "file://" + |DOC_PATH| + "/lib2/summary_table/index.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/summary_table/index.html"
// We check that we picked the right item first.
assert-text: (".item-table .item-name", "Foo")
// Then we check that its summary is empty.
diff --git a/tests/rustdoc-gui/javascript-disabled.goml b/tests/rustdoc-gui/javascript-disabled.goml
index edf179d0d..a0872d553 100644
--- a/tests/rustdoc-gui/javascript-disabled.goml
+++ b/tests/rustdoc-gui/javascript-disabled.goml
@@ -2,5 +2,5 @@
// can't be used without JS.
javascript: false
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-css: (".sub", {"display": "none"})
diff --git a/tests/rustdoc-gui/jump-to-def-background.goml b/tests/rustdoc-gui/jump-to-def-background.goml
index 8ee3ccf4a..3a7d48284 100644
--- a/tests/rustdoc-gui/jump-to-def-background.goml
+++ b/tests/rustdoc-gui/jump-to-def-background.goml
@@ -1,12 +1,12 @@
// We check the background color on the jump to definition links in the source code page.
-goto: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
define-function: (
"check-background-color",
(theme, background_color),
block {
// Set the theme.
- local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }
+ set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }
// We reload the page so the local storage settings are being used.
reload:
assert-css: (
diff --git a/tests/rustdoc-gui/label-next-to-symbol.goml b/tests/rustdoc-gui/label-next-to-symbol.goml
index 412e475dc..6c6380256 100644
--- a/tests/rustdoc-gui/label-next-to-symbol.goml
+++ b/tests/rustdoc-gui/label-next-to-symbol.goml
@@ -1,9 +1,9 @@
// These tests verify that labels like "UNIX" and "Deprecated" stay on the same line as their symbol.
// It also verifies the staggered layout on mobile.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Desktop view
-size: (1080, 600)
+set-window-size: (1080, 600)
assert: (".stab.deprecated")
assert: (".stab.portability")
@@ -39,7 +39,7 @@ compare-elements-position: (
// Mobile view
-size: (600, 600)
+set-window-size: (600, 600)
// staggered layout with 2em spacing
assert-css: (".desc.docblock-short", { "padding-left": "32px" })
compare-elements-position-near: (
diff --git a/tests/rustdoc-gui/links-color.goml b/tests/rustdoc-gui/links-color.goml
index 14f7d9935..2ee4bce10 100644
--- a/tests/rustdoc-gui/links-color.goml
+++ b/tests/rustdoc-gui/links-color.goml
@@ -1,5 +1,5 @@
// This test checks links colors.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// This is needed so that the text color is computed.
show-text: true
@@ -9,7 +9,7 @@ define-function: (
(theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
sidebar, sidebar_current, sidebar_current_background),
block {
- local-storage: {
+ set-local-storage: {
"rustdoc-theme": |theme|,
"rustdoc-use-system-theme": "false",
}
diff --git a/tests/rustdoc-gui/list_code_block.goml b/tests/rustdoc-gui/list_code_block.goml
index 4c477d70c..25ddea319 100644
--- a/tests/rustdoc-gui/list_code_block.goml
+++ b/tests/rustdoc-gui/list_code_block.goml
@@ -1,4 +1,4 @@
// This test checks that code blocks in list are supported.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
-goto: "./fn.check_list_code_block.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "./fn.check_list_code_block.html"
assert: ("pre.rust.item-decl")
diff --git a/tests/rustdoc-gui/method-margins.goml b/tests/rustdoc-gui/method-margins.goml
index 720268a9e..ac3caeb23 100644
--- a/tests/rustdoc-gui/method-margins.goml
+++ b/tests/rustdoc-gui/method-margins.goml
@@ -1,5 +1,5 @@
// This test ensures that the margins on methods are coherent inside an impl block.
-goto: "file://" + |DOC_PATH| + "/test_docs/trait_members/struct.HasTrait.html#impl-TraitMembers-for-HasTrait"
+go-to: "file://" + |DOC_PATH| + "/test_docs/trait_members/struct.HasTrait.html#impl-TraitMembers-for-HasTrait"
assert-count: ("#trait-implementations-list > .toggle", 1)
diff --git a/tests/rustdoc-gui/mobile.goml b/tests/rustdoc-gui/mobile.goml
index 8c8516ebf..e576385cd 100644
--- a/tests/rustdoc-gui/mobile.goml
+++ b/tests/rustdoc-gui/mobile.goml
@@ -1,8 +1,8 @@
// Test various properties of the mobile UI
-goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
-size: (400, 600)
+go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
+set-window-size: (400, 600)
-font-size: 18
+set-font-size: 18
wait-for: 100 // wait a bit for the resize and the font-size change to be fully taken into account.
// The out-of-band info (source, stable version, collapse) should be below the
@@ -18,14 +18,14 @@ assert-property: (".mobile-topbar h2", {"offsetHeight": 33})
// is therefore not part of the DOM.
assert-css: (".content .out-of-band .since::before", { "content": "\"Since \"" })
-size: (1000, 1000)
+set-window-size: (1000, 1000)
wait-for: 100 // wait a bit for the resize to be fully taken into account.
assert-css-false: (".content .out-of-band .since::before", { "content": "\"Since \"" })
// On the settings page, the theme buttons should not line-wrap. Instead, they should
// all be placed as a group on a line below the setting name "Theme."
-goto: "file://" + |DOC_PATH| + "/settings.html"
-size: (400, 600)
+go-to: "file://" + |DOC_PATH| + "/settings.html"
+set-window-size: (400, 600)
// Ignored for now https://github.com/rust-lang/rust/issues/93784.
// compare-elements-position-near-false: (
// "#preferred-light-theme .setting-radio-name",
diff --git a/tests/rustdoc-gui/module-items-font.goml b/tests/rustdoc-gui/module-items-font.goml
index 23823f8b6..54c8131c3 100644
--- a/tests/rustdoc-gui/module-items-font.goml
+++ b/tests/rustdoc-gui/module-items-font.goml
@@ -1,5 +1,5 @@
// This test checks that the correct font is used on module items (in index.html pages).
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-css: (
".item-table .item-name > a",
{"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},
diff --git a/tests/rustdoc-gui/no-docblock.goml b/tests/rustdoc-gui/no-docblock.goml
index 17a955064..1b4638ef0 100644
--- a/tests/rustdoc-gui/no-docblock.goml
+++ b/tests/rustdoc-gui/no-docblock.goml
@@ -4,10 +4,10 @@
// doesn't exist.
fail-on-request-error: false
-goto: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithNoDocblocks.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithNoDocblocks.html"
// Check that the two methods are more than 24px apart.
compare-elements-position-near-false: ("//*[@id='tymethod.first_fn']", "//*[@id='tymethod.second_fn']", {"y": 24})
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithNoDocblocks.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.TypeWithNoDocblocks.html"
// Check that the two methods are more than 24px apart.
compare-elements-position-near-false: ("//*[@id='method.first_fn']", "//*[@id='method.second_fn']", {"y": 24})
diff --git a/tests/rustdoc-gui/notable-trait.goml b/tests/rustdoc-gui/notable-trait.goml
index 207289151..f65da5774 100644
--- a/tests/rustdoc-gui/notable-trait.goml
+++ b/tests/rustdoc-gui/notable-trait.goml
@@ -1,8 +1,8 @@
// This test checks the position of the `i` for the notable traits.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
show-text: true
// We start with a wide screen.
-size: (1100, 600)
+set-window-size: (1100, 600)
// Checking they have the same y position.
compare-elements-position: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
@@ -44,7 +44,7 @@ move-cursor-to: "//h1"
assert-count: ("//*[@class='tooltip popover']", 0)
// Now only the `i` should be on the next line.
-size: (1055, 600)
+set-window-size: (1055, 600)
compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
@@ -52,7 +52,7 @@ compare-elements-position-false: (
)
// Now both the `i` and the struct name should be on the next line.
-size: (980, 600)
+set-window-size: (980, 600)
// Checking they have the same y position.
compare-elements-position: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
@@ -76,7 +76,7 @@ assert-position: (
)
// Checking on mobile now.
-size: (650, 600)
+set-window-size: (650, 600)
// Checking they have the same y position.
compare-elements-position: (
"//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
@@ -124,12 +124,12 @@ define-function: (
"check-colors",
(theme, header_color, content_color, type_color, trait_color),
block {
- goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
// This is needed to ensure that the text color is computed.
show-text: true
// Setting the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
@@ -253,7 +253,7 @@ press-key: "Escape"
assert-window-property-false: {"scrollY": |scroll|}
// Opening the mobile sidebar should close the popover.
-size: (650, 600)
+set-window-size: (650, 600)
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
assert-count: ("//*[@class='tooltip popover']", 1)
click: ".sidebar-menu-toggle"
@@ -266,7 +266,7 @@ assert-count: ("//*[@class='tooltip popover']", 1)
assert-false: "//*[@class='sidebar shown']"
// Also check the focus handling for the help button.
-size: (1100, 600)
+set-window-size: (1100, 600)
reload:
assert-count: ("//*[@class='tooltip popover']", 0)
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
diff --git a/tests/rustdoc-gui/overflow-tooltip-information.goml b/tests/rustdoc-gui/overflow-tooltip-information.goml
index 09ad6cdd7..ab7ffc24c 100644
--- a/tests/rustdoc-gui/overflow-tooltip-information.goml
+++ b/tests/rustdoc-gui/overflow-tooltip-information.goml
@@ -1,7 +1,7 @@
// The goal of this test is to ensure that the tooltip `.information` class doesn't
// have overflow and max-width CSS rules set because they create a bug in firefox on
// mac. For more information: https://github.com/rust-lang/rust/issues/89185
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
assert-css: (".docblock > .example-wrap .tooltip", {
"overflow-x": "visible",
"max-width": "none"
diff --git a/tests/rustdoc-gui/pocket-menu.goml b/tests/rustdoc-gui/pocket-menu.goml
index c3649dc7b..4bdf31ecb 100644
--- a/tests/rustdoc-gui/pocket-menu.goml
+++ b/tests/rustdoc-gui/pocket-menu.goml
@@ -1,5 +1,5 @@
// This test ensures that the "pocket menus" are working as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// First we check that the help menu doesn't exist yet.
assert-false: "#help-button .popover"
// Then we display the help menu.
@@ -32,7 +32,7 @@ assert-css: ("#settings-menu .popover", {"display": "none"})
// We check the borders color now:
// Ayu theme
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "ayu",
"rustdoc-use-system-theme": "false",
}
@@ -47,7 +47,7 @@ compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-co
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
// Dark theme
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "dark",
"rustdoc-use-system-theme": "false",
}
@@ -62,7 +62,7 @@ compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-co
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
// Light theme
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "light",
"rustdoc-use-system-theme": "false",
}
@@ -77,7 +77,7 @@ compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-co
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
// Opening the mobile sidebar should close the settings popover.
-size: (650, 600)
+set-window-size: (650, 600)
click: "#settings-menu a"
assert-css: ("#settings-menu .popover", {"display": "block"})
click: ".sidebar-menu-toggle"
diff --git a/tests/rustdoc-gui/run-on-hover.goml b/tests/rustdoc-gui/run-on-hover.goml
index 8dcb62c10..b5fc49eac 100644
--- a/tests/rustdoc-gui/run-on-hover.goml
+++ b/tests/rustdoc-gui/run-on-hover.goml
@@ -2,14 +2,14 @@
// Playground. That button is hidden until the user hovers over the code block.
// This test checks that it is hidden, and that it shows on hover. It also
// checks for its color.
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
show-text: true
define-function: (
"check-run-button",
(theme, color, background, hover_color, hover_background),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: (".test-arrow", {"visibility": "hidden"})
move-cursor-to: ".example-wrap"
diff --git a/tests/rustdoc-gui/rust-logo.goml b/tests/rustdoc-gui/rust-logo.goml
index 2d15e8b96..640ed152b 100644
--- a/tests/rustdoc-gui/rust-logo.goml
+++ b/tests/rustdoc-gui/rust-logo.goml
@@ -1,26 +1,26 @@
// This test ensures that the correct style is applied to the rust logo in the sidebar.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
define-function: (
"check-logo",
(theme, filter),
block {
// Going to the doc page.
- goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Changing theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: (".rust-logo", {"filter": |filter|})
// Going to the source code page.
- goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+ go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
// Changing theme (since it's local files, the local storage works by folder).
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: (".rust-logo", {"filter": |filter|})
// Now we check that the non-rust logos don't have a CSS filter set.
- goto: "file://" + |DOC_PATH| + "/huge_logo/index.html"
+ go-to: "file://" + |DOC_PATH| + "/huge_logo/index.html"
// Changing theme on the new page (again...).
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
// Check there is no rust logo
assert-false: ".rust-logo"
diff --git a/tests/rustdoc-gui/scrape-examples-button-focus.goml b/tests/rustdoc-gui/scrape-examples-button-focus.goml
index 1b5c3a0d2..77061ea2a 100644
--- a/tests/rustdoc-gui/scrape-examples-button-focus.goml
+++ b/tests/rustdoc-gui/scrape-examples-button-focus.goml
@@ -1,6 +1,6 @@
// This test ensures that the scraped examples buttons are working as expecting
// when 'Enter' key is pressed when they're focused.
-goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
+go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
// The next/prev buttons vertically scroll the code viewport between examples
store-property: (initialScrollTop, ".scraped-example-list > .scraped-example pre", "scrollTop")
@@ -8,24 +8,24 @@ focus: ".scraped-example-list > .scraped-example .next"
press-key: "Enter"
assert-property-false: (".scraped-example-list > .scraped-example pre", {
"scrollTop": |initialScrollTop|
-})
+}, NEAR)
focus: ".scraped-example-list > .scraped-example .prev"
press-key: "Enter"
assert-property: (".scraped-example-list > .scraped-example pre", {
"scrollTop": |initialScrollTop|
-})
+}, NEAR)
// The expand button increases the scrollHeight of the minimized code viewport
store-property: (smallOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight")
assert-property-false: (".scraped-example-list > .scraped-example pre", {
"scrollHeight": |smallOffsetHeight|
-})
+}, NEAR)
focus: ".scraped-example-list > .scraped-example .expand"
press-key: "Enter"
assert-property-false: (".scraped-example-list > .scraped-example pre", {
"offsetHeight": |smallOffsetHeight|
-})
+}, NEAR)
store-property: (fullOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight")
assert-property: (".scraped-example-list > .scraped-example pre", {
"scrollHeight": |fullOffsetHeight|
-})
+}, NEAR)
diff --git a/tests/rustdoc-gui/scrape-examples-color.goml b/tests/rustdoc-gui/scrape-examples-color.goml
index 67c58826e..8ddb06fcc 100644
--- a/tests/rustdoc-gui/scrape-examples-color.goml
+++ b/tests/rustdoc-gui/scrape-examples-color.goml
@@ -1,5 +1,5 @@
// Check that scrape example code blocks have the expected colors.
-goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
+go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
show-text: true
define-function: (
@@ -7,7 +7,7 @@ define-function: (
(theme, highlight, highlight_focus, help_border, help_color, help_hover_border,
help_hover_color),
block {
- local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }
+ set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }
reload:
wait-for: ".more-examples-toggle"
assert-css: (".scraped-example .example-wrap .rust span.highlight:not(.focus)", {
@@ -60,13 +60,13 @@ call-function: ("check-colors", {
})
// Now testing the top and bottom background in case there is only one scraped examples.
-goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
+go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
define-function: (
"check-background",
(theme, background_color_start, background_color_end),
block {
- local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }
+ set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }
reload:
assert-css: (".scraped-example:not(.expanded) .code-wrapper::before", {
"background-image": "linear-gradient(" + |background_color_start| + ", " +
diff --git a/tests/rustdoc-gui/scrape-examples-fonts.goml b/tests/rustdoc-gui/scrape-examples-fonts.goml
index 142f337cb..4c325bace 100644
--- a/tests/rustdoc-gui/scrape-examples-fonts.goml
+++ b/tests/rustdoc-gui/scrape-examples-fonts.goml
@@ -1,5 +1,5 @@
// This test ensures that the correct font is used in scraped examples.
-goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
+go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
store-value: (font, '"Fira Sans", Arial, NanumBarunGothic, sans-serif')
diff --git a/tests/rustdoc-gui/scrape-examples-layout.goml b/tests/rustdoc-gui/scrape-examples-layout.goml
index dad727c77..160056d6d 100644
--- a/tests/rustdoc-gui/scrape-examples-layout.goml
+++ b/tests/rustdoc-gui/scrape-examples-layout.goml
@@ -1,5 +1,5 @@
// Check that the line number column has the correct layout.
-goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
+go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
// Check that it's not zero.
assert-property-false: (
@@ -44,6 +44,6 @@ assert-position: (".scraped-example .code-wrapper", {"y": 253})
assert-position: (".scraped-example .code-wrapper .prev", {"y": 253 + |offset_y|})
// Then with mobile
-size: (600, 600)
+set-window-size: (600, 600)
assert-position: (".scraped-example .code-wrapper", {"y": 308})
assert-position: (".scraped-example .code-wrapper .prev", {"y": 308 + |offset_y|})
diff --git a/tests/rustdoc-gui/scrape-examples-toggle.goml b/tests/rustdoc-gui/scrape-examples-toggle.goml
index 2d5df6a5d..9cec6d2bb 100644
--- a/tests/rustdoc-gui/scrape-examples-toggle.goml
+++ b/tests/rustdoc-gui/scrape-examples-toggle.goml
@@ -1,5 +1,5 @@
// This tests checks that the "scraped examples" toggle is working as expected.
-goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
+go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
// Checking the color of the toggle line.
show-text: true
@@ -7,7 +7,7 @@ define-function: (
"check-color",
(theme, toggle_line_color, toggle_line_hover_color),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
// Clicking "More examples..." will open additional examples
diff --git a/tests/rustdoc-gui/search-error.goml b/tests/rustdoc-gui/search-error.goml
index 2a10a647b..d21905e90 100644
--- a/tests/rustdoc-gui/search-error.goml
+++ b/tests/rustdoc-gui/search-error.goml
@@ -1,5 +1,5 @@
// Checks that the crate search filtering is handled correctly and changes the results.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=sa'%3Bda'%3Bds"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=sa'%3Bda'%3Bds"
show-text: true
define-function: (
@@ -7,7 +7,7 @@ define-function: (
(theme, error_background),
block {
// Setting the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
diff --git a/tests/rustdoc-gui/search-filter.goml b/tests/rustdoc-gui/search-filter.goml
index 5bc6e87d6..d739471a6 100644
--- a/tests/rustdoc-gui/search-filter.goml
+++ b/tests/rustdoc-gui/search-filter.goml
@@ -1,5 +1,5 @@
// Checks that the crate search filtering is handled correctly and changes the results.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true
write: (".search-input", "test")
// To be SURE that the search will be run.
@@ -16,6 +16,7 @@ press-key: "ArrowDown"
press-key: "ArrowDown"
press-key: "ArrowDown"
press-key: "ArrowDown"
+press-key: "ArrowDown"
press-key: "Enter"
// Waiting for the search results to appear...
wait-for: "#search-tabs"
@@ -41,13 +42,14 @@ press-key: "ArrowUp"
press-key: "ArrowUp"
press-key: "ArrowUp"
press-key: "ArrowUp"
+press-key: "ArrowUp"
press-key: "Enter"
// Waiting for the search results to appear...
wait-for: "#search-tabs"
assert-property: ("#crate-search", {"value": "all crates"})
// Checking that the URL parameter is taken into account for crate filtering.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=test&filter-crate=lib2"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=test&filter-crate=lib2"
wait-for: "#crate-search"
assert-property: ("#crate-search", {"value": "lib2"})
assert-false: "#results .externcrate"
@@ -57,10 +59,10 @@ assert-text: (".search-results-title", "Results in all crates", STARTS_WITH)
// Checking the display of the crate filter.
// We start with the light theme.
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
+set-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
reload:
-timeout: 2000
+set-timeout: 2000
wait-for: "#crate-search"
assert-css: ("#crate-search", {
"border": "1px solid rgb(224, 224, 224)",
diff --git a/tests/rustdoc-gui/search-form-elements.goml b/tests/rustdoc-gui/search-form-elements.goml
index 542db348c..83c698090 100644
--- a/tests/rustdoc-gui/search-form-elements.goml
+++ b/tests/rustdoc-gui/search-form-elements.goml
@@ -1,9 +1,9 @@
// This test ensures that the elements in ".search-form" have the expected display.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true
// Ayu theme
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "ayu",
"rustdoc-use-system-theme": "false",
}
@@ -89,7 +89,7 @@ assert-css: (
)
// Dark theme
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "dark",
"rustdoc-use-system-theme": "false",
}
@@ -176,7 +176,7 @@ assert-css: (
)
// Light theme
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "light",
"rustdoc-use-system-theme": "false",
}
diff --git a/tests/rustdoc-gui/search-input-mobile.goml b/tests/rustdoc-gui/search-input-mobile.goml
index ce0cef77c..adcb3658a 100644
--- a/tests/rustdoc-gui/search-input-mobile.goml
+++ b/tests/rustdoc-gui/search-input-mobile.goml
@@ -1,11 +1,11 @@
// Test to ensure that you can click on the search input, whatever the width.
// The PR which fixed it is: https://github.com/rust-lang/rust/pull/81592
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
-size: (463, 700)
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+set-window-size: (463, 700)
// We first check that the search input isn't already focused.
assert-false: ("input.search-input:focus")
click: "input.search-input"
reload:
-size: (750, 700)
+set-window-size: (750, 700)
click: "input.search-input"
assert: ("input.search-input:focus")
diff --git a/tests/rustdoc-gui/search-keyboard.goml b/tests/rustdoc-gui/search-keyboard.goml
index ed975664c..f1d802461 100644
--- a/tests/rustdoc-gui/search-keyboard.goml
+++ b/tests/rustdoc-gui/search-keyboard.goml
@@ -1,6 +1,6 @@
// Checks that the search tab results work correctly with function signature syntax
// First, try a search-by-name
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "Foo")
// To be SURE that the search will be run.
press-key: 'Enter'
diff --git a/tests/rustdoc-gui/search-no-result.goml b/tests/rustdoc-gui/search-no-result.goml
index b76a44fa9..46d1856b4 100644
--- a/tests/rustdoc-gui/search-no-result.goml
+++ b/tests/rustdoc-gui/search-no-result.goml
@@ -1,5 +1,5 @@
// The goal of this test is to check the color of the "no result" links.
-goto: "file://" + |DOC_PATH| + "/lib2/index.html?search=sdkfskjfsdks"
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=sdkfskjfsdks"
show-text: true
define-function: (
@@ -7,7 +7,7 @@ define-function: (
(theme, link, link_hover),
block {
// Changing theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
wait-for: "#results"
assert: ".search-failed.active"
diff --git a/tests/rustdoc-gui/search-reexport.goml b/tests/rustdoc-gui/search-reexport.goml
index dd19f03bd..fd817b589 100644
--- a/tests/rustdoc-gui/search-reexport.goml
+++ b/tests/rustdoc-gui/search-reexport.goml
@@ -1,7 +1,7 @@
// Checks that the reexports are present in the search index, can have
// doc aliases and are highligted when their ID is the hash of the page.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+set-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
reload:
// First we check that the reexport has the correct ID and no background color.
assert-text: ("//*[@id='reexport.TheStdReexport']", "pub use ::std as TheStdReexport;")
diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index d6d54ec4b..da46a90df 100644
--- a/tests/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -31,13 +31,13 @@ define-function: (
},
)
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
// This is needed so that the text color is computed.
show-text: true
// Ayu theme
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "ayu",
"rustdoc-use-system-theme": "false",
}
@@ -154,7 +154,7 @@ assert-css: (
)
// Dark theme
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "dark",
"rustdoc-use-system-theme": "false",
}
@@ -259,7 +259,7 @@ assert-css: (
)
// Light theme
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
+set-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
reload:
// Waiting for the search results to appear...
@@ -361,7 +361,7 @@ assert-css: (
)
// Check the alias.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// If the text isn't displayed, the browser doesn't compute color style correctly...
show-text: true
@@ -369,7 +369,7 @@ define-function: (
"check-alias",
(theme, alias, grey),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
write: (".search-input", "thisisanalias")
// To be SURE that the search will be run.
diff --git a/tests/rustdoc-gui/search-result-description.goml b/tests/rustdoc-gui/search-result-description.goml
index 9fa210804..745ef31e6 100644
--- a/tests/rustdoc-gui/search-result-description.goml
+++ b/tests/rustdoc-gui/search-result-description.goml
@@ -1,5 +1,5 @@
// This test is to ensure that the codeblocks are correctly rendered in the search results.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=some_more_function"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=some_more_function"
// Waiting for the search results to appear...
wait-for: "#search-tabs"
assert-text: (".search-results .desc code", "format!")
diff --git a/tests/rustdoc-gui/search-result-display.goml b/tests/rustdoc-gui/search-result-display.goml
index 20a88c36e..93c71f23f 100644
--- a/tests/rustdoc-gui/search-result-display.goml
+++ b/tests/rustdoc-gui/search-result-display.goml
@@ -1,6 +1,6 @@
// Checks that the search results have the expected width.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
-size: (900, 1000)
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+set-window-size: (900, 1000)
write: (".search-input", "test")
// To be SURE that the search will be run.
press-key: 'Enter'
@@ -8,7 +8,7 @@ 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"})
-size: (600, 100)
+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"})
@@ -18,7 +18,7 @@ assert-css: (".search-results .result-name > span", {"display": "inline"})
// 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>`.
-size: (900, 900)
+set-window-size: (900, 900)
// First we check the current width, height and position.
assert-css: ("#crate-search", {"width": "223px"})
@@ -26,7 +26,7 @@ assert-css: (".search-results-title", {"height": "50px", "width": "640px"})
assert-css: ("#search", {"width": "640px"})
// Then we update the text of one of the `<option>`.
-text: (
+set-text: (
"#crate-search option",
"sdjfaksdjfaksjdbfkadsbfkjsadbfkdsbkfbsadkjfbkdsabfkadsfkjdsafa",
)
@@ -43,7 +43,7 @@ define-function: (
"check-filter",
(theme, border, filter, hover_border, hover_filter),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
wait-for: "#crate-search"
assert-css: ("#crate-search", {"border": "1px solid " + |border|})
diff --git a/tests/rustdoc-gui/search-result-go-to-first.goml b/tests/rustdoc-gui/search-result-go-to-first.goml
index f444baa6c..a0bc2bb16 100644
--- a/tests/rustdoc-gui/search-result-go-to-first.goml
+++ b/tests/rustdoc-gui/search-result-go-to-first.goml
@@ -2,11 +2,11 @@
// First, we check that the first page doesn't have the string we're looking for to ensure
// that the feature is changing page as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-text-false: (".main-heading h1", "Struct test_docs::Foo")
// We now check that we land on the search result page if "go_to_first" isn't set.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=struct%3AFoo"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=struct%3AFoo"
// Waiting for the search results to appear...
wait-for: "#search-tabs"
assert-text-false: (".main-heading h1", "Struct test_docs::Foo")
@@ -14,6 +14,6 @@ assert-text-false: (".main-heading h1", "Struct test_docs::Foo")
assert-css: ("#main-content", {"display": "none"})
// Now we can check that the feature is working as expected!
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=struct%3AFoo&go_to_first=true"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=struct%3AFoo&go_to_first=true"
// Waiting for the page to load...
wait-for-text: (".main-heading h1", "Struct test_docs::Foo")
diff --git a/tests/rustdoc-gui/search-result-keyword.goml b/tests/rustdoc-gui/search-result-keyword.goml
index 8c3577d9f..5d56e9d9c 100644
--- a/tests/rustdoc-gui/search-result-keyword.goml
+++ b/tests/rustdoc-gui/search-result-keyword.goml
@@ -1,5 +1,5 @@
// Checks that the "keyword" results have the expected text alongside them.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "CookieMonster")
// To be SURE that the search will be run.
press-key: 'Enter'
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 1433dc4d7..b3f9ae928 100644
--- a/tests/rustdoc-gui/search-tab-change-title-fn-sig.goml
+++ b/tests/rustdoc-gui/search-tab-change-title-fn-sig.goml
@@ -1,6 +1,6 @@
// Checks that the search tab results work correctly with function signature syntax
// First, try a search-by-name
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "Foo")
// To be SURE that the search will be run.
press-key: 'Enter'
@@ -22,7 +22,7 @@ press-key: "ArrowLeft"
wait-for-attribute: ("#search-tabs > button:nth-of-type(3)", {"class": "selected"})
// Now try search-by-return
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "-> String")
// To be SURE that the search will be run.
press-key: 'Enter'
@@ -44,7 +44,7 @@ press-key: "ArrowLeft"
wait-for-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"})
// Try with a search-by-return with no results
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "-> Something")
// To be SURE that the search will be run.
press-key: 'Enter'
@@ -54,7 +54,7 @@ assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}
assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Return Types", STARTS_WITH)
// Try with a search-by-parameter
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "usize pattern")
// To be SURE that the search will be run.
press-key: 'Enter'
@@ -64,7 +64,7 @@ assert-attribute: ("#search-tabs > button:nth-of-type(1)", {"class": "selected"}
assert-text: ("#search-tabs > button:nth-of-type(1)", "In Function Parameters", STARTS_WITH)
// Try with a search-by-parameter-and-return
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
write: (".search-input", "pattern -> str")
// To be SURE that the search will be run.
press-key: 'Enter'
diff --git a/tests/rustdoc-gui/search-tab.goml b/tests/rustdoc-gui/search-tab.goml
index 36958f700..2223598f0 100644
--- a/tests/rustdoc-gui/search-tab.goml
+++ b/tests/rustdoc-gui/search-tab.goml
@@ -1,5 +1,5 @@
// Checking the colors of the search tab headers.
-goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html?search=something"
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html?search=something"
show-text: true
define-function: (
@@ -9,7 +9,7 @@ define-function: (
border_top_hover),
block {
// Setting the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
// These two commands are used to be sure the search will be run.
diff --git a/tests/rustdoc-gui/setting-auto-hide-content-large-items.goml b/tests/rustdoc-gui/setting-auto-hide-content-large-items.goml
new file mode 100644
index 000000000..6cd725043
--- /dev/null
+++ b/tests/rustdoc-gui/setting-auto-hide-content-large-items.goml
@@ -0,0 +1,51 @@
+// This test ensures that the "Auto-hide item contents for large items" setting is working as
+// expected.
+
+// We need to disable this check because `implementors/test_docs/trait.Iterator.js` doesn't exist.
+fail-on-request-error: false
+
+define-function: (
+ "check-setting",
+ (storage_value, setting_attribute_value, toggle_attribute_value),
+ block {
+ assert-local-storage: {"rustdoc-auto-hide-large-items": |storage_value|}
+ click: "#settings-menu"
+ wait-for: "#settings"
+ assert-property: ("#auto-hide-large-items", {"checked": |setting_attribute_value|})
+ assert-attribute: (".item-decl .type-contents-toggle", {"open": |toggle_attribute_value|})
+ }
+)
+
+go-to: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.Iterator.html"
+
+// We check that the setting is enabled by default and is working.
+call-function: ("check-setting", {
+ "storage_value": null,
+ "setting_attribute_value": "true",
+ "toggle_attribute_value": null,
+})
+
+// Now we change its value.
+click: "#auto-hide-large-items"
+assert-local-storage: {"rustdoc-auto-hide-large-items": "false"}
+
+// We check that the changes were applied as expected.
+reload:
+
+call-function: ("check-setting", {
+ "storage_value": "false",
+ "setting_attribute_value": "false",
+ "toggle_attribute_value": "",
+})
+
+// And now we re-enable the setting.
+click: "#auto-hide-large-items"
+assert-local-storage: {"rustdoc-auto-hide-large-items": "true"}
+
+// And we check everything is back the way it was before.
+reload:
+call-function: ("check-setting", {
+ "storage_value": "true",
+ "setting_attribute_value": "true",
+ "toggle_attribute_value": null,
+})
diff --git a/tests/rustdoc-gui/setting-auto-hide-item-methods-docs.goml b/tests/rustdoc-gui/setting-auto-hide-item-methods-docs.goml
new file mode 100644
index 000000000..5210ad8f7
--- /dev/null
+++ b/tests/rustdoc-gui/setting-auto-hide-item-methods-docs.goml
@@ -0,0 +1,48 @@
+// This test ensures that the "Auto-hide item methods' documentation" setting is working as
+// expected.
+
+define-function: (
+ "check-setting",
+ (storage_value, setting_attribute_value, toggle_attribute_value),
+ block {
+ assert-local-storage: {"rustdoc-auto-hide-method-docs": |storage_value|}
+ click: "#settings-menu"
+ wait-for: "#settings"
+ assert-property: ("#auto-hide-method-docs", {"checked": |setting_attribute_value|})
+ assert-attribute: (".toggle.method-toggle", {"open": |toggle_attribute_value|})
+ }
+)
+
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
+
+// We check that the setting is disabled by default.
+call-function: ("check-setting", {
+ "storage_value": null,
+ "setting_attribute_value": "false",
+ "toggle_attribute_value": "",
+})
+
+// Now we change its value.
+click: "#auto-hide-method-docs"
+assert-local-storage: {"rustdoc-auto-hide-method-docs": "true"}
+
+// We check that the changes were applied as expected.
+reload:
+
+call-function: ("check-setting", {
+ "storage_value": "true",
+ "setting_attribute_value": "true",
+ "toggle_attribute_value": null,
+})
+
+// And now we re-disable the setting.
+click: "#auto-hide-method-docs"
+assert-local-storage: {"rustdoc-auto-hide-method-docs": "false"}
+
+// And we check everything is back the way it was before.
+reload:
+call-function: ("check-setting", {
+ "storage_value": "false",
+ "setting_attribute_value": "false",
+ "toggle_attribute_value": "",
+})
diff --git a/tests/rustdoc-gui/setting-auto-hide-trait-implementations.goml b/tests/rustdoc-gui/setting-auto-hide-trait-implementations.goml
new file mode 100644
index 000000000..ecadd8fa8
--- /dev/null
+++ b/tests/rustdoc-gui/setting-auto-hide-trait-implementations.goml
@@ -0,0 +1,47 @@
+// Checks that the setting "auto hide trait implementations" is working as expected.
+
+define-function: (
+ "check-setting",
+ (storage_value, setting_attribute_value, toggle_attribute_value),
+ block {
+ assert-local-storage: {"rustdoc-auto-hide-trait-implementations": |storage_value|}
+ click: "#settings-menu"
+ wait-for: "#settings"
+ assert-property: ("#auto-hide-trait-implementations", {"checked": |setting_attribute_value|})
+ assert-attribute: ("#trait-implementations-list > details", {"open": |toggle_attribute_value|}, ALL)
+ }
+)
+
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+
+// By default, the trait implementations are not collapsed.
+call-function: ("check-setting", {
+ "storage_value": null,
+ "setting_attribute_value": "false",
+ "toggle_attribute_value": "",
+})
+
+// Now we change its value.
+click: "#auto-hide-trait-implementations"
+assert-local-storage: {"rustdoc-auto-hide-trait-implementations": "true"}
+
+// We check that the changes were applied as expected.
+reload:
+
+call-function: ("check-setting", {
+ "storage_value": "true",
+ "setting_attribute_value": "true",
+ "toggle_attribute_value": null,
+})
+
+// And now we re-disable the setting.
+click: "#auto-hide-trait-implementations"
+assert-local-storage: {"rustdoc-auto-hide-trait-implementations": "false"}
+
+// And we check everything is back the way it was before.
+reload:
+call-function: ("check-setting", {
+ "storage_value": "false",
+ "setting_attribute_value": "false",
+ "toggle_attribute_value": "",
+})
diff --git a/tests/rustdoc-gui/setting-go-to-only-result.goml b/tests/rustdoc-gui/setting-go-to-only-result.goml
new file mode 100644
index 000000000..c5720b4bf
--- /dev/null
+++ b/tests/rustdoc-gui/setting-go-to-only-result.goml
@@ -0,0 +1,63 @@
+// Checks that the setting "Directly go to item in search if there is only one result " is working as expected.
+
+define-function: (
+ "check-setting",
+ (storage_value, setting_attribute_value),
+ block {
+ assert-local-storage: {"rustdoc-go-to-only-result": |storage_value|}
+ click: "#settings-menu"
+ wait-for: "#settings"
+ assert-property: ("#go-to-only-result", {"checked": |setting_attribute_value|})
+ }
+)
+
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
+
+call-function: ("check-setting", {
+ "storage_value": null,
+ "setting_attribute_value": "false",
+})
+
+// By default, the search doesn't automatically go to the page if there is only one result.
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=HasALongTraitWithParams"
+// It will timeout if the setting isn't working.
+wait-for: "#search"
+assert-document-property: ({"URL": "/lib2/index.html"}, CONTAINS)
+
+// Now we change its value.
+click: "#settings-menu"
+wait-for: "#settings"
+click: "#go-to-only-result"
+assert-local-storage: {"rustdoc-go-to-only-result": "true"}
+
+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)
+
+// We try again to see if it goes to the only result
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=HasALongTraitWithParams"
+wait-for-document-property: {"title": "HasALongTraitWithParams in lib2 - Rust"}
+assert-document-property: ({"URL": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH)
+
+// We check the settings
+call-function: ("check-setting", {
+ "storage_value": "true",
+ "setting_attribute_value": "true",
+})
+
+// And now we re-disable the setting.
+click: "#go-to-only-result"
+assert-local-storage: {"rustdoc-go-to-only-result": "false"}
+
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=HasALongTraitWithParams"
+// It will timeout if the setting isn't working.
+wait-for: "#search"
+assert-document-property: ({"URL": "/lib2/index.html"}, CONTAINS)
+
+// And we check everything is back the way it was before.
+call-function: ("check-setting", {
+ "storage_value": "false",
+ "setting_attribute_value": "false",
+})
diff --git a/tests/rustdoc-gui/settings.goml b/tests/rustdoc-gui/settings.goml
index a84172885..733be9beb 100644
--- a/tests/rustdoc-gui/settings.goml
+++ b/tests/rustdoc-gui/settings.goml
@@ -1,6 +1,6 @@
// This test ensures that the settings menu display is working as expected and that
// the settings page is also rendered as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true // needed when we check for colors below.
// First, we check that the settings page doesn't exist.
assert-false: "#settings"
@@ -35,7 +35,7 @@ wait-for: "#alternative-display #search"
assert: "#main-content.hidden"
// Now let's check the content of the settings menu.
-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
+set-local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
reload:
click: "#settings-menu"
wait-for: "#settings"
@@ -56,11 +56,12 @@ move-cursor-to: "#settings-menu > a"
assert-css: (
"#theme-dark",
{
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset",
+ "border-width": "2px",
},
)
-assert-css: ("#theme-light", {"border-color": "rgb(221, 221, 221)", "box-shadow": "none"})
+assert-css: ("#theme-light", {"border-color": "rgb(153, 153, 153)", "box-shadow": "none"})
// Let's start with the hover for radio buttons.
move-cursor-to: "#theme-dark"
assert-css: (
@@ -68,26 +69,36 @@ assert-css: (
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset",
+ "border-width": "2px",
},
)
move-cursor-to: "#theme-light"
-assert-css: ("#theme-light", {"border-color": "rgb(33, 150, 243)", "box-shadow": "none"})
+assert-css: (
+ "#theme-light",
+ {
+ "border-color": "rgb(33, 150, 243)",
+ "box-shadow": "none",
+ "border-width": "2px",
+ }
+)
move-cursor-to: "#theme-ayu"
// Let's now check with the focus for radio buttons.
focus: "#theme-dark"
assert-css: (
"#theme-dark",
{
- "border-color": "rgb(221, 221, 221)",
+ "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-width": "2px",
},
)
focus: "#theme-light"
assert-css: (
"#theme-light",
{
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "border-width": "2px",
},
)
// Now we check we both focus and hover for radio buttons.
@@ -98,6 +109,7 @@ assert-css: (
{
"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-width": "2px",
},
)
move-cursor-to: "#theme-light"
@@ -107,6 +119,7 @@ assert-css: (
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ "border-width": "2px",
},
)
// Now we check the setting-radio-name is on a different line than the label.
@@ -142,7 +155,18 @@ assert-css: (
"#auto-hide-large-items",
{
"background-color": "rgb(33, 150, 243)",
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
+ // 1px border when checked
+ "border-width": "1px",
+ },
+)
+assert-css: (
+ "#auto-hide-method-docs",
+ {
+ "background-color": "rgba(0, 0, 0, 0)",
+ "border-color": "rgb(153, 153, 153)",
+ // 2px border when unchecked
+ "border-width": "2px",
},
)
// Let's start with the hover for toggles.
@@ -152,6 +176,18 @@ assert-css: (
{
"background-color": "rgb(33, 150, 243)",
"border-color": "rgb(33, 150, 243)",
+ // 1px border when checked
+ "border-width": "1px",
+ },
+)
+move-cursor-to: "#auto-hide-method-docs"
+assert-css: (
+ "#auto-hide-method-docs",
+ {
+ "background-color": "rgba(0, 0, 0, 0)",
+ "border-color": "rgb(33, 150, 243)",
+ // 2px border when unchecked
+ "border-width": "2px",
},
)
move-cursor-to: "#settings-menu > a"
@@ -161,8 +197,21 @@ assert-css: (
"#auto-hide-large-items",
{
"background-color": "rgb(33, 150, 243)",
- "border-color": "rgb(221, 221, 221)",
+ "border-color": "rgb(153, 153, 153)",
+ "box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ // 1px border when checked
+ "border-width": "1px",
+ },
+)
+focus: "#auto-hide-method-docs"
+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",
+ // 2px border when unchecked
+ "border-width": "2px",
},
)
// Now we check we both focus and hover for toggles.
@@ -174,6 +223,20 @@ assert-css: (
"background-color": "rgb(33, 150, 243)",
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
+ // 1px border when checked
+ "border-width": "1px",
+ },
+)
+move-cursor-to: "#auto-hide-method-docs"
+focus: "#auto-hide-method-docs"
+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",
+ // 2px border when unchecked
+ "border-width": "2px",
},
)
@@ -189,7 +252,7 @@ assert-text: ("#preferred-light-theme .setting-radio-name", "Preferred light the
// We now check that clicking on the toggles' text is like clicking on the checkbox.
// To test it, we use the "Disable keyboard shortcuts".
-local-storage: {"rustdoc-disable-shortcuts": "false"}
+set-local-storage: {"rustdoc-disable-shortcuts": "false"}
click: ".setting-line:last-child .setting-check span"
assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
@@ -227,7 +290,7 @@ wait-for-css: ("#settings-menu .popover", {"display": "none"})
wait-for-css: ("#help-button .popover", {"display": "block"})
// Now we go to the settings page to check that the CSS is loaded as expected.
-goto: "file://" + |DOC_PATH| + "/settings.html"
+go-to: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
assert-css: (".setting-line", {"position": "relative"})
@@ -247,7 +310,7 @@ javascript: true
// Check for the display on small screen
show-text: true
reload:
-size: (300, 1000)
+set-window-size: (300, 1000)
click: "#settings-menu"
wait-for: "#settings"
assert-css: (".setting-line", {"position": "relative"})
diff --git a/tests/rustdoc-gui/shortcuts.goml b/tests/rustdoc-gui/shortcuts.goml
index 9068680d6..667df89ec 100644
--- a/tests/rustdoc-gui/shortcuts.goml
+++ b/tests/rustdoc-gui/shortcuts.goml
@@ -1,5 +1,5 @@
// Check that the various shortcuts are working.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// We first check that the search input isn't already focused.
assert-false: "input.search-input:focus"
press-key: "s"
diff --git a/tests/rustdoc-gui/sidebar-links-color.goml b/tests/rustdoc-gui/sidebar-links-color.goml
index 1d5fdb7a4..cec1a7999 100644
--- a/tests/rustdoc-gui/sidebar-links-color.goml
+++ b/tests/rustdoc-gui/sidebar-links-color.goml
@@ -1,5 +1,5 @@
// This test checks links colors in sidebar before and after hover.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// This is needed so that the text color is computed.
show-text: true
@@ -13,7 +13,7 @@ define-function: (
type_hover_background, keyword, keyword_hover, keyword_hover_background,
),
block {
- local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }
+ set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }
reload:
// Struct
assert-css: (
diff --git a/tests/rustdoc-gui/sidebar-macro-reexport.goml b/tests/rustdoc-gui/sidebar-macro-reexport.goml
index b5c1b6a43..0f7ef6c35 100644
--- a/tests/rustdoc-gui/sidebar-macro-reexport.goml
+++ b/tests/rustdoc-gui/sidebar-macro-reexport.goml
@@ -1,5 +1,5 @@
// This test ensures that the reexport of a macro doesn't make the original macro
// displayed twice in the sidebar.
-goto: "file://" + |DOC_PATH| + "/test_docs/macro.repro.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/macro.repro.html"
wait-for: ".sidebar-elems .block.macro a"
assert-count: ("//*[@class='sidebar-elems']//*[@class='block macro']//a[text()='repro']", 1)
diff --git a/tests/rustdoc-gui/sidebar-mobile-scroll.goml b/tests/rustdoc-gui/sidebar-mobile-scroll.goml
index 4442b263e..d58d1d487 100644
--- a/tests/rustdoc-gui/sidebar-mobile-scroll.goml
+++ b/tests/rustdoc-gui/sidebar-mobile-scroll.goml
@@ -1,31 +1,12 @@
-// This test ensures that the mobile sidebar preserves scroll position.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
-// Switching to "mobile view" by reducing the width to 600px.
-size: (700, 600)
-assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
-
-// Scroll down.
-scroll-to: "//h2[@id='blanket-implementations']"
-assert-window-property: {"pageYOffset": "622"}
-
-// Open the sidebar menu.
-click: ".sidebar-menu-toggle"
-wait-for-css: (".sidebar", {"left": "0px"})
-
-// We are no longer "scrolled". It's important that the user can't
-// scroll the body at all, but these test scripts are run only in Chrome,
-// and we need to use a more complicated solution to this problem because
-// of Mobile Safari...
-assert-window-property: {"pageYOffset": "0"}
-
-// Close the sidebar menu. Make sure the scroll position gets restored.
-click: ".sidebar-menu-toggle"
-wait-for-css: (".sidebar", {"left": "-1000px"})
-assert-window-property: {"pageYOffset": "622"}
-
-// Now test that scrollability returns when the browser window is just resized.
-click: ".sidebar-menu-toggle"
-wait-for-css: (".sidebar", {"left": "0px"})
-assert-window-property: {"pageYOffset": "0"}
-size: (900, 600)
-assert-window-property: {"pageYOffset": "622"}
+// This test ensures that the mobile disables scrolling the page.
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+set-window-size: (1280, 800) // desktop
+assert-css: (".sidebar", {"overscroll-behavior": "contain"})
+set-window-size: (700, 600) // mobile
+assert-css: (".sidebar", {"overscroll-behavior": "contain"})
+
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+set-window-size: (1280, 800) // desktop
+assert-css: (".sidebar", {"overscroll-behavior": "contain"})
+set-window-size: (700, 600) // mobile
+assert-css: (".sidebar", {"overscroll-behavior": "contain"})
diff --git a/tests/rustdoc-gui/sidebar-mobile.goml b/tests/rustdoc-gui/sidebar-mobile.goml
index cc6267c3d..3b022c7e9 100644
--- a/tests/rustdoc-gui/sidebar-mobile.goml
+++ b/tests/rustdoc-gui/sidebar-mobile.goml
@@ -1,9 +1,9 @@
// This test ensure that the sidebar isn't "hidden" on mobile but instead moved out of the viewport.
// This is especially important for devices for "text-first" content (like for users with
// sight issues).
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// Switching to "mobile view" by reducing the width to 600px.
-size: (600, 600)
+set-window-size: (600, 600)
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
// Opening the sidebar menu.
click: ".sidebar-menu-toggle"
@@ -59,7 +59,7 @@ define-function: (
"check-colors",
(theme, color, background),
block {
- local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
+ set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
reload:
// Open the sidebar menu.
diff --git a/tests/rustdoc-gui/sidebar-source-code-display.goml b/tests/rustdoc-gui/sidebar-source-code-display.goml
index f3eb8ff76..20bf0596f 100644
--- a/tests/rustdoc-gui/sidebar-source-code-display.goml
+++ b/tests/rustdoc-gui/sidebar-source-code-display.goml
@@ -1,6 +1,6 @@
// This test ensures that the elements in the sidebar are displayed correctly.
javascript: false
-goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
// Since the javascript is disabled, there shouldn't be a toggle.
assert-false: "#src-sidebar-toggle"
wait-for-css: (".sidebar", {"display": "none"})
@@ -22,7 +22,7 @@ wait-for-css: ("#src-sidebar-toggle", {"visibility": "visible"})
wait-for-css: (".sidebar", {"width": "300px"})
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
click: ".sidebar a.selected"
-goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
wait-for-css: (".sidebar", {"width": "300px"})
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
@@ -36,7 +36,7 @@ define-function: (
background_toggle_hover,
),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
wait-for-css: ("#src-sidebar-toggle", {"visibility": "visible"})
assert-css: (
@@ -148,7 +148,7 @@ call-function: ("check-colors", {
})
// Now checking on mobile devices.
-size: (500, 700)
+set-window-size: (500, 700)
reload:
// Waiting for the sidebar to be displayed...
wait-for-css: ("#src-sidebar-toggle", {"visibility": "visible"})
@@ -183,31 +183,21 @@ wait-for-css: (".sidebar", {"left": "-1000px"})
// The "scrollTop" property should be the same.
assert-window-property: {"pageYOffset": "2542"}
-// We now check that the scroll position is restored if the window is resized.
-size: (500, 700)
-click: "#src-sidebar-toggle"
-wait-for-css: ("#source-sidebar", {"visibility": "visible"})
-assert-window-property: {"pageYOffset": "0"}
-size: (900, 900)
-assert-window-property: {"pageYOffset": "2542"}
-size: (500, 700)
-click: "#src-sidebar-toggle"
-wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
-
// We now check that opening the sidebar and clicking a link will close it.
// The behavior here on mobile is different than the behavior on desktop,
// but common sense dictates that if you have a list of files that fills the entire screen, and
// you click one of them, you probably want to actually see the file's contents, and not just
// make it the current selection.
+set-window-size: (500, 700)
click: "#src-sidebar-toggle"
wait-for-css: ("#source-sidebar", {"visibility": "visible"})
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
click: ".sidebar a.selected"
-goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
// Resize back to desktop size, to check that the sidebar doesn't spontaneously open.
-size: (1000, 1000)
+set-window-size: (1000, 1000)
wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
click: "#src-sidebar-toggle"
diff --git a/tests/rustdoc-gui/sidebar-source-code.goml b/tests/rustdoc-gui/sidebar-source-code.goml
index c8a29b58d..520b2c59b 100644
--- a/tests/rustdoc-gui/sidebar-source-code.goml
+++ b/tests/rustdoc-gui/sidebar-source-code.goml
@@ -1,6 +1,6 @@
// The goal of this test is to ensure that the sidebar is working as expected in the source
// code pages.
-goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
show-text: true
// First, check the sidebar colors.
@@ -8,7 +8,7 @@ define-function: (
"check-colors",
(theme, color, background_color),
block {
- local-storage: {
+ set-local-storage: {
"rustdoc-theme": |theme|,
"rustdoc-use-system-theme": "false",
}
@@ -47,7 +47,7 @@ call-function: (
)
// Next, desktop mode layout.
-size: (1100, 800)
+set-window-size: (1100, 800)
// We check that the sidebar isn't expanded and has the expected width.
assert-css: ("nav.sidebar", {"width": "50px"})
// We now click on the button to expand the sidebar.
@@ -62,7 +62,7 @@ wait-for: "html:not(.expanded)"
assert: "nav.sidebar"
// Checking that only the path to the current file is "open".
-goto: "file://" + |DOC_PATH| + "/src/lib2/another_folder/sub_mod/mod.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/lib2/another_folder/sub_mod/mod.rs.html"
// First we expand the sidebar again.
click: (10, 10)
// We wait for the sidebar to be expanded.
@@ -73,10 +73,10 @@ assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
// Only "another_folder" should be "open" in "lib2".
assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
// All other trees should be collapsed.
-assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 8)
+assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 9)
// We now switch to mobile mode.
-size: (600, 600)
+set-window-size: (600, 600)
wait-for-css: (".source-sidebar-expanded nav.sidebar", {"left": "0px"})
// We collapse the sidebar.
click: (10, 10)
diff --git a/tests/rustdoc-gui/sidebar.goml b/tests/rustdoc-gui/sidebar.goml
index a6d517090..3c1ed009a 100644
--- a/tests/rustdoc-gui/sidebar.goml
+++ b/tests/rustdoc-gui/sidebar.goml
@@ -1,5 +1,5 @@
// Checks multiple things on the sidebar display (width of its elements, colors, etc).
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-property: (".sidebar", {"clientWidth": "200"})
show-text: true
@@ -8,7 +8,7 @@ define-function: (
"check-colors",
(theme, color, background_color),
block {
- local-storage: {
+ set-local-storage: {
"rustdoc-theme": |theme|,
"rustdoc-use-system-theme": "false",
}
@@ -46,7 +46,7 @@ call-function: (
}
)
-local-storage: {"rustdoc-theme": "light"}
+set-local-storage: {"rustdoc-theme": "light"}
// We reload the page so the local storage settings are being used.
reload:
@@ -86,13 +86,13 @@ click: ".sidebar h2.location a"
assert-property: ("html", {"scrollTop": "0"})
// We now go back to the crate page to click on the "lib2" crate link.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-property: (".sidebar", {"clientWidth": "200"})
assert-css: (".sidebar-elems ul.crate > li:first-child > a", {"color": "rgb(53, 109, 164)"})
click: ".sidebar-elems ul.crate > li:first-child > a"
// PAGE: lib2/index.html
-goto: "file://" + |DOC_PATH| + "/lib2/index.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
assert-property: (".sidebar", {"clientWidth": "200"})
assert-text: (".sidebar > .location", "Crate lib2")
// We check that we have the crates list and that the "current" on is now "lib2".
@@ -115,13 +115,13 @@ assert-text: (".sidebar .sidebar-elems h2", "In lib2")
// We check that we don't have the crate list.
assert-false: ".sidebar-elems > .crate"
-goto: "./module/index.html"
+go-to: "./module/index.html"
assert-property: (".sidebar", {"clientWidth": "200"})
assert-text: (".sidebar > .location", "Module module")
// We check that we don't have the crate list.
assert-false: ".sidebar-elems > .crate"
-goto: "./sub_module/sub_sub_module/index.html"
+go-to: "./sub_module/sub_sub_module/index.html"
assert-property: (".sidebar", {"clientWidth": "200"})
assert-text: (".sidebar > .location", "Module sub_sub_module")
// We check that we don't have the crate list.
@@ -130,13 +130,13 @@ assert-text: (".sidebar-elems > section ul > li:nth-child(1)", "Functions")
assert-text: ("#functions + .item-table .item-name > a", "foo")
// Links to trait implementations in the sidebar should not wrap even if they are long.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.HasALongTraitWithParams.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.HasALongTraitWithParams.html"
assert-property: (".sidebar", {"clientWidth": "200"})
assert-property: (".sidebar-elems section .block li > a", {"offsetHeight": 29})
// Test that clicking on of the "In <module>" headings in the sidebar links to the
// appropriate anchor in index.html.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-property: (".sidebar", {"clientWidth": "200"})
click: "//ul[@class='block mod']/preceding-sibling::h3/a"
// PAGE: index.html
@@ -149,3 +149,17 @@ assert-property: (".sidebar", {"clientWidth": "200"})
click: "#toggle-all-docs"
assert-text: ("#toggle-all-docs", "[−]")
assert-property: (".sidebar", {"clientWidth": "200"})
+
+// Checks that all.html and index.html have their sidebar link in the same place.
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+store-property: (index_sidebar_width, ".sidebar .location a", "clientWidth")
+store-property: (index_sidebar_height, ".sidebar .location a", "clientHeight")
+store-property: (index_sidebar_x, ".sidebar .location a", "offsetTop")
+store-property: (index_sidebar_y, ".sidebar .location a", "offsetLeft")
+go-to: "file://" + |DOC_PATH| + "/test_docs/all.html"
+assert-property: (".sidebar .location a", {
+ "clientWidth": |index_sidebar_width|,
+ "clientHeight": |index_sidebar_height|,
+ "offsetTop": |index_sidebar_x|,
+ "offsetLeft": |index_sidebar_y|,
+})
diff --git a/tests/rustdoc-gui/source-anchor-scroll.goml b/tests/rustdoc-gui/source-anchor-scroll.goml
index ddfe0c3d1..3d88d5619 100644
--- a/tests/rustdoc-gui/source-anchor-scroll.goml
+++ b/tests/rustdoc-gui/source-anchor-scroll.goml
@@ -1,9 +1,9 @@
// We check that when the anchor changes and is output of the displayed content,
// the page is scrolled to it.
-goto: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
// We reduce the window size to make it easier to make an element "out of the page".
-size: (600, 800)
+set-window-size: (600, 800)
// We check that the scroll is at the top first.
assert-property: ("html", {"scrollTop": "0"})
diff --git a/tests/rustdoc-gui/source-code-page-code-scroll.goml b/tests/rustdoc-gui/source-code-page-code-scroll.goml
new file mode 100644
index 000000000..35f338ea3
--- /dev/null
+++ b/tests/rustdoc-gui/source-code-page-code-scroll.goml
@@ -0,0 +1,8 @@
+// Checks that the scrollbar is visible on the page rather than the code block.
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+set-window-size: (800, 1000)
+// "scrollWidth" should be superior than "clientWidth".
+assert-property: ("body", {"scrollWidth": 1047, "clientWidth": 800})
+
+// Both properties should be equal (ie, no scroll on the code block).
+assert-property: (".example-wrap .rust", {"scrollWidth": 933, "clientWidth": 933})
diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml
index 7c35119e6..42f3200e9 100644
--- a/tests/rustdoc-gui/source-code-page.goml
+++ b/tests/rustdoc-gui/source-code-page.goml
@@ -1,5 +1,5 @@
// Checks that the interactions with the source code pages are working as expected.
-goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
show-text: true
// Check that we can click on the line number.
click: ".src-line-numbers > a:nth-child(4)" // This is the anchor for line 4.
@@ -12,7 +12,7 @@ reload:
assert-attribute: ("//*[@id='4']", {"class": "line-highlighted"})
assert-css: ("//*[@id='4']", {"border-right-width": "0px"})
// We now check that the good anchors are highlighted
-goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4-6"
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4-6"
assert-attribute-false: (".src-line-numbers > a:nth-child(3)", {"class": "line-highlighted"})
assert-attribute: (".src-line-numbers > a:nth-child(4)", {"class": "line-highlighted"})
assert-attribute: (".src-line-numbers > a:nth-child(5)", {"class": "line-highlighted"})
@@ -23,7 +23,7 @@ define-function: (
"check-colors",
(theme, color, background_color, highlight_color, highlight_background_color),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: (
".src-line-numbers > a:not(.line-highlighted)",
@@ -87,7 +87,7 @@ assert-css: (".src-line-numbers", {"text-align": "right"})
// Now let's check that clicking on something else than the line number doesn't
// do anything (and certainly not add a `#NaN` to the URL!).
-goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
// We use this assert-position to know where we will click.
assert-position: ("//*[@id='1']", {"x": 88, "y": 112})
// We click on the left of the "1" anchor but still in the "src-line-number" `<pre>`.
@@ -102,7 +102,7 @@ assert: ".source-sidebar-expanded"
// We check that the first entry of the sidebar is collapsed
assert-property: ("#source-sidebar details:first-of-type", {"open": "false"})
-assert-text: ("#source-sidebar details:first-of-type > summary", "http")
+assert-text: ("#source-sidebar details:first-of-type > summary", "extend_css")
// We now click on it.
click: "#source-sidebar details:first-of-type > summary"
assert-property: ("#source-sidebar details:first-of-type", {"open": "true"})
@@ -175,7 +175,7 @@ assert-property: ("#main-content", {"offsetTop": 90})
// 28 = 90 - 34 - 28
// Now do the same check on moderately-sized, tablet mobile.
-size: (700, 700)
+set-window-size: (700, 700)
assert-css: ("nav.sub", {"flex-direction": "row"})
assert-property: ("nav.sub form", {"offsetTop": 21, "offsetHeight": 34})
assert-property: ("#main-content", {"offsetTop": 76})
@@ -198,7 +198,7 @@ call-function: ("check-sidebar-dir-entry", {
})
// Tiny, phone mobile gets a different display where the logo is stacked on top.
-size: (450, 700)
+set-window-size: (450, 700)
assert-css: ("nav.sub", {"flex-direction": "column"})
// Check the sidebar directory entries have a marker and spacing (phone).
@@ -216,3 +216,8 @@ call-function: ("check-sidebar-dir-entry", {
"x": 0,
"y": |source_sidebar_title_y| + |source_sidebar_title_height| + 6,
})
+
+// Now we check that the logo has a bottom margin so it's not stuck to the search input.
+assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"})
+store-property: (logo_height, ".sub-logo-container", "clientHeight")
+assert-position: (".search-form", {"y": |logo_height| + 8})
diff --git a/tests/rustdoc-gui/src-font-size.goml b/tests/rustdoc-gui/src-font-size.goml
index bab66dae7..790aeba52 100644
--- a/tests/rustdoc-gui/src-font-size.goml
+++ b/tests/rustdoc-gui/src-font-size.goml
@@ -1,7 +1,7 @@
// This test ensures that the "[src]" have the same font size as their headers
// to avoid having some weird height difference in the background when the element
// is selected.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
show-text: true
// Check the impl headers.
assert-css: (".impl .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
diff --git a/tests/rustdoc-gui/src/extend_css/Cargo.lock b/tests/rustdoc-gui/src/extend_css/Cargo.lock
new file mode 100644
index 000000000..7101a6f0f
--- /dev/null
+++ b/tests/rustdoc-gui/src/extend_css/Cargo.lock
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "extend_css"
+version = "0.1.0"
diff --git a/tests/rustdoc-gui/src/extend_css/Cargo.toml b/tests/rustdoc-gui/src/extend_css/Cargo.toml
new file mode 100644
index 000000000..91683fe89
--- /dev/null
+++ b/tests/rustdoc-gui/src/extend_css/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "extend_css"
+version = "0.1.0"
+edition = "2018"
+
+[lib]
+path = "lib.rs"
diff --git a/tests/rustdoc-gui/src/extend_css/extra.css b/tests/rustdoc-gui/src/extend_css/extra.css
new file mode 100644
index 000000000..ee7062d96
--- /dev/null
+++ b/tests/rustdoc-gui/src/extend_css/extra.css
@@ -0,0 +1,3 @@
+.extend {
+ color: red !important;
+}
diff --git a/tests/rustdoc-gui/src/extend_css/lib.rs b/tests/rustdoc-gui/src/extend_css/lib.rs
new file mode 100644
index 000000000..3a3babf89
--- /dev/null
+++ b/tests/rustdoc-gui/src/extend_css/lib.rs
@@ -0,0 +1 @@
+//! <div class="extend">text in red</div>
diff --git a/tests/rustdoc-gui/stab-badge.goml b/tests/rustdoc-gui/stab-badge.goml
index 50ba1ba62..e23404188 100644
--- a/tests/rustdoc-gui/stab-badge.goml
+++ b/tests/rustdoc-gui/stab-badge.goml
@@ -1,12 +1,12 @@
// All stability badges should have rounded corners and colored backgrounds.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true
define-function: (
"check-badge",
(theme, background, color),
block {
- local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
- goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+ set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert: ".docblock .stab"
assert: ".item-table .stab"
assert-css: (".stab", {
@@ -14,7 +14,7 @@ define-function: (
"color": |color|,
"background-color": |background|,
})
- goto: "file://" + |DOC_PATH| + "/test_docs/fn.replaced_function.html"
+ go-to: "file://" + |DOC_PATH| + "/test_docs/fn.replaced_function.html"
assert: (".item-info .stab")
assert-css: (".stab", {
"border-radius": "3px",
diff --git a/tests/rustdoc-gui/struct-fields.goml b/tests/rustdoc-gui/struct-fields.goml
index fa3e16cb8..da0467de1 100644
--- a/tests/rustdoc-gui/struct-fields.goml
+++ b/tests/rustdoc-gui/struct-fields.goml
@@ -1,5 +1,5 @@
// This test ensures that each field is on its own line (In other words, they have display: block).
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.StructWithPublicUndocumentedFields.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.StructWithPublicUndocumentedFields.html"
store-property: (first_top, "//*[@id='structfield.first']", "offsetTop")
assert-property-false: ("//*[@id='structfield.second']", { "offsetTop": |first_top| })
diff --git a/tests/rustdoc-gui/target.goml b/tests/rustdoc-gui/target.goml
index ca393ee58..0c514fc68 100644
--- a/tests/rustdoc-gui/target.goml
+++ b/tests/rustdoc-gui/target.goml
@@ -1,5 +1,5 @@
// Check that the targetted element has the expected styles.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html#method.a_method"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html#method.a_method"
show-text: true
// Confirming that the method is the target.
@@ -9,7 +9,7 @@ define-function: (
"check-style",
(theme, background, border),
block {
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: ("#method\.a_method:target", {
"background-color": |background|,
diff --git a/tests/rustdoc-gui/theme-change.goml b/tests/rustdoc-gui/theme-change.goml
index 31c9d99aa..ae6947213 100644
--- a/tests/rustdoc-gui/theme-change.goml
+++ b/tests/rustdoc-gui/theme-change.goml
@@ -1,6 +1,6 @@
// Ensures that the theme change is working as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
+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)")
@@ -22,11 +22,11 @@ click: "#theme-dark"
wait-for-css: ("body", { "background-color": |background_dark| })
assert-local-storage: { "rustdoc-theme": "dark" }
-local-storage: {
+set-local-storage: {
"rustdoc-preferred-light-theme": "light",
"rustdoc-preferred-dark-theme": "light",
}
-goto: "file://" + |DOC_PATH| + "/settings.html"
+go-to: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
click: "#theme-light"
diff --git a/tests/rustdoc-gui/theme-defaults.goml b/tests/rustdoc-gui/theme-defaults.goml
new file mode 100644
index 000000000..2cc5d716c
--- /dev/null
+++ b/tests/rustdoc-gui/theme-defaults.goml
@@ -0,0 +1,24 @@
+// Ensure that the theme picker always starts with the actual defaults.
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+click: "#settings-menu"
+wait-for: "#theme-system-preference"
+assert: "#theme-system-preference:checked"
+assert: "#preferred-light-theme-light:checked"
+assert: "#preferred-dark-theme-dark:checked"
+assert-false: "#preferred-dark-theme-ayu:checked"
+
+// Test legacy migration from old theme setup without system-preference matching.
+// See https://github.com/rust-lang/rust/pull/77809#issuecomment-707875732
+set-local-storage: {
+ "rustdoc-preferred-light-theme": null,
+ "rustdoc-preferred-dark-theme": null,
+ "rustdoc-use-system-theme": null,
+ "rustdoc-theme": "ayu"
+}
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+click: "#settings-menu"
+wait-for: "#theme-system-preference"
+assert: "#theme-system-preference:checked"
+assert: "#preferred-light-theme-light:checked"
+assert-false: "#preferred-dark-theme-dark:checked"
+assert: "#preferred-dark-theme-ayu:checked"
diff --git a/tests/rustdoc-gui/theme-in-history.goml b/tests/rustdoc-gui/theme-in-history.goml
index 10508e86a..8fcd0ecd3 100644
--- a/tests/rustdoc-gui/theme-in-history.goml
+++ b/tests/rustdoc-gui/theme-in-history.goml
@@ -1,7 +1,7 @@
// Ensures that the theme is working when going back in history.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Set the theme to dark.
-local-storage: {
+set-local-storage: {
"rustdoc-theme": "dark",
"rustdoc-use-system-theme": "false",
}
@@ -11,7 +11,7 @@ assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
assert-local-storage: { "rustdoc-theme": "dark" }
// Now we go to the settings page.
-goto: "file://" + |DOC_PATH| + "/settings.html"
+go-to: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
// We change the theme to "light".
click: "#theme-light"
diff --git a/tests/rustdoc-gui/toggle-click-deadspace.goml b/tests/rustdoc-gui/toggle-click-deadspace.goml
index ac346f25b..f115f63ab 100644
--- a/tests/rustdoc-gui/toggle-click-deadspace.goml
+++ b/tests/rustdoc-gui/toggle-click-deadspace.goml
@@ -1,6 +1,6 @@
// This test ensures that clicking on a method summary, but not on the "[-]",
// doesn't toggle the <details>.
-goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
assert-attribute: (".impl-items .toggle", {"open": ""})
click: "h4.code-header" // This is the position of "pub" in "pub fn a_method"
assert-attribute: (".impl-items .toggle", {"open": ""})
diff --git a/tests/rustdoc-gui/toggle-docs-mobile.goml b/tests/rustdoc-gui/toggle-docs-mobile.goml
index 6ce24a81b..b69aa6e30 100644
--- a/tests/rustdoc-gui/toggle-docs-mobile.goml
+++ b/tests/rustdoc-gui/toggle-docs-mobile.goml
@@ -1,7 +1,7 @@
// Checks that the documentation toggles on mobile have the correct position, style and work
// as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
-size: (433, 600)
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+set-window-size: (433, 600)
assert-attribute: (".top-doc", {"open": ""})
click: (4, 270) // This is the position of the top doc comment toggle
assert-attribute-false: (".top-doc", {"open": ""})
@@ -22,7 +22,7 @@ assert-position: (
)
// Now we do the same but with a little bigger width
-size: (600, 600)
+set-window-size: (600, 600)
assert-attribute: (".top-doc", {"open": ""})
click: (4, 270) // New Y position since all search elements are back on one line.
assert-attribute-false: (".top-doc", {"open": ""})
diff --git a/tests/rustdoc-gui/toggle-docs.goml b/tests/rustdoc-gui/toggle-docs.goml
index c9d236e9b..9ea6d9b18 100644
--- a/tests/rustdoc-gui/toggle-docs.goml
+++ b/tests/rustdoc-gui/toggle-docs.goml
@@ -1,5 +1,5 @@
// Checks that the documentation toggles have the correct position, style and work as expected.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-attribute: ("#main-content > details.top-doc", {"open": ""})
assert-text: ("#toggle-all-docs", "[−]")
click: "#toggle-all-docs"
@@ -17,7 +17,7 @@ wait-for-attribute: ("#main-content > details.top-doc", {"open": ""})
assert-text: ("#toggle-all-docs", "[−]")
// Check that it works on non-module pages as well.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// We first check that everything is visible.
assert-text: ("#toggle-all-docs", "[−]")
assert-attribute: ("#implementations-list details.toggle", {"open": ""}, ALL)
@@ -52,7 +52,7 @@ define-function: (
(theme, filter),
block {
// Setting the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
diff --git a/tests/rustdoc-gui/toggle-implementors.goml b/tests/rustdoc-gui/toggle-implementors.goml
index 8ff5b91af..c4056275d 100644
--- a/tests/rustdoc-gui/toggle-implementors.goml
+++ b/tests/rustdoc-gui/toggle-implementors.goml
@@ -1,4 +1,4 @@
// This test ensures that the implementors toggle are not open by default.
-goto: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html"
+go-to: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html"
assert-attribute-false: ("#implementors-list > details", {"open": ""}, ALL)
diff --git a/tests/rustdoc-gui/toggled-open-implementations.goml b/tests/rustdoc-gui/toggled-open-implementations.goml
index 000293b55..238205dd4 100644
--- a/tests/rustdoc-gui/toggled-open-implementations.goml
+++ b/tests/rustdoc-gui/toggled-open-implementations.goml
@@ -1,5 +1,5 @@
// This tests that the "implementations" section on struct/enum pages
// has all the implementations toggled open by default, so users can
// find method names in those implementations with Ctrl-F.
-goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-attribute: (".toggle.implementors-toggle", {"open": ""})
diff --git a/tests/rustdoc-gui/trait-sidebar-item-order.goml b/tests/rustdoc-gui/trait-sidebar-item-order.goml
index e5d023544..9330ef040 100644
--- a/tests/rustdoc-gui/trait-sidebar-item-order.goml
+++ b/tests/rustdoc-gui/trait-sidebar-item-order.goml
@@ -4,7 +4,7 @@
// doesn't exist.
fail-on-request-error: false
-goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
assert-text: (".sidebar-elems section .block li:nth-of-type(1) > a", "another")
assert-text: (".sidebar-elems section .block li:nth-of-type(2) > a", "func1")
assert-text: (".sidebar-elems section .block li:nth-of-type(3) > a", "func2")
diff --git a/tests/rustdoc-gui/type-declation-overflow.goml b/tests/rustdoc-gui/type-declation-overflow.goml
index 708e9dca0..e8e42e400 100644
--- a/tests/rustdoc-gui/type-declation-overflow.goml
+++ b/tests/rustdoc-gui/type-declation-overflow.goml
@@ -6,20 +6,20 @@
// doesn't exist.
fail-on-request-error: false
-goto: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html"
// We set a fixed size so there is no chance of "random" resize.
-size: (1100, 800)
+set-window-size: (1100, 800)
// Logically, the <body> scroll width should be the width of the window.
assert-property: ("body", {"scrollWidth": "1100"})
// However, since there is overflow in the type declaration, its scroll width is bigger.
assert-property: ("pre.item-decl", {"scrollWidth": "1324"})
// In the table-ish view on the module index, the name should not be wrapped more than necessary.
-goto: "file://" + |DOC_PATH| + "/lib2/too_long/index.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/too_long/index.html"
assert-property: (".item-table .struct", {"offsetWidth": "684"})
// We now make the same check on type declaration...
-goto: "file://" + |DOC_PATH| + "/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html"
assert-property: ("body", {"scrollWidth": "1100"})
// We now check that the section width hasn't grown because of it.
assert-property: ("#main-content", {"scrollWidth": "840"})
@@ -28,7 +28,7 @@ assert-property: ("pre.item-decl", {"scrollWidth": "1103"})
// ... and constant.
// On a sidenote, it also checks that the (very) long title isn't changing the docblock width.
-goto: "file://" + |DOC_PATH| + "/lib2/too_long/constant.ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/too_long/constant.ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong.html"
assert-property: ("body", {"scrollWidth": "1100"})
// We now check that the section width hasn't grown because of it.
assert-property: ("#main-content", {"scrollWidth": "840"})
@@ -36,8 +36,8 @@ assert-property: ("#main-content", {"scrollWidth": "840"})
assert-property: ("pre.item-decl", {"scrollWidth": "950"})
// On mobile:
-size: (600, 600)
-goto: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
+set-window-size: (600, 600)
+go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
// It shouldn't have an overflow in the topbar either.
store-property: (scrollWidth, ".mobile-topbar h2", "scrollWidth")
assert-property: (".mobile-topbar h2", {"clientWidth": |scrollWidth|})
@@ -45,24 +45,24 @@ assert-css: (".mobile-topbar h2", {"overflow-x": "hidden"})
// Check wrapping for top main-heading h1 and out-of-band.
// On desktop, they wrap when too big.
-size: (1100, 800)
-goto: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
+set-window-size: (1100, 800)
+go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y"))
-goto: "file://" + |DOC_PATH| + "/lib2/index.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
compare-elements-position: (".main-heading h1", ".main-heading .out-of-band", ("y"))
// make sure there is a gap between them
compare-elements-position-near-false: (".main-heading h1", ".main-heading .out-of-band", {"x": 550})
// On mobile, they always wrap.
-size: (600, 600)
-goto: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
+set-window-size: (600, 600)
+go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y"))
-goto: "file://" + |DOC_PATH| + "/lib2/index.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html"
compare-elements-position-false: (".main-heading h1", ".main-heading .out-of-band", ("y"))
// Now we will check that the scrolling is working.
// First on an item with "hidden methods".
-goto: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.Iterator.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.Iterator.html"
click: ".item-decl .type-contents-toggle"
assert-property: ("pre.item-decl", {"scrollLeft": 0})
@@ -70,7 +70,7 @@ scroll-to: "//*[@class='rust item-decl']//details/a[text()='String']"
assert-property-false: ("pre.item-decl", {"scrollLeft": 0})
// Then on an item without "hidden methods".
-goto: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.TraitWithLongItemsName.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.TraitWithLongItemsName.html"
assert-property: ("pre.item-decl", {"scrollLeft": 0})
scroll-to: "//*[@class='rust item-decl']//code/a[text()='String']"
assert-property-false: ("pre.item-decl", {"scrollLeft": 0})
diff --git a/tests/rustdoc-gui/unsafe-fn.goml b/tests/rustdoc-gui/unsafe-fn.goml
index 9d2577178..51007b653 100644
--- a/tests/rustdoc-gui/unsafe-fn.goml
+++ b/tests/rustdoc-gui/unsafe-fn.goml
@@ -1,5 +1,5 @@
// Check position and color of the `<sup>` for unsafe elements.
-goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// If the text isn't displayed, the browser doesn't compute color style correctly...
show-text: true
@@ -16,7 +16,7 @@ define-function: (
(theme, color),
block {
// Set the theme.
- local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
+ set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
assert-css: (".item-name sup", {"color": |color|})
diff --git a/tests/rustdoc-gui/where-whitespace.goml b/tests/rustdoc-gui/where-whitespace.goml
index 41596a9bc..69e6c3356 100644
--- a/tests/rustdoc-gui/where-whitespace.goml
+++ b/tests/rustdoc-gui/where-whitespace.goml
@@ -1,5 +1,5 @@
// This test ensures that the where conditions are correctly displayed.
-goto: "file://" + |DOC_PATH| + "/lib2/trait.Whitespace.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/trait.Whitespace.html"
show-text: true
// First, we check in the trait definition if the where clause is "on its own" (not on the same
// line than "pub trait Whitespace<Idx>").
@@ -7,9 +7,9 @@ compare-elements-position-false: (".item-decl code", ".where.fmt-newline", ("y")
// And that the code following it isn't on the same line either.
compare-elements-position-false: (".item-decl .fn", ".where.fmt-newline", ("y"))
-goto: "file://" + |DOC_PATH| + "/lib2/struct.WhereWhitespace.html"
+go-to: "file://" + |DOC_PATH| + "/lib2/struct.WhereWhitespace.html"
// We make the screen a bit wider to ensure that the trait impl is on one line.
-size: (915, 915)
+set-window-size: (915, 915)
compare-elements-position-false: ("#method\.new .fn", "#method\.new .where.fmt-newline", ("y"))
// We ensure that both the trait name and the struct name are on the same line in
diff --git a/tests/rustdoc-js-std/option-type-signatures.js b/tests/rustdoc-js-std/option-type-signatures.js
new file mode 100644
index 000000000..6bf421a21
--- /dev/null
+++ b/tests/rustdoc-js-std/option-type-signatures.js
@@ -0,0 +1,18 @@
+const QUERY = [
+ 'option, fnonce -> option',
+ 'option -> default',
+];
+
+const EXPECTED = [
+ {
+ 'others': [
+ { 'path': 'std::option::Option', 'name': 'map' },
+ ],
+ },
+ {
+ 'others': [
+ { 'path': 'std::option::Option', 'name': 'unwrap_or_default' },
+ { 'path': 'std::option::Option', 'name': 'get_or_insert_default' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js-std/parser-errors.js b/tests/rustdoc-js-std/parser-errors.js
index 98c6f27ca..d1aa840ab 100644
--- a/tests/rustdoc-js-std/parser-errors.js
+++ b/tests/rustdoc-js-std/parser-errors.js
@@ -17,6 +17,7 @@ const QUERY = [
"a b:",
"a (b:",
"_:",
+ "_:a",
"a-bb",
"a>bb",
"ab'",
@@ -48,7 +49,6 @@ const PARSED = [
foundElems: 0,
original: "<P>",
returned: [],
- typeFilter: -1,
userQuery: "<p>",
error: "Found generics without a path",
},
@@ -57,7 +57,6 @@ const PARSED = [
foundElems: 0,
original: "-> <P>",
returned: [],
- typeFilter: -1,
userQuery: "-> <p>",
error: "Found generics without a path",
},
@@ -66,7 +65,6 @@ const PARSED = [
foundElems: 0,
original: "a<\"P\">",
returned: [],
- typeFilter: -1,
userQuery: "a<\"p\">",
error: "Unexpected `\"` in generics",
},
@@ -75,7 +73,6 @@ const PARSED = [
foundElems: 0,
original: "\"P\" \"P\"",
returned: [],
- typeFilter: -1,
userQuery: "\"p\" \"p\"",
error: "Cannot have more than one literal search element",
},
@@ -84,7 +81,6 @@ const PARSED = [
foundElems: 0,
original: "P \"P\"",
returned: [],
- typeFilter: -1,
userQuery: "p \"p\"",
error: "Cannot use literal search when there is more than one element",
},
@@ -93,7 +89,6 @@ const PARSED = [
foundElems: 0,
original: "\"p\" p",
returned: [],
- typeFilter: -1,
userQuery: "\"p\" p",
error: "You cannot have more than one element if you use quotes",
},
@@ -102,7 +97,6 @@ const PARSED = [
foundElems: 0,
original: "\"const\": p",
returned: [],
- typeFilter: -1,
userQuery: "\"const\": p",
error: "You cannot use quotes on type filter",
},
@@ -111,16 +105,14 @@ const PARSED = [
foundElems: 0,
original: "a<:a>",
returned: [],
- typeFilter: -1,
userQuery: "a<:a>",
- error: "Unexpected `:` after `<`",
+ error: "Expected type filter before `:`",
},
{
elems: [],
foundElems: 0,
original: "a<::a>",
returned: [],
- typeFilter: -1,
userQuery: "a<::a>",
error: "Unexpected `::`: paths cannot start with `::`",
},
@@ -129,7 +121,6 @@ const PARSED = [
foundElems: 0,
original: "((a))",
returned: [],
- typeFilter: -1,
userQuery: "((a))",
error: "Unexpected `(`",
},
@@ -138,7 +129,6 @@ const PARSED = [
foundElems: 0,
original: "(p -> p",
returned: [],
- typeFilter: -1,
userQuery: "(p -> p",
error: "Unexpected `(`",
},
@@ -147,7 +137,6 @@ const PARSED = [
foundElems: 0,
original: "::a::b",
returned: [],
- typeFilter: -1,
userQuery: "::a::b",
error: "Paths cannot start with `::`",
},
@@ -156,7 +145,6 @@ const PARSED = [
foundElems: 0,
original: "a::::b",
returned: [],
- typeFilter: -1,
userQuery: "a::::b",
error: "Unexpected `::::`",
},
@@ -165,7 +153,6 @@ const PARSED = [
foundElems: 0,
original: "a::b::",
returned: [],
- typeFilter: -1,
userQuery: "a::b::",
error: "Paths cannot end with `::`",
},
@@ -174,7 +161,6 @@ const PARSED = [
foundElems: 0,
original: ":a",
returned: [],
- typeFilter: -1,
userQuery: ":a",
error: "Expected type filter before `:`",
},
@@ -183,16 +169,14 @@ const PARSED = [
foundElems: 0,
original: "a b:",
returned: [],
- typeFilter: -1,
userQuery: "a b:",
- error: "Unexpected `:`",
+ error: "Unexpected `:` (expected path after type filter)",
},
{
elems: [],
foundElems: 0,
original: "a (b:",
returned: [],
- typeFilter: -1,
userQuery: "a (b:",
error: "Unexpected `(`",
},
@@ -201,8 +185,15 @@ const PARSED = [
foundElems: 0,
original: "_:",
returned: [],
- typeFilter: -1,
userQuery: "_:",
+ error: "Unexpected `:` (expected path after type filter)",
+ },
+ {
+ elems: [],
+ foundElems: 0,
+ original: "_:a",
+ returned: [],
+ userQuery: "_:a",
error: "Unknown type filter `_`",
},
{
@@ -210,7 +201,6 @@ const PARSED = [
foundElems: 0,
original: "a-bb",
returned: [],
- typeFilter: -1,
userQuery: "a-bb",
error: "Unexpected `-` (did you mean `->`?)",
},
@@ -219,7 +209,6 @@ const PARSED = [
foundElems: 0,
original: "a>bb",
returned: [],
- typeFilter: -1,
userQuery: "a>bb",
error: "Unexpected `>` (did you mean `->`?)",
},
@@ -228,7 +217,6 @@ const PARSED = [
foundElems: 0,
original: "ab'",
returned: [],
- typeFilter: -1,
userQuery: "ab'",
error: "Unexpected `'`",
},
@@ -237,7 +225,6 @@ const PARSED = [
foundElems: 0,
original: "a->",
returned: [],
- typeFilter: -1,
userQuery: "a->",
error: "Expected at least one item after `->`",
},
@@ -246,7 +233,6 @@ const PARSED = [
foundElems: 0,
original: '"p" <a>',
returned: [],
- typeFilter: -1,
userQuery: '"p" <a>',
error: "Found generics without a path",
},
@@ -255,7 +241,6 @@ const PARSED = [
foundElems: 0,
original: '"p" a<a>',
returned: [],
- typeFilter: -1,
userQuery: '"p" a<a>',
error: "You cannot have more than one element if you use quotes",
},
@@ -264,7 +249,6 @@ const PARSED = [
foundElems: 0,
original: 'a,<',
returned: [],
- typeFilter: -1,
userQuery: 'a,<',
error: 'Found generics without a path',
},
@@ -273,7 +257,6 @@ const PARSED = [
foundElems: 0,
original: 'aaaaa<>b',
returned: [],
- typeFilter: -1,
userQuery: 'aaaaa<>b',
error: 'Expected `,`, ` `, `:` or `->`, found `b`',
},
@@ -282,16 +265,14 @@ const PARSED = [
foundElems: 0,
original: 'fn:aaaaa<>b',
returned: [],
- typeFilter: -1,
userQuery: 'fn:aaaaa<>b',
- error: 'Expected `,`, ` ` or `->`, found `b`',
+ error: 'Expected `,`, ` `, `:` or `->`, found `b`',
},
{
elems: [],
foundElems: 0,
original: '->a<>b',
returned: [],
- typeFilter: -1,
userQuery: '->a<>b',
error: 'Expected `,` or ` `, found `b`',
},
@@ -300,7 +281,6 @@ const PARSED = [
foundElems: 0,
original: 'a<->',
returned: [],
- typeFilter: -1,
userQuery: 'a<->',
error: 'Unexpected `-` after `<`',
},
@@ -309,7 +289,6 @@ const PARSED = [
foundElems: 0,
original: 'a:: a',
returned: [],
- typeFilter: -1,
userQuery: 'a:: a',
error: 'Paths cannot end with `::`',
},
@@ -318,7 +297,6 @@ const PARSED = [
foundElems: 0,
original: 'a ::a',
returned: [],
- typeFilter: -1,
userQuery: 'a ::a',
error: 'Paths cannot start with `::`',
},
@@ -327,16 +305,14 @@ const PARSED = [
foundElems: 0,
original: "a<a>:",
returned: [],
- typeFilter: -1,
userQuery: "a<a>:",
- error: 'Unexpected `:`',
+ error: 'Unexpected `<` in type filter',
},
{
elems: [],
foundElems: 0,
original: "a<>:",
returned: [],
- typeFilter: -1,
userQuery: "a<>:",
error: 'Unexpected `<` in type filter',
},
@@ -345,7 +321,6 @@ const PARSED = [
foundElems: 0,
original: "a,:",
returned: [],
- typeFilter: -1,
userQuery: "a,:",
error: 'Unexpected `,` in type filter',
},
@@ -354,7 +329,6 @@ const PARSED = [
foundElems: 0,
original: "a<> :",
returned: [],
- typeFilter: -1,
userQuery: "a<> :",
error: 'Unexpected `<` in type filter',
},
@@ -363,7 +337,6 @@ const PARSED = [
foundElems: 0,
original: "mod : :",
returned: [],
- typeFilter: -1,
userQuery: "mod : :",
error: 'Unexpected `:`',
},
@@ -372,7 +345,6 @@ const PARSED = [
foundElems: 0,
original: "a!a",
returned: [],
- typeFilter: -1,
userQuery: "a!a",
error: 'Unexpected `!`: it can only be at the end of an ident',
},
@@ -381,7 +353,6 @@ const PARSED = [
foundElems: 0,
original: "a!!",
returned: [],
- typeFilter: -1,
userQuery: "a!!",
error: 'Cannot have more than one `!` in an ident',
},
@@ -390,7 +361,6 @@ const PARSED = [
foundElems: 0,
original: "mod:a!",
returned: [],
- typeFilter: -1,
userQuery: "mod:a!",
error: 'Invalid search type: macro `!` and `mod` both specified',
},
@@ -399,7 +369,6 @@ const PARSED = [
foundElems: 0,
original: "a!::a",
returned: [],
- typeFilter: -1,
userQuery: "a!::a",
error: 'Cannot have associated items in macros',
},
@@ -408,7 +377,6 @@ const PARSED = [
foundElems: 0,
original: "a<",
returned: [],
- typeFilter: -1,
userQuery: "a<",
error: "Unclosed `<`",
},
diff --git a/tests/rustdoc-js-std/parser-filter.js b/tests/rustdoc-js-std/parser-filter.js
index 01f65b478..e23447ab7 100644
--- a/tests/rustdoc-js-std/parser-filter.js
+++ b/tests/rustdoc-js-std/parser-filter.js
@@ -1,4 +1,14 @@
-const QUERY = ['fn:foo', 'enum : foo', 'macro<f>:foo', 'macro!', 'macro:mac!', 'a::mac!'];
+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 = [
{
@@ -8,11 +18,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "foo",
generics: [],
+ typeFilter: 5,
}],
foundElems: 1,
original: "fn:foo",
returned: [],
- typeFilter: 5,
userQuery: "fn:foo",
error: null,
},
@@ -23,11 +33,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "foo",
generics: [],
+ typeFilter: 4,
}],
foundElems: 1,
original: "enum : foo",
returned: [],
- typeFilter: 4,
userQuery: "enum : foo",
error: null,
},
@@ -36,9 +46,8 @@ const PARSED = [
foundElems: 0,
original: "macro<f>:foo",
returned: [],
- typeFilter: -1,
userQuery: "macro<f>:foo",
- error: "Unexpected `:`",
+ error: "Unexpected `<` in type filter",
},
{
elems: [{
@@ -47,11 +56,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "macro",
generics: [],
+ typeFilter: 14,
}],
foundElems: 1,
original: "macro!",
returned: [],
- typeFilter: 14,
userQuery: "macro!",
error: null,
},
@@ -62,11 +71,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "mac",
generics: [],
+ typeFilter: 14,
}],
foundElems: 1,
original: "macro:mac!",
returned: [],
- typeFilter: 14,
userQuery: "macro:mac!",
error: null,
},
@@ -77,12 +86,83 @@ const PARSED = [
pathWithoutLast: ["a"],
pathLast: "mac",
generics: [],
+ typeFilter: 14,
}],
foundElems: 1,
original: "a::mac!",
returned: [],
- typeFilter: 14,
userQuery: "a::mac!",
error: null,
},
+ {
+ elems: [],
+ foundElems: 1,
+ original: "-> fn:foo",
+ returned: [{
+ name: "foo",
+ fullPath: ["foo"],
+ pathWithoutLast: [],
+ pathLast: "foo",
+ generics: [],
+ typeFilter: 5,
+ }],
+ userQuery: "-> fn:foo",
+ error: null,
+ },
+ {
+ elems: [],
+ foundElems: 1,
+ original: "-> fn:foo<fn:bar>",
+ returned: [{
+ name: "foo",
+ fullPath: ["foo"],
+ pathWithoutLast: [],
+ pathLast: "foo",
+ generics: [
+ {
+ name: "bar",
+ fullPath: ["bar"],
+ pathWithoutLast: [],
+ pathLast: "bar",
+ generics: [],
+ typeFilter: 5,
+ }
+ ],
+ typeFilter: 5,
+ }],
+ userQuery: "-> fn:foo<fn:bar>",
+ error: null,
+ },
+ {
+ elems: [],
+ foundElems: 1,
+ original: "-> fn:foo<fn:bar, enum : baz::fuzz>",
+ returned: [{
+ name: "foo",
+ fullPath: ["foo"],
+ pathWithoutLast: [],
+ pathLast: "foo",
+ generics: [
+ {
+ name: "bar",
+ fullPath: ["bar"],
+ pathWithoutLast: [],
+ pathLast: "bar",
+ generics: [],
+ typeFilter: 5,
+ },
+ {
+ name: "baz::fuzz",
+ fullPath: ["baz", "fuzz"],
+ pathWithoutLast: ["baz"],
+ pathLast: "fuzz",
+ generics: [],
+ typeFilter: 4,
+ },
+ ],
+ typeFilter: 5,
+ }],
+ userQuery: "-> fn:foo<fn:bar, enum : baz::fuzz>",
+ error: null,
+ },
];
diff --git a/tests/rustdoc-js-std/parser-generics.js b/tests/rustdoc-js-std/parser-generics.js
index 0cf7f5019..5a2266dbe 100644
--- a/tests/rustdoc-js-std/parser-generics.js
+++ b/tests/rustdoc-js-std/parser-generics.js
@@ -1,4 +1,11 @@
-const QUERY = ['A<B<C<D>, E>', 'p<> u8', '"p"<a>'];
+const QUERY = [
+ 'A<B<C<D>, E>',
+ 'p<> u8',
+ '"p"<a>',
+ 'p<u<x>>',
+ 'p<u<x>, r>',
+ 'p<u<x, r>>',
+];
const PARSED = [
{
@@ -6,9 +13,8 @@ const PARSED = [
foundElems: 0,
original: 'A<B<C<D>, E>',
returned: [],
- typeFilter: -1,
userQuery: 'a<b<c<d>, e>',
- error: 'Unexpected `<` after `<`',
+ error: 'Unclosed `<`',
},
{
elems: [
@@ -18,6 +24,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "p",
generics: [],
+ typeFilter: -1,
},
{
name: "u8",
@@ -25,12 +32,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "u8",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "p<> u8",
returned: [],
- typeFilter: -1,
userQuery: "p<> u8",
error: null,
},
@@ -50,13 +57,126 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
],
foundElems: 1,
original: '"p"<a>',
returned: [],
- typeFilter: -1,
userQuery: '"p"<a>',
error: null,
},
+ {
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [
+ {
+ name: "u",
+ fullPath: ["u"],
+ pathWithoutLast: [],
+ pathLast: "u",
+ generics: [
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ },
+ ],
+ },
+ ],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 1,
+ original: 'p<u<x>>',
+ returned: [],
+ userQuery: 'p<u<x>>',
+ error: null,
+ },
+ {
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [
+ {
+ name: "u",
+ fullPath: ["u"],
+ pathWithoutLast: [],
+ pathLast: "u",
+ generics: [
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ },
+ ],
+ },
+ {
+ name: "r",
+ fullPath: ["r"],
+ pathWithoutLast: [],
+ pathLast: "r",
+ generics: [],
+ },
+ ],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 1,
+ original: 'p<u<x>, r>',
+ returned: [],
+ userQuery: 'p<u<x>, r>',
+ error: null,
+ },
+ {
+ elems: [
+ {
+ name: "p",
+ fullPath: ["p"],
+ pathWithoutLast: [],
+ pathLast: "p",
+ generics: [
+ {
+ name: "u",
+ fullPath: ["u"],
+ pathWithoutLast: [],
+ pathLast: "u",
+ generics: [
+ {
+ name: "x",
+ fullPath: ["x"],
+ pathWithoutLast: [],
+ pathLast: "x",
+ generics: [],
+ },
+ {
+ name: "r",
+ fullPath: ["r"],
+ pathWithoutLast: [],
+ pathLast: "r",
+ generics: [],
+ },
+ ],
+ },
+ ],
+ typeFilter: -1,
+ },
+ ],
+ foundElems: 1,
+ original: 'p<u<x, r>>',
+ returned: [],
+ userQuery: 'p<u<x, r>>',
+ error: null,
+ },
];
diff --git a/tests/rustdoc-js-std/parser-ident.js b/tests/rustdoc-js-std/parser-ident.js
index 6c17d00f1..be42b7aa4 100644
--- a/tests/rustdoc-js-std/parser-ident.js
+++ b/tests/rustdoc-js-std/parser-ident.js
@@ -23,11 +23,11 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
}],
foundElems: 1,
original: "R<!>",
returned: [],
- typeFilter: -1,
userQuery: "r<!>",
error: null,
},
@@ -38,11 +38,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "!",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: "!",
returned: [],
- typeFilter: -1,
userQuery: "!",
error: null,
},
@@ -53,11 +53,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: 14,
}],
foundElems: 1,
original: "a!",
returned: [],
- typeFilter: 14,
userQuery: "a!",
error: null,
},
@@ -66,7 +66,6 @@ const PARSED = [
foundElems: 0,
original: "a!::b",
returned: [],
- typeFilter: -1,
userQuery: "a!::b",
error: "Cannot have associated items in macros",
},
@@ -77,11 +76,11 @@ const PARSED = [
pathWithoutLast: ["!"],
pathLast: "b",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: "!::b",
returned: [],
- typeFilter: -1,
userQuery: "!::b",
error: null,
},
@@ -90,7 +89,6 @@ const PARSED = [
foundElems: 0,
original: "a!::b!",
returned: [],
- typeFilter: -1,
userQuery: "a!::b!",
error: "Cannot have associated items in macros",
},
diff --git a/tests/rustdoc-js-std/parser-literal.js b/tests/rustdoc-js-std/parser-literal.js
index 87b3baff1..3a31d1bdd 100644
--- a/tests/rustdoc-js-std/parser-literal.js
+++ b/tests/rustdoc-js-std/parser-literal.js
@@ -16,11 +16,11 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
}],
foundElems: 1,
original: "R<P>",
returned: [],
- typeFilter: -1,
userQuery: "r<p>",
error: null,
}
diff --git a/tests/rustdoc-js-std/parser-paths.js b/tests/rustdoc-js-std/parser-paths.js
index 9f823f933..f3e421f5f 100644
--- a/tests/rustdoc-js-std/parser-paths.js
+++ b/tests/rustdoc-js-std/parser-paths.js
@@ -8,11 +8,11 @@ const PARSED = [
pathWithoutLast: ["a"],
pathLast: "b",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: "A::B",
returned: [],
- typeFilter: -1,
userQuery: "a::b",
error: null,
},
@@ -24,6 +24,7 @@ const PARSED = [
pathWithoutLast: ["a"],
pathLast: "b",
generics: [],
+ typeFilter: -1,
},
{
name: "c",
@@ -31,12 +32,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "c",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: 'A::B,C',
returned: [],
- typeFilter: -1,
userQuery: 'a::b,c',
error: null,
},
@@ -56,6 +57,7 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
{
name: "c",
@@ -63,12 +65,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "c",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: 'A::B<f>,C',
returned: [],
- typeFilter: -1,
userQuery: 'a::b<f>,c',
error: null,
},
@@ -79,11 +81,11 @@ const PARSED = [
pathWithoutLast: ["mod"],
pathLast: "a",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: "mod::a",
returned: [],
- typeFilter: -1,
userQuery: "mod::a",
error: null,
},
diff --git a/tests/rustdoc-js-std/parser-quote.js b/tests/rustdoc-js-std/parser-quote.js
index 1e16c90de..d5d67cac8 100644
--- a/tests/rustdoc-js-std/parser-quote.js
+++ b/tests/rustdoc-js-std/parser-quote.js
@@ -19,8 +19,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "p",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: '-> "p"',
error: null,
},
@@ -31,11 +31,11 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "p",
generics: [],
+ typeFilter: -1,
}],
foundElems: 1,
original: '"p",',
returned: [],
- typeFilter: -1,
userQuery: '"p",',
error: null,
},
@@ -44,7 +44,6 @@ const PARSED = [
foundElems: 0,
original: '"p" -> a',
returned: [],
- typeFilter: -1,
userQuery: '"p" -> a',
error: "You cannot have more than one element if you use quotes",
},
@@ -53,7 +52,6 @@ const PARSED = [
foundElems: 0,
original: '"a" -> "p"',
returned: [],
- typeFilter: -1,
userQuery: '"a" -> "p"',
error: "Cannot have more than one literal search element",
},
@@ -62,7 +60,6 @@ const PARSED = [
foundElems: 0,
original: '->"-"',
returned: [],
- typeFilter: -1,
userQuery: '->"-"',
error: 'Unexpected `-` in a string element',
},
@@ -71,7 +68,6 @@ const PARSED = [
foundElems: 0,
original: '"a',
returned: [],
- typeFilter: -1,
userQuery: '"a',
error: 'Unclosed `"`',
},
@@ -80,7 +76,6 @@ const PARSED = [
foundElems: 0,
original: '""',
returned: [],
- typeFilter: -1,
userQuery: '""',
error: 'Cannot have empty string element',
},
diff --git a/tests/rustdoc-js-std/parser-returned.js b/tests/rustdoc-js-std/parser-returned.js
index 6fce17dca..c29813190 100644
--- a/tests/rustdoc-js-std/parser-returned.js
+++ b/tests/rustdoc-js-std/parser-returned.js
@@ -25,8 +25,8 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "-> f<p>",
error: null,
},
@@ -40,8 +40,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "p",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "-> p",
error: null,
},
@@ -55,8 +55,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "->,a",
error: null,
},
@@ -67,6 +67,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "aaaaa",
generics: [],
+ typeFilter: -1,
}],
foundElems: 2,
original: "aaaaa->a",
@@ -76,8 +77,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "aaaaa->a",
error: null,
},
@@ -91,8 +92,8 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "!",
generics: [],
+ typeFilter: -1,
}],
- typeFilter: -1,
userQuery: "-> !",
error: null,
},
diff --git a/tests/rustdoc-js-std/parser-separators.js b/tests/rustdoc-js-std/parser-separators.js
index 5b7abdfa8..fc8c5114c 100644
--- a/tests/rustdoc-js-std/parser-separators.js
+++ b/tests/rustdoc-js-std/parser-separators.js
@@ -19,6 +19,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'aaaaaa',
generics: [],
+ typeFilter: -1,
},
{
name: 'b',
@@ -26,12 +27,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'b',
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "aaaaaa b",
returned: [],
- typeFilter: -1,
userQuery: "aaaaaa b",
error: null,
},
@@ -43,6 +44,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'a',
generics: [],
+ typeFilter: -1,
},
{
name: 'b',
@@ -50,12 +52,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'b',
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a b",
returned: [],
- typeFilter: -1,
userQuery: "a b",
error: null,
},
@@ -67,6 +69,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'a',
generics: [],
+ typeFilter: -1,
},
{
name: 'b',
@@ -74,12 +77,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'b',
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a,b",
returned: [],
- typeFilter: -1,
userQuery: "a,b",
error: null,
},
@@ -91,6 +94,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'a',
generics: [],
+ typeFilter: -1,
},
{
name: 'b',
@@ -98,12 +102,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: 'b',
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a\tb",
returned: [],
- typeFilter: -1,
userQuery: "a\tb",
error: null,
},
@@ -130,12 +134,12 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
],
foundElems: 1,
original: "a<b c>",
returned: [],
- typeFilter: -1,
userQuery: "a<b c>",
error: null,
},
@@ -162,12 +166,12 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
],
foundElems: 1,
original: "a<b,c>",
returned: [],
- typeFilter: -1,
userQuery: "a<b,c>",
error: null,
},
@@ -194,12 +198,12 @@ const PARSED = [
generics: [],
},
],
+ typeFilter: -1,
},
],
foundElems: 1,
original: "a<b\tc>",
returned: [],
- typeFilter: -1,
userQuery: "a<b\tc>",
error: null,
},
diff --git a/tests/rustdoc-js-std/parser-weird-queries.js b/tests/rustdoc-js-std/parser-weird-queries.js
index a3d85aeca..dc1049a70 100644
--- a/tests/rustdoc-js-std/parser-weird-queries.js
+++ b/tests/rustdoc-js-std/parser-weird-queries.js
@@ -20,6 +20,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
},
{
name: "b",
@@ -27,12 +28,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "b",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a b",
returned: [],
- typeFilter: -1,
userQuery: "a b",
error: null,
},
@@ -44,6 +45,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
},
{
name: "b",
@@ -51,12 +53,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "b",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "a b",
returned: [],
- typeFilter: -1,
userQuery: "a b",
error: null,
},
@@ -65,7 +67,6 @@ const PARSED = [
foundElems: 0,
original: "a,b(c)",
returned: [],
- typeFilter: -1,
userQuery: "a,b(c)",
error: "Unexpected `(`",
},
@@ -77,6 +78,7 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "aaa",
generics: [],
+ typeFilter: -1,
},
{
name: "a",
@@ -84,12 +86,12 @@ const PARSED = [
pathWithoutLast: [],
pathLast: "a",
generics: [],
+ typeFilter: -1,
},
],
foundElems: 2,
original: "aaa,a",
returned: [],
- typeFilter: -1,
userQuery: "aaa,a",
error: null,
},
@@ -98,7 +100,6 @@ const PARSED = [
foundElems: 0,
original: ",,,,",
returned: [],
- typeFilter: -1,
userQuery: ",,,,",
error: null,
},
@@ -107,17 +108,15 @@ const PARSED = [
foundElems: 0,
original: 'mod :',
returned: [],
- typeFilter: 0,
userQuery: 'mod :',
- error: null,
+ error: "Unexpected `:` (expected path after type filter)",
},
{
elems: [],
foundElems: 0,
original: 'mod\t:',
returned: [],
- typeFilter: 0,
userQuery: 'mod\t:',
- error: null,
+ error: "Unexpected `:` (expected path after type filter)",
},
];
diff --git a/tests/rustdoc-js-std/println-typo.js b/tests/rustdoc-js-std/println-typo.js
new file mode 100644
index 000000000..7ca3ab8e5
--- /dev/null
+++ b/tests/rustdoc-js-std/println-typo.js
@@ -0,0 +1,12 @@
+// exact-check
+
+const QUERY = 'prinltn';
+const FILTER_CRATE = 'std';
+
+const EXPECTED = {
+ 'others': [
+ { 'path': 'std', 'name': 'println' },
+ { 'path': 'std', 'name': 'print' },
+ { 'path': 'std', 'name': 'eprintln' },
+ ],
+};
diff --git a/tests/rustdoc-js/generics-impl.js b/tests/rustdoc-js/generics-impl.js
index bb6e0041d..5051743bd 100644
--- a/tests/rustdoc-js/generics-impl.js
+++ b/tests/rustdoc-js/generics-impl.js
@@ -5,6 +5,8 @@ const QUERY = [
'Aaaaaaa -> bool',
'Aaaaaaa -> usize',
'Read -> u64',
+ 'trait:Read -> u64',
+ 'struct:Read -> u64',
'bool -> u64',
'Ddddddd -> u64',
'-> Ddddddd'
@@ -37,6 +39,17 @@ const EXPECTED = [
],
},
{
+ // trait:Read -> u64
+ 'others': [
+ { 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' },
+ { 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
+ ],
+ },
+ {
+ // struct:Read -> u64
+ 'others': [],
+ },
+ {
// bool -> u64
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'fffffff' },
diff --git a/tests/rustdoc-js/generics-nested.js b/tests/rustdoc-js/generics-nested.js
new file mode 100644
index 000000000..8701f2d49
--- /dev/null
+++ b/tests/rustdoc-js/generics-nested.js
@@ -0,0 +1,33 @@
+// exact-check
+
+const QUERY = [
+ '-> Out<First<Second>>',
+ '-> Out<Second<First>>',
+ '-> Out<First, Second>',
+ '-> Out<Second, First>',
+];
+
+const EXPECTED = [
+ {
+ // -> Out<First<Second>>
+ 'others': [
+ { 'path': 'generics_nested', 'name': 'alef' },
+ ],
+ },
+ {
+ // -> Out<Second<First>>
+ 'others': [],
+ },
+ {
+ // -> Out<First, Second>
+ 'others': [
+ { 'path': 'generics_nested', 'name': 'bet' },
+ ],
+ },
+ {
+ // -> Out<Second, First>
+ 'others': [
+ { 'path': 'generics_nested', 'name': 'bet' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js/generics-nested.rs b/tests/rustdoc-js/generics-nested.rs
new file mode 100644
index 000000000..5140422e3
--- /dev/null
+++ b/tests/rustdoc-js/generics-nested.rs
@@ -0,0 +1,19 @@
+pub struct Out<A, B = ()> {
+ a: A,
+ b: B,
+}
+
+pub struct First<In = ()> {
+ in_: In,
+}
+
+pub struct Second;
+
+// Out<First<Second>>
+pub fn alef() -> Out<First<Second>> {
+ loop {}
+}
+
+pub fn bet() -> Out<First, Second> {
+ loop {}
+}
diff --git a/tests/rustdoc-js/generics.js b/tests/rustdoc-js/generics.js
index 5e5ba7cd9..f79c709ad 100644
--- a/tests/rustdoc-js/generics.js
+++ b/tests/rustdoc-js/generics.js
@@ -2,6 +2,8 @@
const QUERY = [
'R<P>',
+ 'R<struct:P>',
+ 'R<enum:P>',
'"P"',
'P',
'ExtraCreditStructMulti<ExtraCreditInnerMulti, ExtraCreditInnerMulti>',
@@ -21,6 +23,20 @@ const EXPECTED = [
],
},
{
+ // R<struct:P>
+ 'returned': [
+ { 'path': 'generics', 'name': 'alef' },
+ ],
+ 'in_args': [
+ { 'path': 'generics', 'name': 'alpha' },
+ ],
+ },
+ {
+ // R<enum:P>
+ 'returned': [],
+ 'in_args': [],
+ },
+ {
// "P"
'others': [
{ 'path': 'generics', 'name': 'P' },
diff --git a/tests/rustdoc-js/primitive.js b/tests/rustdoc-js/primitive.js
index 918f70999..4aec98c34 100644
--- a/tests/rustdoc-js/primitive.js
+++ b/tests/rustdoc-js/primitive.js
@@ -3,6 +3,8 @@
const QUERY = [
"i32",
"str",
+ "primitive:str",
+ "struct:str",
"TotoIsSomewhere",
];
@@ -18,6 +20,14 @@ const EXPECTED = [
],
},
{
+ 'returned': [
+ { 'path': 'primitive', 'name': 'foo' },
+ ],
+ },
+ {
+ 'returned': [],
+ },
+ {
'others': [],
'in_args': [],
'returned': [],
diff --git a/tests/rustdoc-js/search-bag-semantics.js b/tests/rustdoc-js/search-bag-semantics.js
new file mode 100644
index 000000000..c56a3df5f
--- /dev/null
+++ b/tests/rustdoc-js/search-bag-semantics.js
@@ -0,0 +1,20 @@
+// exact-check
+
+const QUERY = [
+ 'P',
+ 'P, P',
+];
+
+const EXPECTED = [
+ {
+ 'in_args': [
+ { 'path': 'search_bag_semantics', 'name': 'alacazam' },
+ { 'path': 'search_bag_semantics', 'name': 'abracadabra' },
+ ],
+ },
+ {
+ 'others': [
+ { 'path': 'search_bag_semantics', 'name': 'abracadabra' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js/search-bag-semantics.rs b/tests/rustdoc-js/search-bag-semantics.rs
new file mode 100644
index 000000000..546572dc4
--- /dev/null
+++ b/tests/rustdoc-js/search-bag-semantics.rs
@@ -0,0 +1,4 @@
+pub struct P;
+
+pub fn abracadabra(a: P, b: P) {}
+pub fn alacazam(a: P) {}
diff --git a/tests/rustdoc-js/where-clause.js b/tests/rustdoc-js/where-clause.js
new file mode 100644
index 000000000..86254a80e
--- /dev/null
+++ b/tests/rustdoc-js/where-clause.js
@@ -0,0 +1,30 @@
+const QUERY = ['trait<nested>', '-> trait<nested>', 't1, t2', '-> shazam', 'drizzel -> shazam'];
+
+const EXPECTED = [
+ {
+ 'in_args': [
+ { 'path': 'where_clause', 'name': 'abracadabra' },
+ ],
+ },
+ {
+ 'others': [
+ { 'path': 'where_clause', 'name': 'alacazam' },
+ ],
+ },
+ {
+ 'others': [
+ { 'path': 'where_clause', 'name': 'presto' },
+ ],
+ },
+ {
+ 'others': [
+ { 'path': 'where_clause', 'name': 'bippety' },
+ { 'path': 'where_clause::Drizzel', 'name': 'boppety' },
+ ],
+ },
+ {
+ 'others': [
+ { 'path': 'where_clause::Drizzel', 'name': 'boppety' },
+ ],
+ },
+];
diff --git a/tests/rustdoc-js/where-clause.rs b/tests/rustdoc-js/where-clause.rs
new file mode 100644
index 000000000..56c01019f
--- /dev/null
+++ b/tests/rustdoc-js/where-clause.rs
@@ -0,0 +1,30 @@
+pub struct Nested;
+
+pub trait Trait<T> {
+ fn thank_you(x: T);
+}
+
+pub fn abracadabra<X>(_: X) where X: Trait<Nested> {}
+
+pub fn alacazam<X>() -> X where X: Trait<Nested> {}
+
+pub trait T1 {}
+pub trait T2<'a, T> {
+ fn please(_: &'a T);
+}
+
+pub fn presto<A, B>(_: A, _: B) where A: T1, B: for <'b> T2<'b, Nested> {}
+
+pub trait Shazam {}
+
+pub fn bippety<X>() -> &'static X where X: Shazam {
+ panic!()
+}
+
+pub struct Drizzel<T>(T);
+
+impl<T> Drizzel<T> {
+ pub fn boppety(&self) -> &T where T: Shazam {
+ panic!();
+ }
+}
diff --git a/tests/rustdoc-json/fns/extern_c_variadic.rs b/tests/rustdoc-json/fns/extern_c_variadic.rs
new file mode 100644
index 000000000..33bebbab5
--- /dev/null
+++ b/tests/rustdoc-json/fns/extern_c_variadic.rs
@@ -0,0 +1,9 @@
+#![feature(no_core)]
+#![no_core]
+
+extern "C" {
+ // @is "$.index[*][?(@.name == 'not_variadic')].inner.decl.c_variadic" false
+ pub fn not_variadic(_: i32);
+ // @is "$.index[*][?(@.name == 'variadic')].inner.decl.c_variadic" true
+ pub fn variadic(_: i32, ...);
+}
diff --git a/tests/rustdoc-json/impls/local_for_local_primitive.rs b/tests/rustdoc-json/impls/local_for_local_primitive.rs
index 38e7e2658..8383dcc04 100644
--- a/tests/rustdoc-json/impls/local_for_local_primitive.rs
+++ b/tests/rustdoc-json/impls/local_for_local_primitive.rs
@@ -1,5 +1,5 @@
#![feature(no_core)]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![no_core]
// @set Local = "$.index[*][?(@.name=='Local')].id"
@@ -16,6 +16,6 @@ impl Local for bool {}
// FIXME(#101695): Test bool's `impls` include "Local for bool"
// @has "$.index[*][?(@.name=='bool')]"
-#[doc(primitive = "bool")]
+#[rustc_doc_primitive = "bool"]
/// Boolean docs
mod prim_bool {}
diff --git a/tests/rustdoc-json/non_lifetime_binders.rs b/tests/rustdoc-json/non_lifetime_binders.rs
new file mode 100644
index 000000000..ca5a00834
--- /dev/null
+++ b/tests/rustdoc-json/non_lifetime_binders.rs
@@ -0,0 +1,24 @@
+// ignore-tidy-linelength
+
+#![feature(non_lifetime_binders)]
+#![allow(incomplete_features)]
+
+#![no_core]
+#![feature(lang_items, no_core)]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+pub trait Trait {}
+
+#[lang = "phantom_data"]
+struct PhantomData<T_>;
+
+pub struct Wrapper<T_>(PhantomData<T_>);
+
+// @count "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[*]" 2
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[0].name" \"\'a\"
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[1].name" \"T\"
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[1].kind" '{ "type": { "bounds": [], "default": null, "synthetic": false } }'
+pub fn foo() where for<'a, T> &'a Wrapper<T>: Trait {}
diff --git a/tests/rustdoc-json/primitives/local_primitive.rs b/tests/rustdoc-json/primitives/local_primitive.rs
index f27e6a2ad..0cf479faf 100644
--- a/tests/rustdoc-json/primitives/local_primitive.rs
+++ b/tests/rustdoc-json/primitives/local_primitive.rs
@@ -8,7 +8,7 @@
//! Link to [i32][prim@i32] [i64][prim@i64]
-#[doc(primitive = "i32")]
+#[rustc_doc_primitive = "i32"]
mod prim_i32 {}
// @set local_i32 = "$.index[*][?(@.name=='i32')].id"
diff --git a/tests/rustdoc-json/primitives/primitive_impls.rs b/tests/rustdoc-json/primitives/primitive_impls.rs
index 1fc937406..85d179ee4 100644
--- a/tests/rustdoc-json/primitives/primitive_impls.rs
+++ b/tests/rustdoc-json/primitives/primitive_impls.rs
@@ -25,7 +25,7 @@ pub trait Trait {}
impl Trait for i32 {}
/// i32
-#[doc(primitive = "i32")]
+#[rustc_doc_primitive = "i32"]
mod prim_i32 {}
// @set i32 = "$.index[*][?(@.docs=='i32')].id"
diff --git a/tests/rustdoc-json/primitives/primitive_overloading.rs b/tests/rustdoc-json/primitives/primitive_overloading.rs
index 56b35cd14..81e0acdc6 100644
--- a/tests/rustdoc-json/primitives/primitive_overloading.rs
+++ b/tests/rustdoc-json/primitives/primitive_overloading.rs
@@ -2,7 +2,7 @@
// Regression test for <https://github.com/rust-lang/rust/issues/98006>.
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![feature(no_core)]
#![no_core]
@@ -10,7 +10,7 @@
// @has "$.index[*][?(@.name=='usize')]"
// @has "$.index[*][?(@.name=='prim')]"
-#[doc(primitive = "usize")]
+#[rustc_doc_primitive = "usize"]
/// This is the built-in type `usize`.
mod prim {
}
diff --git a/tests/rustdoc-json/primitives/use_primitive.rs b/tests/rustdoc-json/primitives/use_primitive.rs
index e22927374..5180a804f 100644
--- a/tests/rustdoc-json/primitives/use_primitive.rs
+++ b/tests/rustdoc-json/primitives/use_primitive.rs
@@ -1,8 +1,8 @@
// edition:2018
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
-#[doc(primitive = "usize")]
+#[rustc_doc_primitive = "usize"]
mod usize {}
// @set local_crate_id = "$.index[*][?(@.name=='use_primitive')].crate_id"
diff --git a/tests/rustdoc-ui/c-help.rs b/tests/rustdoc-ui/c-help.rs
deleted file mode 100644
index e166edf8b..000000000
--- a/tests/rustdoc-ui/c-help.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-// check-pass
-// compile-flags: -Chelp
-// check-stdout
-// regex-error-pattern: -C\s+incremental
-
-pub struct Foo;
diff --git a/tests/rustdoc-ui/c-help.stdout b/tests/rustdoc-ui/c-help.stdout
deleted file mode 100644
index 75b2e2a2a..000000000
--- a/tests/rustdoc-ui/c-help.stdout
+++ /dev/null
@@ -1,51 +0,0 @@
- -C ar=val -- this option is deprecated and does nothing
- -C code-model=val -- choose the code model to use (`rustc --print code-models` for details)
- -C codegen-units=val -- divide crate into N units to optimize in parallel
- -C control-flow-guard=val -- use Windows Control Flow Guard (default: no)
- -C debug-assertions=val -- explicitly enable the `cfg(debug_assertions)` directive
- -C debuginfo=val -- debug info emission level (0 = no debug info, 1 = line tables only, 2 = full debug info with variable and type information; default: 0)
- -C default-linker-libraries=val -- allow the linker to link its default libraries (default: no)
- -C embed-bitcode=val -- emit bitcode in rlibs (default: yes)
- -C extra-filename=val -- extra data to put in each output filename
- -C force-frame-pointers=val -- force use of the frame pointers
- -C force-unwind-tables=val -- force use of unwind tables
- -C incremental=val -- enable incremental compilation
- -C inline-threshold=val -- set the threshold for inlining a function
- -C instrument-coverage=val -- instrument the generated code to support LLVM source-based code coverage reports (note, the compiler build config must include `profiler = true`); implies `-C symbol-mangling-version=v0`. Optional values are:
- `=all` (implicit value)
- `=except-unused-generics`
- `=except-unused-functions`
- `=off` (default)
- -C link-arg=val -- a single extra argument to append to the linker invocation (can be used several times)
- -C link-args=val -- extra arguments to append to the linker invocation (space separated)
- -C link-dead-code=val -- keep dead code at link time (useful for code coverage) (default: no)
- -C link-self-contained=val -- control whether to link Rust provided C objects/libraries or rely
- on C toolchain installed in the system
- -C linker=val -- system linker to link outputs with
- -C linker-flavor=val -- linker flavor
- -C linker-plugin-lto=val -- generate build artifacts that are compatible with linker-based LTO
- -C llvm-args=val -- a list of arguments to pass to LLVM (space separated)
- -C lto=val -- perform LLVM link-time optimizations
- -C metadata=val -- metadata to mangle symbol names with
- -C no-prepopulate-passes=val -- give an empty list of passes to the pass manager
- -C no-redzone=val -- disable the use of the redzone
- -C no-stack-check=val -- this option is deprecated and does nothing
- -C no-vectorize-loops=val -- disable loop vectorization optimization passes
- -C no-vectorize-slp=val -- disable LLVM's SLP vectorization pass
- -C opt-level=val -- optimization level (0-3, s, or z; default: 0)
- -C overflow-checks=val -- use overflow checks for integer arithmetic
- -C panic=val -- panic strategy to compile crate with
- -C passes=val -- a list of extra LLVM passes to run (space separated)
- -C prefer-dynamic=val -- prefer dynamic linking to static linking (default: no)
- -C profile-generate=val -- compile the program with profiling instrumentation
- -C profile-use=val -- use the given `.profdata` file for profile-guided optimization
- -C relocation-model=val -- control generation of position-independent code (PIC) (`rustc --print relocation-models` for details)
- -C remark=val -- print remarks for these optimization passes (space separated, or "all")
- -C rpath=val -- set rpath values in libs/exes (default: no)
- -C save-temps=val -- save all temporary output files during compilation (default: no)
- -C soft-float=val -- use soft float ABI (*eabihf targets only) (default: no)
- -C split-debuginfo=val -- how to handle split-debuginfo, a platform-specific option
- -C strip=val -- tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)
- -C symbol-mangling-version=val -- which mangling version to use for symbol names ('legacy' (default) or 'v0')
- -C target-cpu=val -- select target processor (`rustc --print target-cpus` for details)
- -C target-feature=val -- target specific attributes. (`rustc --print target-features` for details). This feature is unsafe.
diff --git a/tests/rustdoc-ui/const_arg_in_type_position.rs b/tests/rustdoc-ui/const_arg_in_type_position.rs
new file mode 100644
index 000000000..4969e8d19
--- /dev/null
+++ b/tests/rustdoc-ui/const_arg_in_type_position.rs
@@ -0,0 +1,6 @@
+type Array<T, const N: usize> = [T; N];
+
+fn foo<const N: usize>() -> Array<N, ()> {
+ //~^ ERROR constant provided when a type was expected
+ unimplemented!()
+}
diff --git a/tests/rustdoc-ui/const_arg_in_type_position.stderr b/tests/rustdoc-ui/const_arg_in_type_position.stderr
new file mode 100644
index 000000000..ea05920de
--- /dev/null
+++ b/tests/rustdoc-ui/const_arg_in_type_position.stderr
@@ -0,0 +1,9 @@
+error[E0747]: constant provided when a type was expected
+ --> $DIR/const_arg_in_type_position.rs:3:35
+ |
+LL | fn foo<const N: usize>() -> Array<N, ()> {
+ | ^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0747`.
diff --git a/tests/rustdoc-ui/coverage/exotic.rs b/tests/rustdoc-ui/coverage/exotic.rs
index 72b70d698..f45405fbf 100644
--- a/tests/rustdoc-ui/coverage/exotic.rs
+++ b/tests/rustdoc-ui/coverage/exotic.rs
@@ -2,12 +2,13 @@
// check-pass
#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
//! the features only used in std also have entries in the table, so make sure those get pulled out
//! properly as well
/// woo, check it out, we can write our own primitive docs lol
-#[doc(primitive="unit")]
+#[rustc_doc_primitive = "unit"]
mod prim_unit {}
/// keywords? sure, pile them on
diff --git a/tests/rustdoc-ui/crate-reference-in-block-module.rs b/tests/rustdoc-ui/crate-reference-in-block-module.rs
new file mode 100644
index 000000000..aede030e0
--- /dev/null
+++ b/tests/rustdoc-ui/crate-reference-in-block-module.rs
@@ -0,0 +1,5 @@
+// check-pass
+fn main() {
+ /// [](crate)
+ struct X;
+}
diff --git a/tests/rustdoc-ui/crate-reference-in-block-module.stderr b/tests/rustdoc-ui/crate-reference-in-block-module.stderr
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/rustdoc-ui/crate-reference-in-block-module.stderr
diff --git a/tests/rustdoc-ui/intra-doc/ambiguity.rs b/tests/rustdoc-ui/intra-doc/ambiguity.rs
index 1f3dc722e..0290b8582 100644
--- a/tests/rustdoc-ui/intra-doc/ambiguity.rs
+++ b/tests/rustdoc-ui/intra-doc/ambiguity.rs
@@ -35,6 +35,6 @@ pub mod foo {
/// Ambiguous non-implied shortcut link [`foo::bar`]. //~ERROR `foo::bar`
pub struct Docs {}
-/// [true] //~ ERROR `true` is both a module and a builtin type
+/// [true] //~ ERROR `true` is both a module and a primitive type
/// [primitive@true]
pub mod r#true {}
diff --git a/tests/rustdoc-ui/intra-doc/ambiguity.stderr b/tests/rustdoc-ui/intra-doc/ambiguity.stderr
index 7974796e4..47853e0b5 100644
--- a/tests/rustdoc-ui/intra-doc/ambiguity.stderr
+++ b/tests/rustdoc-ui/intra-doc/ambiguity.stderr
@@ -1,4 +1,4 @@
-error: `true` is both a module and a builtin type
+error: `true` is both a module and a primitive type
--> $DIR/ambiguity.rs:38:6
|
LL | /// [true]
@@ -13,89 +13,89 @@ help: to link to the module, prefix with `mod@`
|
LL | /// [mod@true]
| ++++
-help: to link to the builtin type, prefix with `prim@`
+help: to link to the primitive type, prefix with `prim@`
|
LL | /// [prim@true]
| +++++
-error: `ambiguous` is both a struct and a function
+error: `ambiguous` is both a function and a struct
--> $DIR/ambiguity.rs:27:7
|
LL | /// [`ambiguous`] is ambiguous.
| ^^^^^^^^^ ambiguous link
|
-help: to link to the struct, prefix with `struct@`
- |
-LL | /// [`struct@ambiguous`] is ambiguous.
- | +++++++
help: to link to the function, add parentheses
|
LL | /// [`ambiguous()`] is ambiguous.
| ++
+help: to link to the struct, prefix with `struct@`
+ |
+LL | /// [`struct@ambiguous`] is ambiguous.
+ | +++++++
-error: `ambiguous` is both a struct and a function
+error: `ambiguous` is both a function and a struct
--> $DIR/ambiguity.rs:29:6
|
LL | /// [ambiguous] is ambiguous.
| ^^^^^^^^^ ambiguous link
|
-help: to link to the struct, prefix with `struct@`
- |
-LL | /// [struct@ambiguous] is ambiguous.
- | +++++++
help: to link to the function, add parentheses
|
LL | /// [ambiguous()] is ambiguous.
| ++
+help: to link to the struct, prefix with `struct@`
+ |
+LL | /// [struct@ambiguous] is ambiguous.
+ | +++++++
-error: `multi_conflict` is a struct, a function, and a macro
+error: `multi_conflict` is a function, a struct, and a macro
--> $DIR/ambiguity.rs:31:7
|
LL | /// [`multi_conflict`] is a three-way conflict.
| ^^^^^^^^^^^^^^ ambiguous link
|
-help: to link to the struct, prefix with `struct@`
- |
-LL | /// [`struct@multi_conflict`] is a three-way conflict.
- | +++++++
help: to link to the function, add parentheses
|
LL | /// [`multi_conflict()`] is a three-way conflict.
| ++
+help: to link to the struct, prefix with `struct@`
+ |
+LL | /// [`struct@multi_conflict`] is a three-way conflict.
+ | +++++++
help: to link to the macro, add an exclamation mark
|
LL | /// [`multi_conflict!`] is a three-way conflict.
| +
-error: `type_and_value` is both a module and a constant
+error: `type_and_value` is both a constant and a module
--> $DIR/ambiguity.rs:33:16
|
LL | /// Ambiguous [type_and_value].
| ^^^^^^^^^^^^^^ ambiguous link
|
-help: to link to the module, prefix with `mod@`
- |
-LL | /// Ambiguous [mod@type_and_value].
- | ++++
help: to link to the constant, prefix with `const@`
|
LL | /// Ambiguous [const@type_and_value].
| ++++++
+help: to link to the module, prefix with `mod@`
+ |
+LL | /// Ambiguous [mod@type_and_value].
+ | ++++
-error: `foo::bar` is both an enum and a function
+error: `foo::bar` is both a function and an enum
--> $DIR/ambiguity.rs:35:43
|
LL | /// Ambiguous non-implied shortcut link [`foo::bar`].
| ^^^^^^^^ ambiguous link
|
-help: to link to the enum, prefix with `enum@`
- |
-LL | /// Ambiguous non-implied shortcut link [`enum@foo::bar`].
- | +++++
help: to link to the function, add parentheses
|
LL | /// Ambiguous non-implied shortcut link [`foo::bar()`].
| ++
+help: to link to the enum, prefix with `enum@`
+ |
+LL | /// Ambiguous non-implied shortcut link [`enum@foo::bar`].
+ | +++++
error: aborting due to 6 previous errors
diff --git a/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-doc.rs b/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-doc.rs
new file mode 100644
index 000000000..15bf51e6f
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-doc.rs
@@ -0,0 +1 @@
+//! Inner doc comment
diff --git a/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-enum.rs b/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-enum.rs
new file mode 100644
index 000000000..6c48f5aa0
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-enum.rs
@@ -0,0 +1,3 @@
+pub enum O {
+ L = -1,
+}
diff --git a/tests/rustdoc-ui/intra-doc/errors.rs b/tests/rustdoc-ui/intra-doc/errors.rs
index 95dd2b98e..f37f49c24 100644
--- a/tests/rustdoc-ui/intra-doc/errors.rs
+++ b/tests/rustdoc-ui/intra-doc/errors.rs
@@ -54,11 +54,11 @@
/// [u8::not_found]
//~^ ERROR unresolved link
-//~| NOTE the builtin type `u8` has no associated item named `not_found`
+//~| NOTE the primitive type `u8` has no associated item named `not_found`
/// [std::primitive::u8::not_found]
//~^ ERROR unresolved link
-//~| NOTE the builtin type `u8` has no associated item named `not_found`
+//~| NOTE the primitive type `u8` has no associated item named `not_found`
/// [type@Vec::into_iter]
//~^ ERROR unresolved link
diff --git a/tests/rustdoc-ui/intra-doc/errors.stderr b/tests/rustdoc-ui/intra-doc/errors.stderr
index 1b2416d7d..a982bba00 100644
--- a/tests/rustdoc-ui/intra-doc/errors.stderr
+++ b/tests/rustdoc-ui/intra-doc/errors.stderr
@@ -80,13 +80,13 @@ error: unresolved link to `u8::not_found`
--> $DIR/errors.rs:55:6
|
LL | /// [u8::not_found]
- | ^^^^^^^^^^^^^ the builtin type `u8` has no associated item named `not_found`
+ | ^^^^^^^^^^^^^ the primitive type `u8` has no associated item named `not_found`
error: unresolved link to `std::primitive::u8::not_found`
--> $DIR/errors.rs:59:6
|
LL | /// [std::primitive::u8::not_found]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the builtin type `u8` has no associated item named `not_found`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the primitive type `u8` has no associated item named `not_found`
error: unresolved link to `Vec::into_iter`
--> $DIR/errors.rs:63:6
diff --git a/tests/rustdoc-ui/intra-doc/import-inline-merge-module.rs b/tests/rustdoc-ui/intra-doc/import-inline-merge-module.rs
new file mode 100644
index 000000000..4d6a32566
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/import-inline-merge-module.rs
@@ -0,0 +1,10 @@
+// Test for issue #108501.
+// Module parent scope doesn't hijack import's parent scope for the import's doc links.
+
+// check-pass
+// aux-build: inner-crate-doc.rs
+// compile-flags: --extern inner_crate_doc --edition 2018
+
+/// Import doc comment [inner_crate_doc]
+#[doc(inline)]
+pub use inner_crate_doc;
diff --git a/tests/rustdoc-ui/intra-doc/inline-external-enum.rs b/tests/rustdoc-ui/intra-doc/inline-external-enum.rs
new file mode 100644
index 000000000..363dd7f64
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/inline-external-enum.rs
@@ -0,0 +1,8 @@
+// check-pass
+// aux-build: inner-crate-enum.rs
+// compile-flags:-Z unstable-options --output-format json
+
+#[doc(inline)]
+pub extern crate inner_crate_enum;
+
+fn main() {}
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-10.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-10.rs
new file mode 100644
index 000000000..464c5f0d5
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-10.rs
@@ -0,0 +1,22 @@
+// This test ensures that this warning doesn't show up:
+// warning: `PartialEq` is both a trait and a derive macro
+// --> tests/rustdoc-ui/intra-doc/issue-108653-associated-items-10.rs:1:7
+// |
+// 1 | //! [`PartialEq`]
+// | ^^^^^^^^^ ambiguous link
+// |
+// = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
+// help: to link to the trait, prefix with `trait@`
+// |
+// 1 | //! [`trait@PartialEq`]
+// | ++++++
+// help: to link to the derive macro, prefix with `derive@`
+// |
+// 1 | //! [`derive@PartialEq`]
+// | +++++++
+
+// check-pass
+
+#![deny(rustdoc::broken_intra_doc_links)]
+
+//! [`PartialEq`]
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-2.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-2.rs
new file mode 100644
index 000000000..cbe60f746
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-2.rs
@@ -0,0 +1,17 @@
+// This is ensuring that the UI output for associated items is as expected.
+
+#![deny(rustdoc::broken_intra_doc_links)]
+
+/// [`Trait::IDENT`]
+//~^ ERROR both an associated constant and an associated type
+pub trait Trait {
+ type IDENT;
+ const IDENT: usize;
+}
+
+/// [`Trait2::IDENT`]
+//~^ ERROR both an associated function and an associated type
+pub trait Trait2 {
+ type IDENT;
+ fn IDENT() {}
+}
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-2.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-2.stderr
new file mode 100644
index 000000000..952392548
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-2.stderr
@@ -0,0 +1,37 @@
+error: `Trait::IDENT` is both an associated constant and an associated type
+ --> $DIR/issue-108653-associated-items-2.rs:5:7
+ |
+LL | /// [`Trait::IDENT`]
+ | ^^^^^^^^^^^^ ambiguous link
+ |
+note: the lint level is defined here
+ --> $DIR/issue-108653-associated-items-2.rs:3:9
+ |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@Trait::IDENT`]
+ | ++++++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@Trait::IDENT`]
+ | +++++
+
+error: `Trait2::IDENT` is both an associated function and an associated type
+ --> $DIR/issue-108653-associated-items-2.rs:12:7
+ |
+LL | /// [`Trait2::IDENT`]
+ | ^^^^^^^^^^^^^ ambiguous link
+ |
+help: to link to the associated function, add parentheses
+ |
+LL | /// [`Trait2::IDENT()`]
+ | ++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@Trait2::IDENT`]
+ | +++++
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-3.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-3.rs
new file mode 100644
index 000000000..7ffd0a40e
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-3.rs
@@ -0,0 +1,16 @@
+// This is ensuring that the UI output for associated items works when it's being documented
+// from another item.
+
+#![deny(rustdoc::broken_intra_doc_links)]
+#![allow(nonstandard_style)]
+
+pub trait Trait {
+ type Trait;
+ const Trait: usize;
+}
+
+/// [`Trait`]
+//~^ ERROR both a constant and a trait
+/// [`Trait::Trait`]
+//~^ ERROR both an associated constant and an associated type
+pub const Trait: usize = 0;
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-3.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-3.stderr
new file mode 100644
index 000000000..6401dacb5
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-3.stderr
@@ -0,0 +1,37 @@
+error: `Trait` is both a constant and a trait
+ --> $DIR/issue-108653-associated-items-3.rs:12:7
+ |
+LL | /// [`Trait`]
+ | ^^^^^ ambiguous link
+ |
+note: the lint level is defined here
+ --> $DIR/issue-108653-associated-items-3.rs:4:9
+ |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the constant, prefix with `const@`
+ |
+LL | /// [`const@Trait`]
+ | ++++++
+help: to link to the trait, prefix with `trait@`
+ |
+LL | /// [`trait@Trait`]
+ | ++++++
+
+error: `Trait::Trait` is both an associated constant and an associated type
+ --> $DIR/issue-108653-associated-items-3.rs:14:7
+ |
+LL | /// [`Trait::Trait`]
+ | ^^^^^^^^^^^^ ambiguous link
+ |
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@Trait::Trait`]
+ | ++++++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@Trait::Trait`]
+ | +++++
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-4.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-4.rs
new file mode 100644
index 000000000..537d61364
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-4.rs
@@ -0,0 +1,21 @@
+// This is ensuring that the UI output for associated items works when it's being documented
+// from another item.
+
+#![deny(rustdoc::broken_intra_doc_links)]
+#![allow(nonstandard_style)]
+
+pub trait Trait {
+ type Trait;
+}
+
+/// [`Struct::Trait`]
+//~^ ERROR both an associated constant and an associated type
+pub struct Struct;
+
+impl Trait for Struct {
+ type Trait = Struct;
+}
+
+impl Struct {
+ pub const Trait: usize = 0;
+}
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-4.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-4.stderr
new file mode 100644
index 000000000..a8dc91204
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-4.stderr
@@ -0,0 +1,22 @@
+error: `Struct::Trait` is both an associated constant and an associated type
+ --> $DIR/issue-108653-associated-items-4.rs:11:7
+ |
+LL | /// [`Struct::Trait`]
+ | ^^^^^^^^^^^^^ ambiguous link
+ |
+note: the lint level is defined here
+ --> $DIR/issue-108653-associated-items-4.rs:4:9
+ |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@Struct::Trait`]
+ | ++++++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@Struct::Trait`]
+ | +++++
+
+error: aborting due to previous error
+
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-5.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-5.rs
new file mode 100644
index 000000000..bc28bc544
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-5.rs
@@ -0,0 +1,8 @@
+#![deny(rustdoc::broken_intra_doc_links)]
+#![allow(nonstandard_style)]
+
+/// [`u32::MAX`]
+//~^ ERROR both an associated constant and a trait
+pub mod u32 {
+ pub trait MAX {}
+}
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-5.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-5.stderr
new file mode 100644
index 000000000..7430044ac
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-5.stderr
@@ -0,0 +1,22 @@
+error: `u32::MAX` is both an associated constant and a trait
+ --> $DIR/issue-108653-associated-items-5.rs:4:7
+ |
+LL | /// [`u32::MAX`]
+ | ^^^^^^^^ ambiguous link
+ |
+note: the lint level is defined here
+ --> $DIR/issue-108653-associated-items-5.rs:1:9
+ |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@u32::MAX`]
+ | ++++++
+help: to link to the trait, prefix with `trait@`
+ |
+LL | /// [`trait@u32::MAX`]
+ | ++++++
+
+error: aborting due to previous error
+
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-6.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-6.rs
new file mode 100644
index 000000000..8fde74d0d
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-6.rs
@@ -0,0 +1,8 @@
+#![deny(rustdoc::broken_intra_doc_links)]
+#![allow(nonstandard_style)]
+
+/// [`u32::MAX`]
+//~^ ERROR both an associated constant and a primitive type
+pub mod u32 {
+ pub use std::primitive::u32 as MAX;
+}
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-6.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-6.stderr
new file mode 100644
index 000000000..fe2d8cafa
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-6.stderr
@@ -0,0 +1,22 @@
+error: `u32::MAX` is both an associated constant and a primitive type
+ --> $DIR/issue-108653-associated-items-6.rs:4:7
+ |
+LL | /// [`u32::MAX`]
+ | ^^^^^^^^ ambiguous link
+ |
+note: the lint level is defined here
+ --> $DIR/issue-108653-associated-items-6.rs:1:9
+ |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@u32::MAX`]
+ | ++++++
+help: to link to the primitive type, prefix with `prim@`
+ |
+LL | /// [`prim@u32::MAX`]
+ | +++++
+
+error: aborting due to previous error
+
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-7.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-7.rs
new file mode 100644
index 000000000..6e99f4365
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-7.rs
@@ -0,0 +1,12 @@
+#![deny(rustdoc::broken_intra_doc_links)]
+#![allow(nonstandard_style)]
+
+pub trait Trait {
+ type MAX;
+}
+
+/// [`u32::MAX`]
+//~^ ERROR both an associated constant and an associated type
+impl Trait for u32 {
+ type MAX = u32;
+}
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-7.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-7.stderr
new file mode 100644
index 000000000..1d302ff42
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-7.stderr
@@ -0,0 +1,22 @@
+error: `u32::MAX` is both an associated constant and an associated type
+ --> $DIR/issue-108653-associated-items-7.rs:8:7
+ |
+LL | /// [`u32::MAX`]
+ | ^^^^^^^^ ambiguous link
+ |
+note: the lint level is defined here
+ --> $DIR/issue-108653-associated-items-7.rs:1:9
+ |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@u32::MAX`]
+ | ++++++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@u32::MAX`]
+ | +++++
+
+error: aborting due to previous error
+
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-8.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-8.rs
new file mode 100644
index 000000000..2f8ee1566
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-8.rs
@@ -0,0 +1,12 @@
+#![deny(rustdoc::broken_intra_doc_links)]
+#![allow(nonstandard_style)]
+
+/// [`u32::MAX`]
+//~^ ERROR both an associated constant and an associated type
+pub trait T {
+ type MAX;
+}
+
+impl T for u32 {
+ type MAX = ();
+}
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-8.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-8.stderr
new file mode 100644
index 000000000..efed0e2ce
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-8.stderr
@@ -0,0 +1,22 @@
+error: `u32::MAX` is both an associated constant and an associated type
+ --> $DIR/issue-108653-associated-items-8.rs:4:7
+ |
+LL | /// [`u32::MAX`]
+ | ^^^^^^^^ ambiguous link
+ |
+note: the lint level is defined here
+ --> $DIR/issue-108653-associated-items-8.rs:1:9
+ |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@u32::MAX`]
+ | ++++++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@u32::MAX`]
+ | +++++
+
+error: aborting due to previous error
+
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-9.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-9.rs
new file mode 100644
index 000000000..3357ccf24
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items-9.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+#![deny(warnings)]
+
+//! [usize::Item]
+
+pub trait Foo { type Item; }
+pub trait Bar { type Item; }
+
+impl Foo for usize { type Item = u32; }
+impl Bar for usize { type Item = i32; }
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.rs b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.rs
new file mode 100644
index 000000000..0a393e26d
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.rs
@@ -0,0 +1,35 @@
+// This is ensuring that the UI output for associated items is as expected.
+
+#![deny(rustdoc::broken_intra_doc_links)]
+
+pub enum Enum {
+ IDENT,
+}
+
+/// [`Self::IDENT`]
+//~^ ERROR both an associated function and an associated type
+pub trait Trait {
+ type IDENT;
+ fn IDENT();
+}
+
+/// [`Self::IDENT`]
+//~^ ERROR both an associated function and a variant
+impl Trait for Enum {
+ type IDENT = usize;
+ fn IDENT() {}
+}
+
+/// [`Self::IDENT2`]
+//~^ ERROR both an associated constant and an associated type
+pub trait Trait2 {
+ type IDENT2;
+ const IDENT2: usize;
+}
+
+/// [`Self::IDENT2`]
+//~^ ERROR both an associated constant and an associated type
+impl Trait2 for Enum {
+ type IDENT2 = usize;
+ const IDENT2: usize = 0;
+}
diff --git a/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.stderr b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.stderr
new file mode 100644
index 000000000..ed89fa839
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/issue-108653-associated-items.stderr
@@ -0,0 +1,67 @@
+error: `Self::IDENT` is both an associated function and an associated type
+ --> $DIR/issue-108653-associated-items.rs:9:7
+ |
+LL | /// [`Self::IDENT`]
+ | ^^^^^^^^^^^ ambiguous link
+ |
+note: the lint level is defined here
+ --> $DIR/issue-108653-associated-items.rs:3:9
+ |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the associated function, add parentheses
+ |
+LL | /// [`Self::IDENT()`]
+ | ++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@Self::IDENT`]
+ | +++++
+
+error: `Self::IDENT2` is both an associated constant and an associated type
+ --> $DIR/issue-108653-associated-items.rs:23:7
+ |
+LL | /// [`Self::IDENT2`]
+ | ^^^^^^^^^^^^ ambiguous link
+ |
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@Self::IDENT2`]
+ | ++++++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@Self::IDENT2`]
+ | +++++
+
+error: `Self::IDENT` is both an associated function and a variant
+ --> $DIR/issue-108653-associated-items.rs:16:7
+ |
+LL | /// [`Self::IDENT`]
+ | ^^^^^^^^^^^ ambiguous link
+ |
+help: to link to the associated function, add parentheses
+ |
+LL | /// [`Self::IDENT()`]
+ | ++
+help: to link to the variant, prefix with `type@`
+ |
+LL | /// [`type@Self::IDENT`]
+ | +++++
+
+error: `Self::IDENT2` is both an associated constant and an associated type
+ --> $DIR/issue-108653-associated-items.rs:30:7
+ |
+LL | /// [`Self::IDENT2`]
+ | ^^^^^^^^^^^^ ambiguous link
+ |
+help: to link to the associated constant, prefix with `const@`
+ |
+LL | /// [`const@Self::IDENT2`]
+ | ++++++
+help: to link to the associated type, prefix with `type@`
+ |
+LL | /// [`type@Self::IDENT2`]
+ | +++++
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/rustdoc-ui/intra-doc/non-path-primitives.stderr b/tests/rustdoc-ui/intra-doc/non-path-primitives.stderr
index 8ec894d10..6e08a9239 100644
--- a/tests/rustdoc-ui/intra-doc/non-path-primitives.stderr
+++ b/tests/rustdoc-ui/intra-doc/non-path-primitives.stderr
@@ -39,25 +39,25 @@ error: unresolved link to `unit::eq`
--> $DIR/non-path-primitives.rs:28:6
|
LL | //! [unit::eq]
- | ^^^^^^^^ the builtin type `unit` has no associated item named `eq`
+ | ^^^^^^^^ the primitive type `unit` has no associated item named `eq`
error: unresolved link to `tuple::eq`
--> $DIR/non-path-primitives.rs:29:6
|
LL | //! [tuple::eq]
- | ^^^^^^^^^ the builtin type `tuple` has no associated item named `eq`
+ | ^^^^^^^^^ the primitive type `tuple` has no associated item named `eq`
error: unresolved link to `fn::eq`
--> $DIR/non-path-primitives.rs:30:6
|
LL | //! [fn::eq]
- | ^^^^^^ the builtin type `fn` has no associated item named `eq`
+ | ^^^^^^ the primitive type `fn` has no associated item named `eq`
error: unresolved link to `reference::deref`
--> $DIR/non-path-primitives.rs:34:6
|
LL | //! [reference::deref]
- | ^^^^^^^^^^^^^^^^ the builtin type `reference` has no associated item named `deref`
+ | ^^^^^^^^^^^^^^^^ the primitive type `reference` has no associated item named `deref`
error: aborting due to 8 previous errors
diff --git a/tests/rustdoc-ui/intra-doc/prim-conflict.rs b/tests/rustdoc-ui/intra-doc/prim-conflict.rs
index 2c1a8b535..e87ce095c 100644
--- a/tests/rustdoc-ui/intra-doc/prim-conflict.rs
+++ b/tests/rustdoc-ui/intra-doc/prim-conflict.rs
@@ -2,16 +2,16 @@
//~^ NOTE lint level is defined
/// [char]
-//~^ ERROR both a module and a builtin type
+//~^ ERROR both a module and a primitive type
//~| NOTE ambiguous link
//~| HELP to link to the module
-//~| HELP to link to the builtin type
+//~| HELP to link to the primitive type
/// [type@char]
-//~^ ERROR both a module and a builtin type
+//~^ ERROR both a module and a primitive type
//~| NOTE ambiguous link
//~| HELP to link to the module
-//~| HELP to link to the builtin type
+//~| HELP to link to the primitive type
/// [mod@char] // ok
/// [prim@char] // ok
@@ -26,5 +26,5 @@ pub mod inner {
//! [struct@char]
//~^ ERROR incompatible link
//~| HELP prefix with `prim@`
- //~| NOTE resolved to a builtin type
+ //~| NOTE resolved to a primitive type
}
diff --git a/tests/rustdoc-ui/intra-doc/prim-conflict.stderr b/tests/rustdoc-ui/intra-doc/prim-conflict.stderr
index 6ef3b7eab..03ce8f15f 100644
--- a/tests/rustdoc-ui/intra-doc/prim-conflict.stderr
+++ b/tests/rustdoc-ui/intra-doc/prim-conflict.stderr
@@ -1,4 +1,4 @@
-error: `char` is both a module and a builtin type
+error: `char` is both a module and a primitive type
--> $DIR/prim-conflict.rs:4:6
|
LL | /// [char]
@@ -13,12 +13,12 @@ help: to link to the module, prefix with `mod@`
|
LL | /// [mod@char]
| ++++
-help: to link to the builtin type, prefix with `prim@`
+help: to link to the primitive type, prefix with `prim@`
|
LL | /// [prim@char]
| +++++
-error: `char` is both a module and a builtin type
+error: `char` is both a module and a primitive type
--> $DIR/prim-conflict.rs:10:6
|
LL | /// [type@char]
@@ -28,7 +28,7 @@ help: to link to the module, prefix with `mod@`
|
LL | /// [mod@char]
| ~~~~
-help: to link to the builtin type, prefix with `prim@`
+help: to link to the primitive type, prefix with `prim@`
|
LL | /// [prim@char]
| ~~~~~
@@ -48,9 +48,9 @@ error: incompatible link kind for `char`
--> $DIR/prim-conflict.rs:26:10
|
LL | //! [struct@char]
- | ^^^^^^^^^^^ this link resolved to a builtin type, which is not a struct
+ | ^^^^^^^^^^^ this link resolved to a primitive type, which is not a struct
|
-help: to link to the builtin type, prefix with `prim@`
+help: to link to the primitive type, prefix with `prim@`
|
LL | //! [prim@char]
| ~~~~~
diff --git a/tests/rustdoc-ui/intra-doc/reachable-non-exported.rs b/tests/rustdoc-ui/intra-doc/reachable-non-exported.rs
new file mode 100644
index 000000000..6afcad4f9
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/reachable-non-exported.rs
@@ -0,0 +1,13 @@
+// The structure is reachable, but not exported, so rustdoc
+// doesn't attempt to request doc link resolutions on it.
+
+// check-pass
+
+mod private {
+ /// [core::str::FromStr]
+ pub struct ReachableButNotExported;
+}
+
+pub fn foo() -> private::ReachableButNotExported {
+ private::ReachableButNotExported
+}
diff --git a/tests/rustdoc-ui/invalid_associated_const.rs b/tests/rustdoc-ui/invalid_associated_const.rs
new file mode 100644
index 000000000..6ab8c36f7
--- /dev/null
+++ b/tests/rustdoc-ui/invalid_associated_const.rs
@@ -0,0 +1,10 @@
+#![feature(associated_const_equality)]
+
+trait T {
+ type A: S<C<X = 0i32> = 34>;
+ //~^ ERROR associated type bindings are not allowed here
+}
+
+trait S {
+ const C: i32;
+}
diff --git a/tests/rustdoc-ui/invalid_associated_const.stderr b/tests/rustdoc-ui/invalid_associated_const.stderr
new file mode 100644
index 000000000..1a8863fb1
--- /dev/null
+++ b/tests/rustdoc-ui/invalid_associated_const.stderr
@@ -0,0 +1,9 @@
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/invalid_associated_const.rs:4:17
+ |
+LL | type A: S<C<X = 0i32> = 34>;
+ | ^^^^^^^^ associated type not allowed here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0229`.
diff --git a/tests/rustdoc-ui/invalid_const_in_lifetime_position.rs b/tests/rustdoc-ui/invalid_const_in_lifetime_position.rs
new file mode 100644
index 000000000..c3f4fd63b
--- /dev/null
+++ b/tests/rustdoc-ui/invalid_const_in_lifetime_position.rs
@@ -0,0 +1,6 @@
+trait X {
+ type Y<'a>;
+}
+fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
+//~^ ERROR associated type takes 1 lifetime argument but 0 lifetime arguments
+//~| ERROR associated type takes 0 generic arguments but 1 generic argument
diff --git a/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr b/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr
new file mode 100644
index 000000000..527729a82
--- /dev/null
+++ b/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr
@@ -0,0 +1,33 @@
+error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+ --> $DIR/invalid_const_in_lifetime_position.rs:4:26
+ |
+LL | fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
+ | ^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/invalid_const_in_lifetime_position.rs:2:10
+ |
+LL | type Y<'a>;
+ | ^ --
+help: add missing lifetime argument
+ |
+LL | fn f<'a>(arg : Box<dyn X<Y<'_, 1> = &'a ()>>) {}
+ | +++
+
+error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/invalid_const_in_lifetime_position.rs:4:26
+ |
+LL | fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
+ | ^--- help: remove these generics
+ | |
+ | expected 0 generic arguments
+ |
+note: associated type defined here, with 0 generic parameters
+ --> $DIR/invalid_const_in_lifetime_position.rs:2:10
+ |
+LL | type Y<'a>;
+ | ^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/tests/rustdoc-ui/invalid_infered_static_and_const.rs b/tests/rustdoc-ui/invalid_infered_static_and_const.rs
new file mode 100644
index 000000000..3f8e68dc0
--- /dev/null
+++ b/tests/rustdoc-ui/invalid_infered_static_and_const.rs
@@ -0,0 +1,2 @@
+const FOO: dyn Fn() -> _ = ""; //~ ERROR E0121
+static BOO: dyn Fn() -> _ = ""; //~ ERROR E0121
diff --git a/tests/rustdoc-ui/invalid_infered_static_and_const.stderr b/tests/rustdoc-ui/invalid_infered_static_and_const.stderr
new file mode 100644
index 000000000..401020224
--- /dev/null
+++ b/tests/rustdoc-ui/invalid_infered_static_and_const.stderr
@@ -0,0 +1,15 @@
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for constant items
+ --> $DIR/invalid_infered_static_and_const.rs:1:24
+ |
+LL | const FOO: dyn Fn() -> _ = "";
+ | ^ not allowed in type signatures
+
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for static items
+ --> $DIR/invalid_infered_static_and_const.rs:2:25
+ |
+LL | static BOO: dyn Fn() -> _ = "";
+ | ^ not allowed in type signatures
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/tests/rustdoc-ui/issue-105742.rs b/tests/rustdoc-ui/issue-105742.rs
index 9f36e5315..8f4172c0c 100644
--- a/tests/rustdoc-ui/issue-105742.rs
+++ b/tests/rustdoc-ui/issue-105742.rs
@@ -1,19 +1,50 @@
// compile-flags: -Znormalize-docs
-
use std::ops::Index;
pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
+ //~^ expected 1 lifetime argument
+ //~| expected 1 generic argument
+ //~| the trait `SVec` cannot be made into an object
+ //~| `SVec` cannot be made into an object
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
let _ = s;
}
pub trait SVec: Index<
<Self as SVec>::Item,
+ //~^ expected 1 lifetime argument
+ //~| expected 1 generic argument
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
Output = <Index<<Self as SVec>::Item,
+ //~^ expected 1 lifetime argument
+ //~| expected 1 generic argument
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
Output = <Self as SVec>::Item> as SVec>::Item,
+ //~^ expected 1 lifetime argument
+ //~| expected 1 generic argument
+ //~| expected 1 lifetime argument
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| expected 1 generic argument
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
+ //~| missing generics for associated type `SVec::Item`
> {
type Item<'a, T>;
fn len(&self) -> <Self as SVec>::Item;
- //~^ ERROR
- //~^^ ERROR
+ //~^ expected 1 lifetime argument
+ //~| missing generics for associated type `SVec::Item`
+ //~| expected 1 generic argument
+ //~| missing generics for associated type `SVec::Item`
}
diff --git a/tests/rustdoc-ui/issue-105742.stderr b/tests/rustdoc-ui/issue-105742.stderr
index 4d2ee9726..cd53762ef 100644
--- a/tests/rustdoc-ui/issue-105742.stderr
+++ b/tests/rustdoc-ui/issue-105742.stderr
@@ -1,11 +1,329 @@
error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:16:38
+ --> $DIR/issue-105742.rs:15:21
+ |
+LL | <Self as SVec>::Item,
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | <Self as SVec>::Item<'a>,
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:15:21
+ |
+LL | <Self as SVec>::Item,
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | <Self as SVec>::Item<T>,
+ | +++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:22:37
+ |
+LL | Output = <Index<<Self as SVec>::Item,
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | Output = <Index<<Self as SVec>::Item<'a>,
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:22:37
+ |
+LL | Output = <Index<<Self as SVec>::Item,
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | Output = <Index<<Self as SVec>::Item<T>,
+ | +++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:29:30
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item,
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | Output = <Self as SVec>::Item<'a>> as SVec>::Item,
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:29:30
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item,
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | Output = <Self as SVec>::Item<T>> as SVec>::Item,
+ | +++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:29:46
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item,
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item<'a>,
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:29:46
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item,
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item<T>,
+ | +++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:4:40
+ |
+LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item<'_> = T, Output = T>) {
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:4:40
+ |
+LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item<T> = T, Output = T>) {
+ | +++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:15:21
+ |
+LL | <Self as SVec>::Item,
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | <Self as SVec>::Item<'a>,
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:15:21
+ |
+LL | <Self as SVec>::Item,
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | <Self as SVec>::Item<T>,
+ | +++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:22:37
+ |
+LL | Output = <Index<<Self as SVec>::Item,
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | Output = <Index<<Self as SVec>::Item<'a>,
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:22:37
+ |
+LL | Output = <Index<<Self as SVec>::Item,
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | Output = <Index<<Self as SVec>::Item<T>,
+ | +++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:29:30
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item,
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | Output = <Self as SVec>::Item<'a>> as SVec>::Item,
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:29:30
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item,
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | Output = <Self as SVec>::Item<T>> as SVec>::Item,
+ | +++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:29:46
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item,
+ | ^^^^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ --
+help: add missing lifetime argument
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item<'a>,
+ | ++++
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:29:46
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item,
+ | ^^^^ expected 1 generic argument
+ |
+note: associated type defined here, with 1 generic parameter: `T`
+ --> $DIR/issue-105742.rs:43:10
+ |
+LL | type Item<'a, T>;
+ | ^^^^ -
+help: add missing generic argument
+ |
+LL | Output = <Self as SVec>::Item> as SVec>::Item<T>,
+ | +++
+
+error[E0038]: the trait `SVec` cannot be made into an object
+ --> $DIR/issue-105742.rs:4:31
+ |
+LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SVec` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/issue-105742.rs:14:17
+ |
+LL | pub trait SVec: Index<
+ | ____________----__^
+ | | |
+ | | this trait cannot be made into an object...
+LL | | <Self as SVec>::Item,
+LL | |
+LL | |
+... |
+LL | |/ Output = <Index<<Self as SVec>::Item,
+LL | ||
+LL | ||
+LL | ||
+... ||
+LL | ||
+LL | || Output = <Self as SVec>::Item> as SVec>::Item,
+ | ||_________________________________________________^ ...because it uses `Self` as a type parameter
+... |
+LL | |
+LL | | > {
+ | |__^ ...because it uses `Self` as a type parameter
+
+error[E0107]: missing generics for associated type `SVec::Item`
+ --> $DIR/issue-105742.rs:45:38
|
LL | fn len(&self) -> <Self as SVec>::Item;
| ^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-105742.rs:14:10
+ --> $DIR/issue-105742.rs:43:10
|
LL | type Item<'a, T>;
| ^^^^ --
@@ -15,13 +333,13 @@ LL | fn len(&self) -> <Self as SVec>::Item<'_>;
| ++++
error[E0107]: missing generics for associated type `SVec::Item`
- --> $DIR/issue-105742.rs:16:38
+ --> $DIR/issue-105742.rs:45:38
|
LL | fn len(&self) -> <Self as SVec>::Item;
| ^^^^ expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-105742.rs:14:10
+ --> $DIR/issue-105742.rs:43:10
|
LL | type Item<'a, T>;
| ^^^^ -
@@ -30,6 +348,7 @@ help: add missing generic argument
LL | fn len(&self) -> <Self as SVec>::Item<T>;
| +++
-error: aborting due to 2 previous errors
+error: aborting due to 21 previous errors
-For more information about this error, try `rustc --explain E0107`.
+Some errors have detailed explanations: E0038, E0107.
+For more information about an error, try `rustc --explain E0038`.
diff --git a/tests/rustdoc-ui/issue-106226.stderr b/tests/rustdoc-ui/issue-106226.stderr
index 2beffbc12..1c973dab6 100644
--- a/tests/rustdoc-ui/issue-106226.stderr
+++ b/tests/rustdoc-ui/issue-106226.stderr
@@ -1,9 +1,9 @@
-error[E0308]: mismatched types
- --> $DIR/issue-106226.rs:2:14
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
+ --> $DIR/issue-106226.rs:2:11
|
LL | type F = [_; ()];
- | ^^ expected `usize`, found `()`
+ | ^ not allowed in type signatures
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0121`.
diff --git a/tests/rustdoc-ui/issue-109282-import-inline-merge.rs b/tests/rustdoc-ui/issue-109282-import-inline-merge.rs
new file mode 100644
index 000000000..0ec852322
--- /dev/null
+++ b/tests/rustdoc-ui/issue-109282-import-inline-merge.rs
@@ -0,0 +1,14 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/109282>.
+// Import for `ValueEnum` is inlined and doc comments on the import and `ValueEnum` itself are
+// merged. After the merge they still have correct parent scopes to resolve both `[ValueEnum]`.
+
+// check-pass
+
+mod m {
+ pub enum ValueEnum {}
+}
+mod m2 {
+ /// [`ValueEnum`]
+ pub use crate::m::ValueEnum;
+}
+pub use m2::ValueEnum;
diff --git a/tests/rustdoc-ui/issue-79465.rs b/tests/rustdoc-ui/issue-79465.rs
index f1a77982f..e50f3995b 100644
--- a/tests/rustdoc-ui/issue-79465.rs
+++ b/tests/rustdoc-ui/issue-79465.rs
@@ -1,3 +1,2 @@
pub fn f1<T>(x: T::A) {}
//~^ ERROR
-//~^^ ERROR
diff --git a/tests/rustdoc-ui/issue-79465.stderr b/tests/rustdoc-ui/issue-79465.stderr
index 489cc1442..d187a2e66 100644
--- a/tests/rustdoc-ui/issue-79465.stderr
+++ b/tests/rustdoc-ui/issue-79465.stderr
@@ -4,12 +4,6 @@ error[E0220]: associated type `A` not found for `T`
LL | pub fn f1<T>(x: T::A) {}
| ^ associated type `A` not found
-error[E0220]: associated type `A` not found for `T`
- --> $DIR/issue-79465.rs:1:20
- |
-LL | pub fn f1<T>(x: T::A) {}
- | ^ associated type `A` not found
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0220`.
diff --git a/tests/rustdoc-ui/issue-96287.rs b/tests/rustdoc-ui/issue-96287.rs
index 8d8b4456e..08cc7ef4c 100644
--- a/tests/rustdoc-ui/issue-96287.rs
+++ b/tests/rustdoc-ui/issue-96287.rs
@@ -6,7 +6,6 @@ pub trait TraitWithAssoc {
pub type Foo<V> = impl Trait<V::Assoc>;
//~^ ERROR
-//~^^ ERROR
pub trait Trait<U> {}
diff --git a/tests/rustdoc-ui/issue-96287.stderr b/tests/rustdoc-ui/issue-96287.stderr
index 0236b9fe6..7722eb960 100644
--- a/tests/rustdoc-ui/issue-96287.stderr
+++ b/tests/rustdoc-ui/issue-96287.stderr
@@ -4,12 +4,6 @@ error[E0220]: associated type `Assoc` not found for `V`
LL | pub type Foo<V> = impl Trait<V::Assoc>;
| ^^^^^ there is a similarly named associated type `Assoc` in the trait `TraitWithAssoc`
-error[E0220]: associated type `Assoc` not found for `V`
- --> $DIR/issue-96287.rs:7:33
- |
-LL | pub type Foo<V> = impl Trait<V::Assoc>;
- | ^^^^^ there is a similarly named associated type `Assoc` in the trait `TraitWithAssoc`
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0220`.
diff --git a/tests/rustdoc-ui/mismatched_arg_count.rs b/tests/rustdoc-ui/mismatched_arg_count.rs
new file mode 100644
index 000000000..784144298
--- /dev/null
+++ b/tests/rustdoc-ui/mismatched_arg_count.rs
@@ -0,0 +1,8 @@
+trait Trait<'a> {
+ type Assoc;
+}
+
+type Alias<'a, T> = <T as Trait<'a>>::Assoc;
+
+fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
+//~^ error: type alias takes 1 lifetime argument but 2 lifetime arguments were supplied
diff --git a/tests/rustdoc-ui/mismatched_arg_count.stderr b/tests/rustdoc-ui/mismatched_arg_count.stderr
new file mode 100644
index 000000000..7e88ce954
--- /dev/null
+++ b/tests/rustdoc-ui/mismatched_arg_count.stderr
@@ -0,0 +1,17 @@
+error[E0107]: type alias takes 1 lifetime argument but 2 lifetime arguments were supplied
+ --> $DIR/mismatched_arg_count.rs:7:29
+ |
+LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
+ | ^^^^^ -- help: remove this lifetime argument
+ | |
+ | expected 1 lifetime argument
+ |
+note: type alias defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/mismatched_arg_count.rs:5:6
+ |
+LL | type Alias<'a, T> = <T as Trait<'a>>::Assoc;
+ | ^^^^^ --
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/tests/rustdoc-ui/run-directory.rs b/tests/rustdoc-ui/run-directory.rs
index bbceaaf82..b8d0647f0 100644
--- a/tests/rustdoc-ui/run-directory.rs
+++ b/tests/rustdoc-ui/run-directory.rs
@@ -2,8 +2,8 @@
// revisions: correct incorrect
// check-pass
-// [correct]compile-flags:--test --test-run-directory={{src-base}} -Zunstable-options
-// [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage -Zunstable-options
+// [correct]compile-flags:--test --test-run-directory={{src-base}}
+// [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
diff --git a/tests/rustdoc-ui/z-help.rs b/tests/rustdoc-ui/z-help.rs
deleted file mode 100644
index c7cf841b9..000000000
--- a/tests/rustdoc-ui/z-help.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-// check-pass
-// compile-flags: -Zhelp
-// check-stdout
-// regex-error-pattern: -Z\s+self-profile
-
-pub struct Foo;
diff --git a/tests/rustdoc-ui/z-help.stdout b/tests/rustdoc-ui/z-help.stdout
deleted file mode 100644
index 79e6b94f1..000000000
--- a/tests/rustdoc-ui/z-help.stdout
+++ /dev/null
@@ -1,218 +0,0 @@
- -Z allow-features=val -- only allow the listed language features to be enabled in code (comma separated)
- -Z always-encode-mir=val -- encode MIR of all functions into the crate metadata (default: no)
- -Z asm-comments=val -- generate comments into the assembly (may change behavior) (default: no)
- -Z assert-incr-state=val -- assert that the incremental cache is in given state: either `loaded` or `not-loaded`.
- -Z assume-incomplete-release=val -- make cfg(version) treat the current version as incomplete (default: no)
- -Z binary-dep-depinfo=val -- include artifacts (sysroot, crate dependencies) used during compilation in dep-info (default: no)
- -Z box-noalias=val -- emit noalias metadata for box (default: yes)
- -Z branch-protection=val -- set options for branch target identification and pointer authentication on AArch64
- -Z cf-protection=val -- instrument control-flow architecture protection
- -Z cgu-partitioning-strategy=val -- the codegen unit partitioning strategy to use
- -Z codegen-backend=val -- the backend to use
- -Z combine-cgu=val -- combine CGUs into a single one
- -Z crate-attr=val -- inject the given attribute in the crate
- -Z debug-info-for-profiling=val -- emit discriminators and other data necessary for AutoFDO
- -Z debug-macros=val -- emit line numbers debug info inside macros (default: no)
- -Z deduplicate-diagnostics=val -- deduplicate identical diagnostics (default: yes)
- -Z dep-info-omit-d-target=val -- in dep-info output, omit targets for tracking dependencies of the dep-info files themselves (default: no)
- -Z dep-tasks=val -- print tasks that execute and the color their dep node gets (requires debug build) (default: no)
- -Z diagnostic-width=val -- set the current output width for diagnostic truncation
- -Z dlltool=val -- import library generation tool (windows-gnu only)
- -Z dont-buffer-diagnostics=val -- emit diagnostics rather than buffering (breaks NLL error downgrading, sorting) (default: no)
- -Z drop-tracking=val -- enables drop tracking in generators (default: no)
- -Z drop-tracking-mir=val -- enables drop tracking on MIR in generators (default: no)
- -Z dual-proc-macros=val -- load proc macros for both target and host, but only link to the target (default: no)
- -Z dump-dep-graph=val -- dump the dependency graph to $RUST_DEP_GRAPH (default: /tmp/dep_graph.gv) (default: no)
- -Z dump-drop-tracking-cfg=val -- dump drop-tracking control-flow graph as a `.dot` file (default: no)
- -Z dump-mir=val -- dump MIR state to file.
- `val` is used to select which passes and functions to dump. For example:
- `all` matches all passes and functions,
- `foo` matches all passes for functions whose name contains 'foo',
- `foo & ConstProp` only the 'ConstProp' pass for function names containing 'foo',
- `foo | bar` all passes for function names containing 'foo' or 'bar'.
- -Z dump-mir-dataflow=val -- in addition to `.mir` files, create graphviz `.dot` files with dataflow results (default: no)
- -Z dump-mir-dir=val -- the directory the MIR is dumped into (default: `mir_dump`)
- -Z dump-mir-exclude-pass-number=val -- exclude the pass number when dumping MIR (used in tests) (default: no)
- -Z dump-mir-graphviz=val -- in addition to `.mir` files, create graphviz `.dot` files (and with `-Z instrument-coverage`, also create a `.dot` file for the MIR-derived coverage graph) (default: no)
- -Z dump-mir-spanview=val -- in addition to `.mir` files, create `.html` files to view spans for all `statement`s (including terminators), only `terminator` spans, or computed `block` spans (one span encompassing a block's terminator and all statements). If `-Z instrument-coverage` is also enabled, create an additional `.html` file showing the computed coverage spans.
- -Z dump-mono-stats=val -- output statistics about monomorphization collection
- -Z dump-mono-stats-format=val -- the format to use for -Z dump-mono-stats (`markdown` (default) or `json`)
- -Z dwarf-version=val -- version of DWARF debug information to emit (default: 2 or 4, depending on platform)
- -Z dylib-lto=val -- enables LTO for dylib crate type
- -Z emit-stack-sizes=val -- emit a section containing stack size metadata (default: no)
- -Z emit-thin-lto=val -- emit the bc module with thin LTO info (default: yes)
- -Z export-executable-symbols=val -- export symbols from executables, as if they were dynamic libraries
- -Z extra-const-ub-checks=val -- turns on more checks to detect const UB, which can be slow (default: no)
- -Z fewer-names=val -- reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR) (default: no)
- -Z force-unstable-if-unmarked=val -- force all crates to be `rustc_private` unstable (default: no)
- -Z fuel=val -- set the optimization fuel quota for a crate
- -Z function-sections=val -- whether each function should go in its own section
- -Z future-incompat-test=val -- forces all lints to be future incompatible, used for internal testing (default: no)
- -Z gcc-ld=val -- implementation of ld used by cc
- -Z graphviz-dark-mode=val -- use dark-themed colors in graphviz output (default: no)
- -Z graphviz-font=val -- use the given `fontname` in graphviz output; can be overridden by setting environment variable `RUSTC_GRAPHVIZ_FONT` (default: `Courier, monospace`)
- -Z hir-stats=val -- print some statistics about AST and HIR (default: no)
- -Z human-readable-cgu-names=val -- generate human-readable, predictable names for codegen units (default: no)
- -Z identify-regions=val -- display unnamed regions as `'<id>`, using a non-ident unique id (default: no)
- -Z incremental-ignore-spans=val -- ignore spans during ICH computation -- used for testing (default: no)
- -Z incremental-info=val -- print high-level information about incremental reuse (or the lack thereof) (default: no)
- -Z incremental-relative-spans=val -- hash spans relative to their parent item for incr. comp. (default: no)
- -Z incremental-verify-ich=val -- verify incr. comp. hashes of green query instances (default: no)
- -Z inline-in-all-cgus=val -- control whether `#[inline]` functions are in all CGUs
- -Z inline-llvm=val -- enable LLVM inlining (default: yes)
- -Z inline-mir=val -- enable MIR inlining (default: no)
- -Z inline-mir-hint-threshold=val -- inlining threshold for functions with inline hint (default: 100)
- -Z inline-mir-threshold=val -- a default MIR inlining threshold (default: 50)
- -Z input-stats=val -- gather statistics about the input (default: no)
- -Z instrument-coverage=val -- instrument the generated code to support LLVM source-based code coverage reports (note, the compiler build config must include `profiler = true`); implies `-C symbol-mangling-version=v0`. Optional values are:
- `=all` (implicit value)
- `=except-unused-generics`
- `=except-unused-functions`
- `=off` (default)
- -Z instrument-mcount=val -- insert function instrument code for mcount-based tracing (default: no)
- -Z instrument-xray=val -- insert function instrument code for XRay-based tracing (default: no)
- Optional extra settings:
- `=always`
- `=never`
- `=ignore-loops`
- `=instruction-threshold=N`
- `=skip-entry`
- `=skip-exit`
- Multiple options can be combined with commas.
- -Z keep-hygiene-data=val -- keep hygiene data after analysis (default: no)
- -Z layout-seed=val -- seed layout randomization
- -Z link-directives=val -- honor #[link] directives in the compiled crate (default: yes)
- -Z link-native-libraries=val -- link native libraries in the linker invocation (default: yes)
- -Z link-only=val -- link the `.rlink` file generated by `-Z no-link` (default: no)
- -Z llvm-plugins=val -- a list LLVM plugins to enable (space separated)
- -Z llvm-time-trace=val -- generate JSON tracing data file from LLVM data (default: no)
- -Z location-detail=val -- what location details should be tracked when using caller_location, either `none`, or a comma separated list of location details, for which valid options are `file`, `line`, and `column` (default: `file,line,column`)
- -Z lower-impl-trait-in-trait-to-assoc-ty=val -- modify the lowering strategy for `impl Trait` in traits so that they are lowered to generic associated types
- -Z ls=val -- list the symbols defined by a library crate (default: no)
- -Z macro-backtrace=val -- show macro backtraces (default: no)
- -Z maximal-hir-to-mir-coverage=val -- save as much information as possible about the correspondence between MIR and HIR as source scopes (default: no)
- -Z merge-functions=val -- control the operation of the MergeFunctions LLVM pass, taking the same values as the target option of the same name
- -Z meta-stats=val -- gather metadata statistics (default: no)
- -Z mir-emit-retag=val -- emit Retagging MIR statements, interpreted e.g., by miri; implies -Zmir-opt-level=0 (default: no)
- -Z mir-enable-passes=val -- use like `-Zmir-enable-passes=+DestProp,-InstCombine`. Forces the specified passes to be enabled, overriding all other checks. Passes that are not specified are enabled or disabled by other flags as usual.
- -Z mir-opt-level=val -- MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)
- -Z mir-pretty-relative-line-numbers=val -- use line numbers relative to the function in mir pretty printing
- -Z move-size-limit=val -- the size at which the `large_assignments` lint starts to be emitted
- -Z mutable-noalias=val -- emit noalias metadata for mutable references (default: yes)
- -Z nll-facts=val -- dump facts from NLL analysis into side files (default: no)
- -Z nll-facts-dir=val -- the directory the NLL facts are dumped into (default: `nll-facts`)
- -Z no-analysis=val -- parse and expand the source, but run no analysis
- -Z no-codegen=val -- run all passes except codegen; no output
- -Z no-generate-arange-section=val -- omit DWARF address ranges that give faster lookups
- -Z no-jump-tables=val -- disable the jump tables and lookup tables that can be generated from a switch case lowering
- -Z no-leak-check=val -- disable the 'leak check' for subtyping; unsound, but useful for tests
- -Z no-link=val -- compile without linking
- -Z no-parallel-llvm=val -- run LLVM in non-parallel mode (while keeping codegen-units and ThinLTO)
- -Z no-profiler-runtime=val -- prevent automatic injection of the profiler_builtins crate
- -Z no-unique-section-names=val -- do not use unique names for text and data sections when -Z function-sections is used
- -Z normalize-docs=val -- normalize associated items in rustdoc when generating documentation
- -Z oom=val -- panic strategy for out-of-memory handling
- -Z osx-rpath-install-name=val -- pass `-install_name @rpath/...` to the macOS linker (default: no)
- -Z packed-bundled-libs=val -- change rlib format to store native libraries as archives
- -Z panic-abort-tests=val -- support compiling tests with panic=abort (default: no)
- -Z panic-in-drop=val -- panic strategy for panics in drops
- -Z parse-only=val -- parse only; do not compile, assemble, or link (default: no)
- -Z perf-stats=val -- print some performance-related statistics (default: no)
- -Z plt=val -- whether to use the PLT when calling into shared libraries;
- only has effect for PIC code on systems with ELF binaries
- (default: PLT is disabled if full relro is enabled)
- -Z polonius=val -- enable polonius-based borrow-checker (default: no)
- -Z polymorphize=val -- perform polymorphization analysis
- -Z pre-link-arg=val -- a single extra argument to prepend the linker invocation (can be used several times)
- -Z pre-link-args=val -- extra arguments to prepend to the linker invocation (space separated)
- -Z precise-enum-drop-elaboration=val -- use a more precise version of drop elaboration for matches on enums (default: yes). This results in better codegen, but has caused miscompilations on some tier 2 platforms. See #77382 and #74551.
- -Z print-fuel=val -- make rustc print the total optimization fuel used by a crate
- -Z print-llvm-passes=val -- print the LLVM optimization passes being run (default: no)
- -Z print-mono-items=val -- print the result of the monomorphization collection pass
- -Z print-type-sizes=val -- print layout information for each type encountered (default: no)
- -Z proc-macro-backtrace=val -- show backtraces for panics during proc-macro execution (default: no)
- -Z proc-macro-execution-strategy=val -- how to run proc-macro code (default: same-thread)
- -Z profile=val -- insert profiling code (default: no)
- -Z profile-closures=val -- profile size of closures
- -Z profile-emit=val -- file path to emit profiling data at runtime when using 'profile' (default based on relative source path)
- -Z profile-sample-use=val -- use the given `.prof` file for sampled profile-guided optimization (also known as AutoFDO)
- -Z profiler-runtime=val -- name of the profiler runtime crate to automatically inject (default: `profiler_builtins`)
- -Z query-dep-graph=val -- enable queries of the dependency graph for regression testing (default: no)
- -Z randomize-layout=val -- randomize the layout of types (default: no)
- -Z relax-elf-relocations=val -- whether ELF relocations can be relaxed
- -Z relro-level=val -- choose which RELRO level to use
- -Z remap-cwd-prefix=val -- remap paths under the current working directory to this path prefix
- -Z report-delayed-bugs=val -- immediately print bugs registered with `delay_span_bug` (default: no)
- -Z sanitizer=val -- use a sanitizer
- -Z sanitizer-memory-track-origins=val -- enable origins tracking in MemorySanitizer
- -Z sanitizer-recover=val -- enable recovery for selected sanitizers
- -Z saturating-float-casts=val -- make float->int casts UB-free: numbers outside the integer type's range are clipped to the max/min integer respectively, and NaN is mapped to 0 (default: yes)
- -Z self-profile=val -- run the self profiler and output the raw event data
- -Z self-profile-counter=val -- counter used by the self profiler (default: `wall-time`), one of:
- `wall-time` (monotonic clock, i.e. `std::time::Instant`)
- `instructions:u` (retired instructions, userspace-only)
- `instructions-minus-irqs:u` (subtracting hardware interrupt counts for extra accuracy)
- -Z self-profile-events=val -- specify the events recorded by the self profiler;
- for example: `-Z self-profile-events=default,query-keys`
- all options: none, all, default, generic-activity, query-provider, query-cache-hit
- query-blocked, incr-cache-load, incr-result-hashing, query-keys, function-args, args, llvm, artifact-sizes
- -Z share-generics=val -- make the current crate share its generic instantiations
- -Z show-span=val -- show spans for compiler debugging (expr|pat|ty)
- -Z simulate-remapped-rust-src-base=val -- simulate the effect of remap-debuginfo = true at bootstrapping by remapping path to rust's source base directory. only meant for testing purposes
- -Z span-debug=val -- forward proc_macro::Span's `Debug` impl to `Span`
- -Z span-free-formats=val -- exclude spans when debug-printing compiler state (default: no)
- -Z split-dwarf-inlining=val -- provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
- -Z split-dwarf-kind=val -- split dwarf variant (only if -Csplit-debuginfo is enabled and on relevant platform)
- (default: `split`)
-
- `split`: sections which do not require relocation are written into a DWARF object (`.dwo`)
- file which is ignored by the linker
- `single`: sections which do not require relocation are written into object file but ignored
- by the linker
- -Z src-hash-algorithm=val -- hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)
- -Z stack-protector=val -- control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)
- -Z strict-init-checks=val -- control if mem::uninitialized and mem::zeroed panic on more UB
- -Z strip=val -- tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)
- -Z symbol-mangling-version=val -- which mangling version to use for symbol names ('legacy' (default) or 'v0')
- -Z teach=val -- show extended diagnostic help (default: no)
- -Z temps-dir=val -- the directory the intermediate files are written to
- -Z terminal-urls=val -- use the OSC 8 hyperlink terminal specification to print hyperlinks in the compiler output
- -Z thinlto=val -- enable ThinLTO when possible
- -Z thir-unsafeck=val -- use the THIR unsafety checker (default: no)
- -Z threads=val -- use a thread pool with N threads
- -Z time-llvm-passes=val -- measure time of each LLVM pass (default: no)
- -Z time-passes=val -- measure time of each rustc pass (default: no)
- -Z tiny-const-eval-limit=val -- sets a tiny, non-configurable limit for const eval; useful for compiler tests
- -Z tls-model=val -- choose the TLS model to use (`rustc --print tls-models` for details)
- -Z trace-macros=val -- for every macro invocation, print its name and arguments (default: no)
- -Z track-diagnostics=val -- tracks where in rustc a diagnostic was emitted
- -Z trait-solver=val -- specify the trait solver mode used by rustc (default: classic)
- -Z translate-additional-ftl=val -- additional fluent translation to preferentially use (for testing translation)
- -Z translate-directionality-markers=val -- emit directionality isolation markers in translated diagnostics
- -Z translate-lang=val -- language identifier for diagnostic output
- -Z translate-remapped-path-to-local-path=val -- translate remapped paths into local paths when possible (default: yes)
- -Z trap-unreachable=val -- generate trap instructions for unreachable intrinsics (default: use target setting, usually yes)
- -Z treat-err-as-bug=val -- treat error number `val` that occurs as bug
- -Z trim-diagnostic-paths=val -- in diagnostics, use heuristics to shorten paths referring to items
- -Z tune-cpu=val -- select processor to schedule for (`rustc --print target-cpus` for details)
- -Z ui-testing=val -- emit compiler diagnostics in a form suitable for UI testing (default: no)
- -Z uninit-const-chunk-threshold=val -- allow generating const initializers with mixed init/uninit chunks, and set the maximum number of chunks for which this is allowed (default: 16)
- -Z unleash-the-miri-inside-of-you=val -- take the brakes off const evaluation. NOTE: this is unsound (default: no)
- -Z unpretty=val -- present the input source, unstable (and less-pretty) variants;
- `normal`, `identified`,
- `expanded`, `expanded,identified`,
- `expanded,hygiene` (with internal representations),
- `ast-tree` (raw AST before expansion),
- `ast-tree,expanded` (raw AST after expansion),
- `hir` (the HIR), `hir,identified`,
- `hir,typed` (HIR with types for each node),
- `hir-tree` (dump the raw HIR),
- `mir` (the MIR), or `mir-cfg` (graphviz formatted MIR)
- -Z unsound-mir-opts=val -- enable unsound and buggy MIR optimizations (default: no)
- -Z unstable-options=val -- adds unstable command line options to rustc interface (default: no)
- -Z use-ctors-section=val -- use legacy .ctors section for initializers rather than .init_array
- -Z validate-mir=val -- validate MIR after each transformation
- -Z verbose=val -- in general, enable more debug printouts (default: no)
- -Z verify-llvm-ir=val -- verify LLVM IR (default: no)
- -Z virtual-function-elimination=val -- enables dead virtual function elimination optimization. Requires `-Clto[=[fat,yes]]`
- -Z wasi-exec-model=val -- whether to build a wasi command or reactor
diff --git a/tests/rustdoc/anonymous-reexport.rs b/tests/rustdoc/anonymous-reexport.rs
index 6b884ff14..839c1a303 100644
--- a/tests/rustdoc/anonymous-reexport.rs
+++ b/tests/rustdoc/anonymous-reexport.rs
@@ -4,9 +4,13 @@
// @has 'foo/index.html'
// @has - '//*[@id="main-content"]' ''
-// We check that the only "h2" present is for "Bla".
-// @count - '//*[@id="main-content"]/h2' 1
+// We check that the only "h2" present are "Structs" (for "Bla") and "Re-exports".
+// @count - '//*[@id="main-content"]/h2' 2
// @has - '//*[@id="main-content"]/h2' 'Structs'
+// @has - '//*[@id="main-content"]/h2' 'Re-exports'
+// The 3 re-exports.
+// @count - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 3
+// The public struct.
// @count - '//*[@id="main-content"]//a[@class="struct"]' 1
mod ext {
diff --git a/tests/rustdoc/auto-impl-primitive.rs b/tests/rustdoc/auto-impl-primitive.rs
index 172333d44..a6db93dbc 100644
--- a/tests/rustdoc/auto-impl-primitive.rs
+++ b/tests/rustdoc/auto-impl-primitive.rs
@@ -1,10 +1,10 @@
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![crate_name = "foo"]
pub use std::fs::File;
// @has 'foo/primitive.i16.html' '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementation'
-#[doc(primitive = "i16")]
+#[rustc_doc_primitive = "i16"]
/// I love poneys!
mod prim {}
diff --git a/tests/rustdoc/auxiliary/issue-15318.rs b/tests/rustdoc/auxiliary/issue-15318.rs
index 695fa58ef..a2f426c63 100644
--- a/tests/rustdoc/auxiliary/issue-15318.rs
+++ b/tests/rustdoc/auxiliary/issue-15318.rs
@@ -2,6 +2,7 @@
// compile-flags: -Cmetadata=aux
#![crate_type = "rlib"]
#![doc(html_root_url = "http://example.com/")]
+#![feature(rustc_attrs)]
#![feature(lang_items)]
#![no_std]
@@ -12,5 +13,5 @@ fn foo() {}
fn bar(_: &core::panic::PanicInfo) -> ! { loop {} }
/// dox
-#[doc(primitive = "pointer")]
+#[rustc_doc_primitive = "pointer"]
pub mod ptr {}
diff --git a/tests/rustdoc/auxiliary/issue-73061.rs b/tests/rustdoc/auxiliary/issue-73061.rs
index e05a3bc6d..01e9a984d 100644
--- a/tests/rustdoc/auxiliary/issue-73061.rs
+++ b/tests/rustdoc/auxiliary/issue-73061.rs
@@ -1,6 +1,6 @@
//edition:2018
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Foo {
type X: std::future::Future<Output = ()>;
diff --git a/tests/rustdoc/auxiliary/primitive-doc.rs b/tests/rustdoc/auxiliary/primitive-doc.rs
index e8da852a5..d1785e423 100644
--- a/tests/rustdoc/auxiliary/primitive-doc.rs
+++ b/tests/rustdoc/auxiliary/primitive-doc.rs
@@ -1,9 +1,10 @@
// compile-flags: --crate-type lib --edition 2018
+#![feature(rustc_attrs)]
#![feature(no_core)]
#![no_core]
-#[doc(primitive = "usize")]
+#[rustc_doc_primitive = "usize"]
/// This is the built-in type `usize`.
mod usize {
}
diff --git a/tests/rustdoc/check-source-code-urls-to-def.rs b/tests/rustdoc/check-source-code-urls-to-def.rs
index 5959f9c7c..41b9d41fa 100644
--- a/tests/rustdoc/check-source-code-urls-to-def.rs
+++ b/tests/rustdoc/check-source-code-urls-to-def.rs
@@ -2,7 +2,7 @@
// aux-build:source_code.rs
// build-aux-docs
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![crate_name = "foo"]
@@ -65,5 +65,5 @@ pub fn foo4() {
}
// @has - '//pre[@class="rust"]//a[@href="../../foo/primitive.bool.html"]' 'bool'
-#[doc(primitive = "bool")]
+#[rustc_doc_primitive = "bool"]
mod whatever {}
diff --git a/tests/rustdoc/compiler-derive-proc-macro.rs b/tests/rustdoc/compiler-derive-proc-macro.rs
new file mode 100644
index 000000000..489ec924c
--- /dev/null
+++ b/tests/rustdoc/compiler-derive-proc-macro.rs
@@ -0,0 +1,15 @@
+// This test ensures that compiler builtin proc-macros are considered as such.
+
+#![crate_name = "foo"]
+
+// @has 'foo/index.html'
+// Each compiler builtin proc-macro has a trait equivalent so we should have
+// a trait section as well.
+// @count - '//*[@id="main-content"]//*[@class="small-section-header"]' 2
+// @has - '//*[@id="main-content"]//*[@class="small-section-header"]' 'Traits'
+// @has - '//*[@id="main-content"]//*[@class="small-section-header"]' 'Derive Macros'
+
+// Now checking the correct file is generated as well.
+// @has 'foo/derive.Clone.html'
+// @!has 'foo/macro.Clone.html'
+pub use std::clone::Clone;
diff --git a/tests/rustdoc/deprecated.rs b/tests/rustdoc/deprecated.rs
index 51860441b..9c9c0945b 100644
--- a/tests/rustdoc/deprecated.rs
+++ b/tests/rustdoc/deprecated.rs
@@ -28,6 +28,6 @@ pub struct V;
pub struct W;
// @matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \
-// 'Deprecated: shorthand reason$'
-#[deprecated = "shorthand reason"]
+// 'Deprecated: shorthand reason: code$'
+#[deprecated = "shorthand reason: `code`"]
pub struct X;
diff --git a/tests/rustdoc/footnote-in-summary.rs b/tests/rustdoc/footnote-in-summary.rs
new file mode 100644
index 000000000..e6ff5a7fd
--- /dev/null
+++ b/tests/rustdoc/footnote-in-summary.rs
@@ -0,0 +1,17 @@
+// This test ensures that no footnote reference is generated inside
+// summary doc.
+
+#![crate_name = "foo"]
+
+// @has 'foo/index.html'
+// @has - '//*[@class="desc docblock-short"]' 'hello bla'
+// @!has - '//*[@class="desc docblock-short"]/sup' '1'
+
+// @has 'foo/struct.S.html'
+// @has - '//*[@class="docblock"]//sup' '1'
+// @has - '//*[@class="docblock"]' 'hello 1 bla'
+
+/// hello [^foot] bla
+///
+/// [^foot]: blabla
+pub struct S;
diff --git a/tests/rustdoc/generic-associated-types/issue-109488.rs b/tests/rustdoc/generic-associated-types/issue-109488.rs
new file mode 100644
index 000000000..99ae8a6c3
--- /dev/null
+++ b/tests/rustdoc/generic-associated-types/issue-109488.rs
@@ -0,0 +1,18 @@
+// Make sure that we escape the arguments of the GAT projection even if we fail to compute
+// the href of the corresponding trait (in this case it is private).
+// Further, test that we also linkify the GAT arguments.
+
+// @has 'issue_109488/type.A.html'
+// @has - '//pre[@class="rust item-decl"]' '<S as Tr>::P<Option<i32>>'
+// @has - '//pre[@class="rust item-decl"]//a[@class="enum"]/@href' '{{channel}}/core/option/enum.Option.html'
+pub type A = <S as Tr>::P<Option<i32>>;
+
+/*private*/ trait Tr {
+ type P<T>;
+}
+
+pub struct S;
+
+impl Tr for S {
+ type P<T> = ();
+}
diff --git a/tests/rustdoc/intra-doc/auxiliary/my-core.rs b/tests/rustdoc/intra-doc/auxiliary/my-core.rs
index e22feb03a..c050929db 100644
--- a/tests/rustdoc/intra-doc/auxiliary/my-core.rs
+++ b/tests/rustdoc/intra-doc/auxiliary/my-core.rs
@@ -3,7 +3,7 @@
#![rustc_coherence_is_core]
#![crate_type="rlib"]
-#[doc(primitive = "char")]
+#[rustc_doc_primitive = "char"]
/// Some char docs
mod char {}
diff --git a/tests/rustdoc/intra-doc/no-doc-primitive.rs b/tests/rustdoc/intra-doc/no-doc-primitive.rs
index e5eba1d8d..711ac09ba 100644
--- a/tests/rustdoc/intra-doc/no-doc-primitive.rs
+++ b/tests/rustdoc/intra-doc/no-doc-primitive.rs
@@ -1,4 +1,4 @@
-// Crate tree without a `doc(primitive)` module for primitive type linked to by a doc link.
+// Crate tree without a `rustc_doc_primitive` module for primitive type linked to by a doc link.
#![deny(rustdoc::broken_intra_doc_links)]
#![feature(no_core, lang_items, rustc_attrs)]
diff --git a/tests/rustdoc/intra-doc/prim-methods-local.rs b/tests/rustdoc/intra-doc/prim-methods-local.rs
index 79d8df045..6de4ec180 100644
--- a/tests/rustdoc/intra-doc/prim-methods-local.rs
+++ b/tests/rustdoc/intra-doc/prim-methods-local.rs
@@ -10,7 +10,7 @@
//! A [prim@`char`] and its [`char::len_utf8`].
-#[doc(primitive = "char")]
+#[rustc_doc_primitive = "char"]
mod char {}
impl char {
diff --git a/tests/rustdoc/intra-doc/prim-methods.rs b/tests/rustdoc/intra-doc/prim-methods.rs
index a412a23fd..bc1965aac 100644
--- a/tests/rustdoc/intra-doc/prim-methods.rs
+++ b/tests/rustdoc/intra-doc/prim-methods.rs
@@ -2,6 +2,8 @@
// @has prim_methods/index.html
// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html"]' 'char'
+// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html"]/@title' 'primitive char'
// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html#method.len_utf8"]' 'char::len_utf8'
+// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html#method.len_utf8"]/@title' 'method char::len_utf8'
//! A [`char`] and its [`char::len_utf8`].
diff --git a/tests/rustdoc/intra-doc/prim-self.rs b/tests/rustdoc/intra-doc/prim-self.rs
index c7ce71b15..d13858a53 100644
--- a/tests/rustdoc/intra-doc/prim-self.rs
+++ b/tests/rustdoc/intra-doc/prim-self.rs
@@ -25,7 +25,7 @@ impl usize {
pub type ME = usize;
}
-#[doc(primitive = "usize")]
+#[rustc_doc_primitive = "usize"]
/// This has some docs.
mod usize {}
diff --git a/tests/rustdoc/issue-108679-reexport-of-reexport.rs b/tests/rustdoc/issue-108679-reexport-of-reexport.rs
new file mode 100644
index 000000000..5f977801c
--- /dev/null
+++ b/tests/rustdoc/issue-108679-reexport-of-reexport.rs
@@ -0,0 +1,29 @@
+// This test ensures that the `struct.B.html` only exists in `a`:
+// since `a::B` is public (and inlined too), `self::a::B` doesn't
+// need to be inlined as well.
+
+#![crate_name = "foo"]
+
+pub mod a {
+ // @has 'foo/a/index.html'
+ // Should only contain "Structs".
+ // @count - '//*[@id="main-content"]//*[@class="item-table"]' 1
+ // @has - '//*[@id="structs"]' 'Structs'
+ // @has - '//*[@id="main-content"]//a[@href="struct.A.html"]' 'A'
+ // @has - '//*[@id="main-content"]//a[@href="struct.B.html"]' 'B'
+ mod b {
+ pub struct B;
+ }
+ pub use self::b::B;
+ pub struct A;
+}
+
+// @has 'foo/index.html'
+// @!has - '//*[@id="structs"]' 'Structs'
+// @has - '//*[@id="reexports"]' 'Re-exports'
+// @has - '//*[@id="modules"]' 'Modules'
+// @has - '//*[@id="main-content"]//*[@id="reexport.A"]' 'pub use self::a::A;'
+// @has - '//*[@id="main-content"]//*[@id="reexport.B"]' 'pub use self::a::B;'
+// Should only contain "Modules" and "Re-exports".
+// @count - '//*[@id="main-content"]//*[@class="item-table"]' 2
+pub use self::a::{A, B};
diff --git a/tests/rustdoc/issue-108925.rs b/tests/rustdoc/issue-108925.rs
new file mode 100644
index 000000000..9c36d0d71
--- /dev/null
+++ b/tests/rustdoc/issue-108925.rs
@@ -0,0 +1,10 @@
+// @has issue_108925/enum.MyThing.html
+// @has - '//code' 'Shown'
+// @!has - '//code' 'NotShown'
+// @!has - '//code' '// some variants omitted'
+#[non_exhaustive]
+pub enum MyThing {
+ Shown,
+ #[doc(hidden)]
+ NotShown,
+}
diff --git a/tests/rustdoc/issue-108931-anonymous-reexport.rs b/tests/rustdoc/issue-108931-anonymous-reexport.rs
new file mode 100644
index 000000000..302f74133
--- /dev/null
+++ b/tests/rustdoc/issue-108931-anonymous-reexport.rs
@@ -0,0 +1,21 @@
+// Ensuring that anonymous re-exports are always inlined.
+
+#![crate_name = "foo"]
+
+pub mod foo {
+ pub struct Foo;
+}
+
+mod bar {
+ pub struct Bar;
+}
+
+// @has 'foo/index.html'
+// We check that the only "h2" present are "Re-exports" and "Modules".
+// @count - '//*[@id="main-content"]/h2' 2
+// @has - '//*[@id="main-content"]/h2' 'Re-exports'
+// @has - '//*[@id="main-content"]/h2' 'Modules'
+// @has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use foo::Foo as _;'
+// @has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use bar::Bar as _;'
+pub use foo::Foo as _;
+pub use bar::Bar as _;
diff --git a/tests/rustdoc/issue-109258-missing-private-inlining.rs b/tests/rustdoc/issue-109258-missing-private-inlining.rs
new file mode 100644
index 000000000..96f606368
--- /dev/null
+++ b/tests/rustdoc/issue-109258-missing-private-inlining.rs
@@ -0,0 +1,27 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/109258>.
+
+#![crate_name = "foo"]
+
+// @has 'foo/index.html'
+// We should only have a "Re-exports" and a "Modules" headers.
+// @count - '//*[@id="main-content"]/h2[@class="small-section-header"]' 2
+// @has - '//*[@id="main-content"]/h2[@class="small-section-header"]' 'Re-exports'
+// @has - '//*[@id="main-content"]/h2[@class="small-section-header"]' 'Modules'
+
+// @has - '//*[@id="reexport.Foo"]' 'pub use crate::issue_109258::Foo;'
+// @has - '//*[@id="reexport.Foo"]//a[@href="issue_109258/struct.Foo.html"]' 'Foo'
+// @!has 'foo/struct.Foo.html'
+pub use crate::issue_109258::Foo;
+
+// @has 'foo/issue_109258/index.html'
+// We should only have a "Structs" header.
+// @count - '//*[@id="main-content"]/h2[@class="small-section-header"]' 1
+// @has - '//*[@id="main-content"]/h2[@class="small-section-header"]' 'Structs'
+// @has - '//*[@id="main-content"]//a[@href="struct.Foo.html"]' 'Foo'
+// @has 'foo/issue_109258/struct.Foo.html'
+pub mod issue_109258 {
+ mod priv_mod {
+ pub struct Foo;
+ }
+ pub use self::priv_mod::Foo;
+}
diff --git a/tests/rustdoc/issue-109695-crate-doc-hidden.rs b/tests/rustdoc/issue-109695-crate-doc-hidden.rs
new file mode 100644
index 000000000..7a3e53a0d
--- /dev/null
+++ b/tests/rustdoc/issue-109695-crate-doc-hidden.rs
@@ -0,0 +1,8 @@
+// This test ensures that even if the crate module is `#[doc(hidden)]`, the file
+// is generated.
+
+// @has 'foo/index.html'
+// @has 'foo/all.html'
+
+#![crate_name = "foo"]
+#![doc(hidden)]
diff --git a/tests/rustdoc/issue-15318-2.rs b/tests/rustdoc/issue-15318-2.rs
index f7f5052a3..614f2c1c0 100644
--- a/tests/rustdoc/issue-15318-2.rs
+++ b/tests/rustdoc/issue-15318-2.rs
@@ -6,7 +6,7 @@ extern crate issue_15318;
pub use issue_15318::ptr;
-// @has issue_15318_2/fn.bar.html \
+// @!has issue_15318_2/fn.bar.html \
// '//*[@href="primitive.pointer.html"]' \
// '*mut T'
pub fn bar<T>(ptr: *mut T) {}
diff --git a/tests/rustdoc/issue-15318-3.rs b/tests/rustdoc/issue-15318-3.rs
index 2fadc26b0..2dab8f948 100644
--- a/tests/rustdoc/issue-15318-3.rs
+++ b/tests/rustdoc/issue-15318-3.rs
@@ -1,7 +1,7 @@
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
// @has issue_15318_3/primitive.pointer.html
/// dox
-#[doc(primitive = "pointer")]
+#[rustc_doc_primitive = "pointer"]
pub mod ptr {}
diff --git a/tests/rustdoc/issue-23511.rs b/tests/rustdoc/issue-23511.rs
index 7576ebb03..21d028424 100644
--- a/tests/rustdoc/issue-23511.rs
+++ b/tests/rustdoc/issue-23511.rs
@@ -3,7 +3,7 @@
#![no_std]
pub mod str {
- #![doc(primitive = "str")]
+ #![rustc_doc_primitive = "str"]
impl str {
// @hasraw search-index.js foo
diff --git a/tests/rustdoc/issue-25001.rs b/tests/rustdoc/issue-25001.rs
index c97b35ada..268fae594 100644
--- a/tests/rustdoc/issue-25001.rs
+++ b/tests/rustdoc/issue-25001.rs
@@ -21,14 +21,14 @@ impl Foo<u32> {
}
impl<T> Bar for Foo<T> {
- // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' 'type Item = T'
+ // @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' 'type Item = T'
type Item=T;
// @has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)'
fn quux(self) {}
}
impl<'a, T> Bar for &'a Foo<T> {
- // @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' "type Item = &'a T"
+ // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item = &'a T"
type Item=&'a T;
// @has - '//*[@id="method.quux-1"]//h4[@class="code-header"]' 'fn quux(self)'
diff --git a/tests/rustdoc/macro_pub_in_module.rs b/tests/rustdoc/macro_pub_in_module.rs
index 4fd85d689..42f760cff 100644
--- a/tests/rustdoc/macro_pub_in_module.rs
+++ b/tests/rustdoc/macro_pub_in_module.rs
@@ -7,8 +7,8 @@
#![crate_name = "krate"]
#![no_core]
- // @has external_crate/some_module/macro.external_macro.html
- // @!has external_crate/macro.external_macro.html
+// @has external_crate/some_module/macro.external_macro.html
+// @!has external_crate/macro.external_macro.html
extern crate external_crate;
pub mod inner {
@@ -16,13 +16,17 @@ pub mod inner {
// @!has krate/macro.raw_const.html
pub macro raw_const() {}
- // @has krate/inner/macro.test.html
+ // @has krate/inner/attr.test.html
// @!has krate/macro.test.html
+ // @!has krate/inner/macro.test.html
+ // @!has krate/attr.test.html
#[rustc_builtin_macro]
pub macro test($item:item) {}
- // @has krate/inner/macro.Clone.html
+ // @has krate/inner/derive.Clone.html
+ // @!has krate/inner/macro.Clone.html
// @!has krate/macro.Clone.html
+ // @!has krate/derive.Clone.html
#[rustc_builtin_macro]
pub macro Clone($item:item) {}
diff --git a/tests/rustdoc/non_lifetime_binders.rs b/tests/rustdoc/non_lifetime_binders.rs
new file mode 100644
index 000000000..da9a4e6a8
--- /dev/null
+++ b/tests/rustdoc/non_lifetime_binders.rs
@@ -0,0 +1,9 @@
+#![feature(non_lifetime_binders)]
+#![allow(incomplete_features)]
+
+pub trait Trait {}
+
+pub struct Wrapper<T: ?Sized>(Box<T>);
+
+// @has non_lifetime_binders/fn.foo.html '//pre' "fn foo()where for<'a, T> &'a Wrapper<T>: Trait"
+pub fn foo() where for<'a, T> &'a Wrapper<T>: Trait {}
diff --git a/tests/rustdoc/normalize-assoc-item.rs b/tests/rustdoc/normalize-assoc-item.rs
index af7b2f955..c6fd5e110 100644
--- a/tests/rustdoc/normalize-assoc-item.rs
+++ b/tests/rustdoc/normalize-assoc-item.rs
@@ -63,12 +63,12 @@ impl<'a> Lifetimes<'a> for usize {
type Y = &'a isize;
}
-// @has 'normalize_assoc_item/fn.g.html' '//pre[@class="rust item-decl"]' "pub fn g() -> &isize"
+// @has 'normalize_assoc_item/fn.g.html' '//pre[@class="rust item-decl"]' "pub fn g() -> &'static isize"
pub fn g() -> <usize as Lifetimes<'static>>::Y {
&0
}
-// @has 'normalize_assoc_item/constant.A.html' '//pre[@class="rust item-decl"]' "pub const A: &isize"
+// @has 'normalize_assoc_item/constant.A.html' '//pre[@class="rust item-decl"]' "pub const A: &'static isize"
pub const A: <usize as Lifetimes<'static>>::Y = &0;
// test cross-crate re-exports
diff --git a/tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs
index bfce46cf4..5af5f7616 100644
--- a/tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs
@@ -6,10 +6,10 @@
//!
//! [#80737]: https://github.com/rust-lang/rust/issues/80737
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![no_std]
-#[doc(primitive = "reference")]
+#[rustc_doc_primitive = "reference"]
/// Some useless docs, wouhou!
///
/// We need to put this in here, because notable traits
diff --git a/tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs
index b359dcea0..6c980aaa2 100644
--- a/tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs
@@ -5,9 +5,9 @@
//!
//! [#78160]: https://github.com/rust-lang/rust/issues/78160
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
-#[doc(primitive = "reference")]
+#[rustc_doc_primitive = "reference"]
/// Some useless docs, wouhou!
///
/// We need to put this in here, because notable traits
diff --git a/tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html b/tests/rustdoc/notable-trait/doc-notable_trait-slice.bare_fn_matches.html
index 46be00a08..46be00a08 100644
--- a/tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html
+++ b/tests/rustdoc/notable-trait/doc-notable_trait-slice.bare_fn_matches.html
diff --git a/tests/rustdoc/doc-notable_trait-slice.rs b/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs
index 2411da8cd..ef206710b 100644
--- a/tests/rustdoc/doc-notable_trait-slice.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs
@@ -18,3 +18,9 @@ pub fn bare_fn_matches() -> &'static [SomeStruct] {
pub fn bare_fn_no_matches() -> &'static [OtherStruct] {
&[]
}
+
+// @has doc_notable_trait_slice/fn.bare_fn_mut_no_matches.html
+// @count - '//script[@id="notable-traits-data"]' 0
+pub fn bare_fn_mut_no_matches() -> &'static mut [SomeStruct] {
+ &mut []
+}
diff --git a/tests/rustdoc/doc-notable_trait.bare-fn.html b/tests/rustdoc/notable-trait/doc-notable_trait.bare-fn.html
index f592e3b37..f592e3b37 100644
--- a/tests/rustdoc/doc-notable_trait.bare-fn.html
+++ b/tests/rustdoc/notable-trait/doc-notable_trait.bare-fn.html
diff --git a/tests/rustdoc/doc-notable_trait.rs b/tests/rustdoc/notable-trait/doc-notable_trait.rs
index d8941769f..d8941769f 100644
--- a/tests/rustdoc/doc-notable_trait.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait.rs
diff --git a/tests/rustdoc/doc-notable_trait.some-struct-new.html b/tests/rustdoc/notable-trait/doc-notable_trait.some-struct-new.html
index e8f4f6000..e8f4f6000 100644
--- a/tests/rustdoc/doc-notable_trait.some-struct-new.html
+++ b/tests/rustdoc/notable-trait/doc-notable_trait.some-struct-new.html
diff --git a/tests/rustdoc/doc-notable_trait.wrap-me.html b/tests/rustdoc/notable-trait/doc-notable_trait.wrap-me.html
index e7909669b..e7909669b 100644
--- a/tests/rustdoc/doc-notable_trait.wrap-me.html
+++ b/tests/rustdoc/notable-trait/doc-notable_trait.wrap-me.html
diff --git a/tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs b/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs
index 3fb00c7db..3fb00c7db 100644
--- a/tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs
diff --git a/tests/rustdoc/notable-trait/notable-trait-generics.rs b/tests/rustdoc/notable-trait/notable-trait-generics.rs
new file mode 100644
index 000000000..611902aba
--- /dev/null
+++ b/tests/rustdoc/notable-trait/notable-trait-generics.rs
@@ -0,0 +1,35 @@
+#![feature(doc_notable_trait)]
+
+// Notable traits SHOULD NOT be shown when the `impl` has a concrete type and
+// the return type has a generic type.
+pub mod generic_return {
+ pub struct Wrapper<T>(T);
+
+ #[doc(notable_trait)]
+ pub trait NotableTrait {}
+
+ impl NotableTrait for Wrapper<u8> {}
+
+ // @has notable_trait_generics/generic_return/fn.returning.html
+ // @!has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper<T>'
+ pub fn returning<T>() -> Wrapper<T> {
+ loop {}
+ }
+}
+
+// Notable traits SHOULD be shown when the `impl` has a generic type and the
+// return type has a concrete type.
+pub mod generic_impl {
+ pub struct Wrapper<T>(T);
+
+ #[doc(notable_trait)]
+ pub trait NotableTrait {}
+
+ impl<T> NotableTrait for Wrapper<T> {}
+
+ // @has notable_trait_generics/generic_impl/fn.returning.html
+ // @has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper<u8>'
+ pub fn returning() -> Wrapper<u8> {
+ loop {}
+ }
+}
diff --git a/tests/rustdoc/spotlight-from-dependency.odd.html b/tests/rustdoc/notable-trait/spotlight-from-dependency.odd.html
index 5f54b7522..5f54b7522 100644
--- a/tests/rustdoc/spotlight-from-dependency.odd.html
+++ b/tests/rustdoc/notable-trait/spotlight-from-dependency.odd.html
diff --git a/tests/rustdoc/spotlight-from-dependency.rs b/tests/rustdoc/notable-trait/spotlight-from-dependency.rs
index 426759c7b..426759c7b 100644
--- a/tests/rustdoc/spotlight-from-dependency.rs
+++ b/tests/rustdoc/notable-trait/spotlight-from-dependency.rs
diff --git a/tests/rustdoc/primitive-reference.rs b/tests/rustdoc/primitive-reference.rs
index 10efbefd2..6f034224d 100644
--- a/tests/rustdoc/primitive-reference.rs
+++ b/tests/rustdoc/primitive-reference.rs
@@ -1,6 +1,6 @@
#![crate_name = "foo"]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
// @has foo/index.html
// @has - '//h2[@id="primitives"]' 'Primitive Types'
@@ -16,7 +16,7 @@
// @count - '//*[@class="impl"]' 1
// @has - '//*[@id="impl-Foo%3C%26A%3E-for-%26B"]/*[@class="code-header"]' \
// 'impl<A, B> Foo<&A> for &B'
-#[doc(primitive = "reference")]
+#[rustc_doc_primitive = "reference"]
/// this is a test!
mod reference {}
diff --git a/tests/rustdoc/primitive-slice-auto-trait.rs b/tests/rustdoc/primitive-slice-auto-trait.rs
index 779224146..ba15a73ca 100644
--- a/tests/rustdoc/primitive-slice-auto-trait.rs
+++ b/tests/rustdoc/primitive-slice-auto-trait.rs
@@ -1,7 +1,7 @@
// compile-flags: --crate-type lib --edition 2018
#![crate_name = "foo"]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
// @has foo/primitive.slice.html '//a[@class="primitive"]' 'slice'
// @has - '//h1' 'Primitive Type slice'
@@ -9,6 +9,6 @@
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl<T> Send for [T]where T: Send'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl<T> Sync for [T]where T: Sync'
-#[doc(primitive = "slice")]
+#[rustc_doc_primitive = "slice"]
/// this is a test!
mod slice_prim {}
diff --git a/tests/rustdoc/primitive-tuple-auto-trait.rs b/tests/rustdoc/primitive-tuple-auto-trait.rs
index 4344d24f9..2b407b586 100644
--- a/tests/rustdoc/primitive-tuple-auto-trait.rs
+++ b/tests/rustdoc/primitive-tuple-auto-trait.rs
@@ -1,7 +1,7 @@
// compile-flags: --crate-type lib --edition 2018
#![crate_name = "foo"]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
// @has foo/primitive.tuple.html '//a[@class="primitive"]' 'tuple'
// @has - '//h1' 'Primitive Type tuple'
@@ -9,7 +9,7 @@
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'Send'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'Sync'
-#[doc(primitive = "tuple")]
+#[rustc_doc_primitive = "tuple"]
/// this is a test!
///
// Hardcoded anchor to header written in library/core/src/primitive_docs.rs
diff --git a/tests/rustdoc/primitive-unit-auto-trait.rs b/tests/rustdoc/primitive-unit-auto-trait.rs
index 61850e246..5a56f1fd8 100644
--- a/tests/rustdoc/primitive-unit-auto-trait.rs
+++ b/tests/rustdoc/primitive-unit-auto-trait.rs
@@ -1,7 +1,7 @@
// compile-flags: --crate-type lib --edition 2018
#![crate_name = "foo"]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
// @has foo/primitive.unit.html '//a[@class="primitive"]' 'unit'
// @has - '//h1' 'Primitive Type unit'
@@ -9,6 +9,6 @@
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Send for ()'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Sync for ()'
-#[doc(primitive = "unit")]
+#[rustc_doc_primitive = "unit"]
/// this is a test!
mod unit_prim {}
diff --git a/tests/rustdoc/primitive/primitive-generic-impl.rs b/tests/rustdoc/primitive/primitive-generic-impl.rs
index 7b336b398..2da8ae6ff 100644
--- a/tests/rustdoc/primitive/primitive-generic-impl.rs
+++ b/tests/rustdoc/primitive/primitive-generic-impl.rs
@@ -1,8 +1,8 @@
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![crate_name = "foo"]
// @has foo/primitive.i32.html '//*[@id="impl-ToString-for-i32"]//h3[@class="code-header"]' 'impl<T> ToString for T'
-#[doc(primitive = "i32")]
+#[rustc_doc_primitive = "i32"]
/// Some useless docs, wouhou!
mod i32 {}
diff --git a/tests/rustdoc/primitive.rs b/tests/rustdoc/primitive/primitive.rs
index 516c7c0c6..32af2636c 100644
--- a/tests/rustdoc/primitive.rs
+++ b/tests/rustdoc/primitive/primitive.rs
@@ -1,6 +1,6 @@
#![crate_name = "foo"]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
// @has foo/index.html '//h2[@id="primitives"]' 'Primitive Types'
// @has foo/index.html '//a[@href="primitive.i32.html"]' 'i32'
@@ -11,11 +11,11 @@
// @has foo/primitive.i32.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has foo/index.html '//a/@href' '../foo/index.html'
// @!has foo/index.html '//span' '🔒'
-#[doc(primitive = "i32")]
+#[rustc_doc_primitive = "i32"]
/// this is a test!
mod i32{}
// @has foo/primitive.bool.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello'
-#[doc(primitive = "bool")]
+#[rustc_doc_primitive = "bool"]
/// hello
mod bool {}
diff --git a/tests/rustdoc/sidebar-all-page.rs b/tests/rustdoc/sidebar-all-page.rs
index e74b981de..45a6ba8ed 100644
--- a/tests/rustdoc/sidebar-all-page.rs
+++ b/tests/rustdoc/sidebar-all-page.rs
@@ -1,6 +1,6 @@
#![crate_name = "foo"]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
// @has 'foo/all.html'
// @has - '//*[@class="sidebar-elems"]//li' 'Structs'
@@ -31,5 +31,5 @@ macro_rules! foo {
pub type Type = u8;
pub const FOO: u8 = 0;
pub static BAR: u8 = 0;
-#[doc(primitive = "u8")]
+#[rustc_doc_primitive = "u8"]
mod u8 {}
diff --git a/tests/rustdoc/tab_title.rs b/tests/rustdoc/tab_title.rs
index 0cc4f147e..8d781b40e 100644
--- a/tests/rustdoc/tab_title.rs
+++ b/tests/rustdoc/tab_title.rs
@@ -1,4 +1,5 @@
#![crate_name = "foo"]
+#![feature(rustc_attrs)]
#![feature(rustdoc_internals)]
// tests for the html <title> element
@@ -39,6 +40,6 @@ mod continue_keyword {}
// @has foo/primitive.u8.html '//head/title' 'u8 - Rust'
// @!has - '//head/title' 'foo'
-#[doc(primitive = "u8")]
+#[rustc_doc_primitive = "u8"]
/// `u8` docs
mod u8 {}
diff --git a/tests/rustdoc/titles.rs b/tests/rustdoc/titles.rs
index 69e8b856b..e1feb1cd6 100644
--- a/tests/rustdoc/titles.rs
+++ b/tests/rustdoc/titles.rs
@@ -1,5 +1,5 @@
#![crate_name = "foo"]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
// @matches 'foo/index.html' '//h1' 'Crate foo'
// @matches 'foo/index.html' '//h2[@class="location"]' 'Crate foo'
@@ -41,7 +41,7 @@ macro_rules! foo_macro {
}
// @matches 'foo/primitive.bool.html' '//h1' 'Primitive Type bool'
-#[doc(primitive = "bool")]
+#[rustc_doc_primitive = "bool"]
mod bool {}
// @matches 'foo/static.FOO_STATIC.html' '//h1' 'Static foo::FOO_STATIC'
diff --git a/tests/rustdoc/type-layout.rs b/tests/rustdoc/type-layout.rs
index 5e0a0411a..bd88e73af 100644
--- a/tests/rustdoc/type-layout.rs
+++ b/tests/rustdoc/type-layout.rs
@@ -83,3 +83,11 @@ pub enum WithNiche {
None,
Some(std::num::NonZeroU32),
}
+
+// @hasraw type_layout/enum.Uninhabited.html 'Size: '
+// @hasraw - '0 bytes (<a href="https://doc.rust-lang.org/stable/reference/glossary.html#uninhabited">uninhabited</a>)'
+pub enum Uninhabited {}
+
+// @hasraw type_layout/struct.Uninhabited2.html 'Size: '
+// @hasraw - '8 bytes (<a href="https://doc.rust-lang.org/stable/reference/glossary.html#uninhabited">uninhabited</a>)'
+pub struct Uninhabited2(std::convert::Infallible, u64);
diff --git a/tests/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs b/tests/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs
deleted file mode 100644
index a3b570ad8..000000000
--- a/tests/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs
+++ /dev/null
@@ -1,80 +0,0 @@
-// force-host
-
-#![feature(rustc_private)]
-
-extern crate rustc_driver;
-extern crate rustc_hir;
-extern crate rustc_lint;
-extern crate rustc_span;
-#[macro_use]
-extern crate rustc_session;
-extern crate rustc_ast;
-
-use rustc_ast::attr;
-use rustc_driver::plugin::Registry;
-use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass};
-use rustc_span::def_id::CRATE_DEF_ID;
-use rustc_span::symbol::Symbol;
-
-macro_rules! fake_lint_pass {
- ($struct:ident, $($attr:expr),*) => {
- struct $struct;
-
- impl LintPass for $struct {
- fn name(&self) -> &'static str {
- stringify!($struct)
- }
- }
-
- impl LateLintPass<'_> for $struct {
- fn check_crate(&mut self, cx: &LateContext) {
- let attrs = cx.tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
- let span = cx.tcx.def_span(CRATE_DEF_ID);
- $(
- if !cx.sess().contains_name(attrs, $attr) {
- cx.lint(CRATE_NOT_OKAY, |lint| {
- let msg = format!("crate is not marked with #![{}]", $attr);
- lint.build(&msg).set_span(span).emit();
- });
- }
- )*
- }
- }
-
- }
-}
-
-declare_lint!(CRATE_NOT_OKAY, Warn, "crate not marked with #![crate_okay]");
-declare_lint!(CRATE_NOT_RED, Warn, "crate not marked with #![crate_red]");
-declare_lint!(CRATE_NOT_BLUE, Warn, "crate not marked with #![crate_blue]");
-declare_lint!(CRATE_NOT_GREY, Warn, "crate not marked with #![crate_grey]");
-declare_lint!(CRATE_NOT_GREEN, Warn, "crate not marked with #![crate_green]");
-
-fake_lint_pass! {
- PassOkay,
- Symbol::intern("crate_okay")
-}
-
-fake_lint_pass! {
- PassRedBlue,
- Symbol::intern("crate_red"), Symbol::intern("crate_blue")
-}
-
-fake_lint_pass! {
- PassGreyGreen,
- Symbol::intern("crate_grey"), Symbol::intern("crate_green")
-}
-
-#[no_mangle]
-fn __rustc_plugin_registrar(reg: &mut Registry) {
- reg.lint_store.register_lints(&[
- &CRATE_NOT_OKAY,
- &CRATE_NOT_RED,
- &CRATE_NOT_BLUE,
- &CRATE_NOT_GREY,
- &CRATE_NOT_GREEN,
- ]);
- reg.lint_store.register_late_pass(|_| Box::new(PassOkay));
- reg.lint_store.register_late_pass(|_| Box::new(PassRedBlue));
- reg.lint_store.register_late_pass(|_| Box::new(PassGreyGreen));
-}
diff --git a/tests/ui-fulldeps/auxiliary/lint-for-crate.rs b/tests/ui-fulldeps/auxiliary/lint-for-crate.rs
index 073da688c..6304c07d2 100644
--- a/tests/ui-fulldeps/auxiliary/lint-for-crate.rs
+++ b/tests/ui-fulldeps/auxiliary/lint-for-crate.rs
@@ -4,13 +4,13 @@
extern crate rustc_driver;
extern crate rustc_hir;
-#[macro_use]
extern crate rustc_lint;
#[macro_use]
extern crate rustc_session;
extern crate rustc_ast;
extern crate rustc_span;
+use rustc_ast::attr;
use rustc_driver::plugin::Registry;
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_span::def_id::CRATE_DEF_ID;
@@ -28,12 +28,10 @@ impl<'tcx> LateLintPass<'tcx> for Pass {
fn check_crate(&mut self, cx: &LateContext) {
let attrs = cx.tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
let span = cx.tcx.def_span(CRATE_DEF_ID);
- if !cx.sess().contains_name(attrs, Symbol::intern("crate_okay")) {
- cx.lint(
- CRATE_NOT_OKAY,
- "crate is not marked with #![crate_okay]",
- |lint| lint.set_span(span)
- );
+ if !attr::contains_name(attrs, Symbol::intern("crate_okay")) {
+ cx.lint(CRATE_NOT_OKAY, "crate is not marked with #![crate_okay]", |lint| {
+ lint.set_span(span)
+ });
}
}
}
diff --git a/tests/ui-fulldeps/extern-mod-syntax.rs b/tests/ui-fulldeps/extern-mod-syntax.rs
deleted file mode 100644
index 230194c53..000000000
--- a/tests/ui-fulldeps/extern-mod-syntax.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// run-pass
-
-#![allow(unused_imports)]
-#![feature(rustc_private)]
-
-extern crate libc;
-use libc::c_void;
-
-pub fn main() {
- println!("Hello world!");
-}
diff --git a/tests/ui-fulldeps/fluent-messages/invalid-escape.ftl b/tests/ui-fulldeps/fluent-messages/invalid-escape.ftl
new file mode 100644
index 000000000..e28852ea0
--- /dev/null
+++ b/tests/ui-fulldeps/fluent-messages/invalid-escape.ftl
@@ -0,0 +1 @@
+no_crate_bad_escape = don't use \n, \', or \"
diff --git a/tests/ui-fulldeps/fluent-messages/test.rs b/tests/ui-fulldeps/fluent-messages/test.rs
index 66575eb8e..6ba13387b 100644
--- a/tests/ui-fulldeps/fluent-messages/test.rs
+++ b/tests/ui-fulldeps/fluent-messages/test.rs
@@ -1,4 +1,4 @@
-// normalize-stderr-test "note.*" -> "note: os-specific message"
+// normalize-stderr-test "could not open Fluent resource:.*" -> "could not open Fluent resource: os-specific message"
#![feature(rustc_private)]
#![crate_type = "lib"]
@@ -92,3 +92,12 @@ mod missing_message_ref {
fluent_messages! { "./missing-message-ref.ftl" }
//~^ ERROR referenced message `message` does not exist
}
+
+mod bad_escape {
+ use super::fluent_messages;
+
+ fluent_messages! { "./invalid-escape.ftl" }
+ //~^ ERROR invalid escape `\n`
+ //~| ERROR invalid escape `\"`
+ //~| ERROR invalid escape `\'`
+}
diff --git a/tests/ui-fulldeps/fluent-messages/test.stderr b/tests/ui-fulldeps/fluent-messages/test.stderr
index c7961ed22..2affe621c 100644
--- a/tests/ui-fulldeps/fluent-messages/test.stderr
+++ b/tests/ui-fulldeps/fluent-messages/test.stderr
@@ -1,18 +1,14 @@
-error: could not open Fluent resource
+error: could not open Fluent resource: os-specific message
--> $DIR/test.rs:24:24
|
LL | fluent_messages! { "/definitely_does_not_exist.ftl" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: os-specific message
-error: could not open Fluent resource
+error: could not open Fluent resource: os-specific message
--> $DIR/test.rs:31:24
|
LL | fluent_messages! { "../definitely_does_not_exist.ftl" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: os-specific message
error: could not parse Fluent resource
--> $DIR/test.rs:38:24
@@ -83,5 +79,29 @@ LL | fluent_messages! { "./missing-message-ref.ftl" }
|
= help: you may have meant to use a variable reference (`{$message}`)
-error: aborting due to 10 previous errors
+error: invalid escape `\n` in Fluent resource
+ --> $DIR/test.rs:99:24
+ |
+LL | fluent_messages! { "./invalid-escape.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: Fluent does not interpret these escape sequences (<https://projectfluent.org/fluent/guide/special.html>)
+
+error: invalid escape `\"` in Fluent resource
+ --> $DIR/test.rs:99:24
+ |
+LL | fluent_messages! { "./invalid-escape.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: Fluent does not interpret these escape sequences (<https://projectfluent.org/fluent/guide/special.html>)
+
+error: invalid escape `\'` in Fluent resource
+ --> $DIR/test.rs:99:24
+ |
+LL | fluent_messages! { "./invalid-escape.ftl" }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: Fluent does not interpret these escape sequences (<https://projectfluent.org/fluent/guide/special.html>)
+
+error: aborting due to 13 previous errors
diff --git a/tests/ui-fulldeps/pprust-expr-roundtrip.rs b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
index e417a6a83..ae375dfab 100644
--- a/tests/ui-fulldeps/pprust-expr-roundtrip.rs
+++ b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
@@ -73,11 +73,10 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
let mut g = |e| f(expr(e));
- for kind in 0..=19 {
+ for kind in 0..=18 {
match kind {
- 0 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Box(e))),
- 1 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, thin_vec![]))),
- 2 => {
+ 0 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, thin_vec![]))),
+ 1 => {
let seg = PathSegment::from_ident(Ident::from_str("x"));
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::MethodCall(Box::new(MethodCall {
@@ -90,26 +89,26 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
}))
)});
}
- 3..=8 => {
+ 2..=7 => {
let op = Spanned {
span: DUMMY_SP,
node: match kind {
- 3 => BinOpKind::Add,
- 4 => BinOpKind::Mul,
- 5 => BinOpKind::Shl,
- 6 => BinOpKind::And,
- 7 => BinOpKind::Or,
- 8 => BinOpKind::Lt,
+ 2 => BinOpKind::Add,
+ 3 => BinOpKind::Mul,
+ 4 => BinOpKind::Shl,
+ 5 => BinOpKind::And,
+ 6 => BinOpKind::Or,
+ 7 => BinOpKind::Lt,
_ => unreachable!(),
},
};
iter_exprs(depth - 1, &mut |e| g(ExprKind::Binary(op, e, make_x())));
iter_exprs(depth - 1, &mut |e| g(ExprKind::Binary(op, make_x(), e)));
}
- 9 => {
+ 8 => {
iter_exprs(depth - 1, &mut |e| g(ExprKind::Unary(UnOp::Deref, e)));
}
- 10 => {
+ 9 => {
let block = P(Block {
stmts: ThinVec::new(),
id: DUMMY_NODE_ID,
@@ -120,7 +119,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
});
iter_exprs(depth - 1, &mut |e| g(ExprKind::If(e, block.clone(), None)));
}
- 11 => {
+ 10 => {
let decl = P(FnDecl { inputs: thin_vec![], output: FnRetTy::Default(DUMMY_SP) });
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::Closure(Box::new(Closure {
@@ -136,14 +135,14 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
})))
});
}
- 12 => {
+ 11 => {
iter_exprs(depth - 1, &mut |e| g(ExprKind::Assign(e, make_x(), DUMMY_SP)));
iter_exprs(depth - 1, &mut |e| g(ExprKind::Assign(make_x(), e, DUMMY_SP)));
}
- 13 => {
+ 12 => {
iter_exprs(depth - 1, &mut |e| g(ExprKind::Field(e, Ident::from_str("f"))));
}
- 14 => {
+ 13 => {
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::Range(Some(e), Some(make_x()), RangeLimits::HalfOpen))
});
@@ -151,16 +150,16 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
g(ExprKind::Range(Some(make_x()), Some(e), RangeLimits::HalfOpen))
});
}
- 15 => {
+ 14 => {
iter_exprs(depth - 1, &mut |e| {
g(ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, e))
});
}
- 16 => {
+ 15 => {
g(ExprKind::Ret(None));
iter_exprs(depth - 1, &mut |e| g(ExprKind::Ret(Some(e))));
}
- 17 => {
+ 16 => {
let path = Path::from_ident(Ident::from_str("S"));
g(ExprKind::Struct(P(StructExpr {
qself: None,
@@ -169,10 +168,10 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
rest: StructRest::Base(make_x()),
})));
}
- 18 => {
+ 17 => {
iter_exprs(depth - 1, &mut |e| g(ExprKind::Try(e)));
}
- 19 => {
+ 18 => {
let pat =
P(Pat { id: DUMMY_NODE_ID, kind: PatKind::Wild, span: DUMMY_SP, tokens: None });
iter_exprs(depth - 1, &mut |e| g(ExprKind::Let(pat.clone(), e, DUMMY_SP)))
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index 01e6434b0..6cc7bab37 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -50,7 +50,7 @@ enum DiagnosticOnEnum {
#[derive(Diagnostic)]
#[diag(no_crate_example, code = "E0123")]
#[diag = "E0123"]
-//~^ ERROR `#[diag = ...]` is not a valid attribute
+//~^ ERROR expected parentheses: #[diag(...)]
struct WrongStructAttrStyle {}
#[derive(Diagnostic)]
@@ -62,8 +62,7 @@ struct InvalidStructAttr {}
#[derive(Diagnostic)]
#[diag("E0123")]
-//~^ ERROR `#[diag("...")]` is not a valid attribute
-//~^^ ERROR diagnostic slug not specified
+//~^ ERROR diagnostic slug not specified
struct InvalidLitNestedAttr {}
#[derive(Diagnostic)]
@@ -73,27 +72,25 @@ struct InvalidNestedStructAttr {}
#[derive(Diagnostic)]
#[diag(nonsense("foo"), code = "E0123", slug = "foo")]
-//~^ ERROR `#[diag(nonsense(...))]` is not a valid attribute
-//~^^ ERROR diagnostic slug not specified
+//~^ ERROR diagnostic slug must be the first argument
+//~| ERROR diagnostic slug not specified
struct InvalidNestedStructAttr1 {}
#[derive(Diagnostic)]
#[diag(nonsense = "...", code = "E0123", slug = "foo")]
-//~^ ERROR `#[diag(nonsense = ...)]` is not a valid attribute
-//~| ERROR `#[diag(slug = ...)]` is not a valid attribute
+//~^ ERROR unknown argument
//~| ERROR diagnostic slug not specified
struct InvalidNestedStructAttr2 {}
#[derive(Diagnostic)]
#[diag(nonsense = 4, code = "E0123", slug = "foo")]
-//~^ ERROR `#[diag(nonsense = ...)]` is not a valid attribute
-//~| ERROR `#[diag(slug = ...)]` is not a valid attribute
+//~^ ERROR unknown argument
//~| ERROR diagnostic slug not specified
struct InvalidNestedStructAttr3 {}
#[derive(Diagnostic)]
#[diag(no_crate_example, code = "E0123", slug = "foo")]
-//~^ ERROR `#[diag(slug = ...)]` is not a valid attribute
+//~^ ERROR unknown argument
struct InvalidNestedStructAttr4 {}
#[derive(Diagnostic)]
@@ -118,7 +115,7 @@ struct CodeSpecifiedTwice {}
#[derive(Diagnostic)]
#[diag(no_crate_example, no_crate::example, code = "E0456")]
-//~^ ERROR `#[diag(no_crate::example)]` is not a valid attribute
+//~^ ERROR diagnostic slug must be the first argument
struct SlugSpecifiedTwice {}
#[derive(Diagnostic)]
@@ -232,7 +229,7 @@ struct SuggestWithoutCode {
#[diag(no_crate_example, code = "E0123")]
struct SuggestWithBadKey {
#[suggestion(nonsense = "bar")]
- //~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute
+ //~^ ERROR invalid nested attribute
//~| ERROR suggestion without `code = "..."`
suggestion: (Span, Applicability),
}
@@ -241,7 +238,7 @@ struct SuggestWithBadKey {
#[diag(no_crate_example, code = "E0123")]
struct SuggestWithShorthandMsg {
#[suggestion(msg = "bar")]
- //~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute
+ //~^ ERROR invalid nested attribute
//~| ERROR suggestion without `code = "..."`
suggestion: (Span, Applicability),
}
@@ -514,10 +511,23 @@ struct OptUnitField {
}
#[derive(Diagnostic)]
+#[diag(no_crate_example)]
+struct BoolField {
+ #[primary_span]
+ spans: Span,
+ #[help]
+ foo: bool,
+ #[help(no_crate_help)]
+ //~^ ERROR the `#[help(...)]` attribute can only be applied to fields of type
+ // only allow plain 'bool' fields
+ bar: Option<bool>,
+}
+
+#[derive(Diagnostic)]
#[diag(no_crate_example, code = "E0123")]
struct LabelWithTrailingPath {
#[label(no_crate_label, foo)]
- //~^ ERROR `#[label(foo)]` is not a valid attribute
+ //~^ ERROR a diagnostic slug must be the first argument to the attribute
span: Span,
}
@@ -525,7 +535,7 @@ struct LabelWithTrailingPath {
#[diag(no_crate_example, code = "E0123")]
struct LabelWithTrailingNameValue {
#[label(no_crate_label, foo = "...")]
- //~^ ERROR `#[label(foo = ...)]` is not a valid attribute
+ //~^ ERROR invalid nested attribute
span: Span,
}
@@ -533,7 +543,7 @@ struct LabelWithTrailingNameValue {
#[diag(no_crate_example, code = "E0123")]
struct LabelWithTrailingList {
#[label(no_crate_label, foo("..."))]
- //~^ ERROR `#[label(foo(...))]` is not a valid attribute
+ //~^ ERROR invalid nested attribute
span: Span,
}
@@ -630,8 +640,8 @@ struct MissingCodeInSuggestion {
//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
//~| ERROR cannot find attribute `multipart_suggestion` in this scope
#[multipart_suggestion()]
-//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
-//~| ERROR cannot find attribute `multipart_suggestion` in this scope
+//~^ ERROR cannot find attribute `multipart_suggestion` in this scope
+//~| ERROR unexpected end of input, unexpected token in nested attribute, expected ident
struct MultipartSuggestion {
#[multipart_suggestion(no_crate_suggestion)]
//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
@@ -685,7 +695,7 @@ struct RawIdentDiagnosticArg {
#[diag(no_crate_example)]
struct SubdiagnosticBad {
#[subdiagnostic(bad)]
- //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
+ //~^ ERROR `eager` is the only supported nested attribute for `subdiagnostic`
note: Note,
}
@@ -701,7 +711,7 @@ struct SubdiagnosticBadStr {
#[diag(no_crate_example)]
struct SubdiagnosticBadTwice {
#[subdiagnostic(bad, bad)]
- //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
+ //~^ ERROR `eager` is the only supported nested attribute for `subdiagnostic`
note: Note,
}
@@ -709,7 +719,7 @@ struct SubdiagnosticBadTwice {
#[diag(no_crate_example)]
struct SubdiagnosticBadLitStr {
#[subdiagnostic("bad")]
- //~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
+ //~^ ERROR `eager` is the only supported nested attribute for `subdiagnostic`
note: Note,
}
@@ -784,14 +794,15 @@ struct SuggestionsNoItem {
struct SuggestionsInvalidItem {
#[suggestion(code(foo))]
//~^ ERROR `code(...)` must contain only string literals
+ //~| ERROR unexpected token
sub: Span,
}
-#[derive(Diagnostic)]
+#[derive(Diagnostic)] //~ ERROR cannot find value `__code_34` in this scope
#[diag(no_crate_example)]
struct SuggestionsInvalidLiteral {
#[suggestion(code = 3)]
- //~^ ERROR `code = "..."`/`code(...)` must contain only string literals
+ //~^ ERROR expected string literal
sub: Span,
}
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index fc0cd8419..a2f3bb527 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -20,11 +20,11 @@ LL | Bar,
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[diag = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:52:1
+error: expected parentheses: #[diag(...)]
+ --> $DIR/diagnostic-derive.rs:52:8
|
LL | #[diag = "E0123"]
- | ^^^^^^^^^^^^^^^^^
+ | ^
error: `#[nonsense(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:57:1
@@ -44,35 +44,24 @@ LL | | struct InvalidStructAttr {}
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[diag("...")]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:64:8
- |
-LL | #[diag("E0123")]
- | ^^^^^^^
- |
- = help: a diagnostic slug is required as the first argument
-
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:64:1
|
LL | / #[diag("E0123")]
LL | |
-LL | |
LL | | struct InvalidLitNestedAttr {}
| |______________________________^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[diag(nonsense(...))]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:75:8
+error: diagnostic slug must be the first argument
+ --> $DIR/diagnostic-derive.rs:74:16
|
LL | #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^^^^
- |
- = help: a diagnostic slug is required as the first argument
+ | ^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:75:1
+ --> $DIR/diagnostic-derive.rs:74:1
|
LL | / #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
LL | |
@@ -82,120 +71,102 @@ LL | | struct InvalidNestedStructAttr1 {}
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[diag(nonsense = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:81:8
- |
-LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^^^^^
- |
- = help: only `code` is a valid nested attributes following the slug
-
-error: `#[diag(slug = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:81:42
+error: unknown argument
+ --> $DIR/diagnostic-derive.rs:80:8
|
LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^
+ | ^^^^^^^^
|
- = help: only `code` is a valid nested attributes following the slug
+ = note: only the `code` parameter is valid after the slug
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:81:1
+ --> $DIR/diagnostic-derive.rs:80:1
|
LL | / #[diag(nonsense = "...", code = "E0123", slug = "foo")]
LL | |
LL | |
-LL | |
LL | | struct InvalidNestedStructAttr2 {}
| |__________________________________^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[diag(nonsense = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:88:8
- |
-LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^
-
-error: `#[diag(slug = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:88:38
+error: unknown argument
+ --> $DIR/diagnostic-derive.rs:86:8
|
LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^
+ | ^^^^^^^^
|
- = help: only `code` is a valid nested attributes following the slug
+ = note: only the `code` parameter is valid after the slug
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:88:1
+ --> $DIR/diagnostic-derive.rs:86:1
|
LL | / #[diag(nonsense = 4, code = "E0123", slug = "foo")]
LL | |
LL | |
-LL | |
LL | | struct InvalidNestedStructAttr3 {}
| |__________________________________^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[diag(slug = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:95:42
+error: unknown argument
+ --> $DIR/diagnostic-derive.rs:92:42
|
LL | #[diag(no_crate_example, code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^
+ | ^^^^
|
- = help: only `code` is a valid nested attributes following the slug
+ = note: only the `code` parameter is valid after the slug
error: `#[suggestion = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:102:5
+ --> $DIR/diagnostic-derive.rs:99:5
|
LL | #[suggestion = "bar"]
| ^^^^^^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:109:8
+ --> $DIR/diagnostic-derive.rs:106:8
|
LL | #[diag(no_crate_example, code = "E0456")]
| ^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:108:8
+ --> $DIR/diagnostic-derive.rs:105:8
|
LL | #[diag(no_crate_example, code = "E0123")]
| ^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:109:33
+ --> $DIR/diagnostic-derive.rs:106:26
|
LL | #[diag(no_crate_example, code = "E0456")]
- | ^^^^^^^
+ | ^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:108:33
+ --> $DIR/diagnostic-derive.rs:105:26
|
LL | #[diag(no_crate_example, code = "E0123")]
- | ^^^^^^^
+ | ^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:115:49
+ --> $DIR/diagnostic-derive.rs:112:42
|
LL | #[diag(no_crate_example, code = "E0456", code = "E0457")]
- | ^^^^^^^
+ | ^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:115:33
+ --> $DIR/diagnostic-derive.rs:112:26
|
LL | #[diag(no_crate_example, code = "E0456", code = "E0457")]
- | ^^^^^^^
+ | ^^^^
-error: `#[diag(no_crate::example)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:120:26
+error: diagnostic slug must be the first argument
+ --> $DIR/diagnostic-derive.rs:117:43
|
LL | #[diag(no_crate_example, no_crate::example, code = "E0456")]
- | ^^^^^^^^^^^^^^^^^
- |
- = help: diagnostic slug must be the first argument
+ | ^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:125:1
+ --> $DIR/diagnostic-derive.rs:122:1
|
LL | struct KindNotProvided {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -203,7 +174,7 @@ LL | struct KindNotProvided {}
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:128:1
+ --> $DIR/diagnostic-derive.rs:125:1
|
LL | / #[diag(code = "E0456")]
LL | |
@@ -213,31 +184,31 @@ LL | | struct SlugNotProvided {}
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/diagnostic-derive.rs:139:5
+ --> $DIR/diagnostic-derive.rs:136:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: `#[nonsense]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:147:5
+ --> $DIR/diagnostic-derive.rs:144:5
|
LL | #[nonsense]
| ^^^^^^^^^^^
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/diagnostic-derive.rs:164:5
+ --> $DIR/diagnostic-derive.rs:161:5
|
LL | #[label(no_crate_label)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: `name` doesn't refer to a field on this type
- --> $DIR/diagnostic-derive.rs:172:46
+ --> $DIR/diagnostic-derive.rs:169:46
|
LL | #[suggestion(no_crate_suggestion, code = "{name}")]
| ^^^^^^^^
error: invalid format string: expected `'}'` but string was terminated
- --> $DIR/diagnostic-derive.rs:177:10
+ --> $DIR/diagnostic-derive.rs:174:10
|
LL | #[derive(Diagnostic)]
| ^^^^^^^^^^ expected `'}'` in format string
@@ -246,7 +217,7 @@ LL | #[derive(Diagnostic)]
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid format string: unmatched `}` found
- --> $DIR/diagnostic-derive.rs:187:10
+ --> $DIR/diagnostic-derive.rs:184:10
|
LL | #[derive(Diagnostic)]
| ^^^^^^^^^^ unmatched `}` in format string
@@ -255,47 +226,47 @@ LL | #[derive(Diagnostic)]
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/diagnostic-derive.rs:207:5
+ --> $DIR/diagnostic-derive.rs:204:5
|
LL | #[label(no_crate_label)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: suggestion without `code = "..."`
- --> $DIR/diagnostic-derive.rs:226:5
+ --> $DIR/diagnostic-derive.rs:223:5
|
LL | #[suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: `#[suggestion(nonsense = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:234:18
+error: invalid nested attribute
+ --> $DIR/diagnostic-derive.rs:231:18
|
LL | #[suggestion(nonsense = "bar")]
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^^^
|
= help: only `style`, `code` and `applicability` are valid nested attributes
error: suggestion without `code = "..."`
- --> $DIR/diagnostic-derive.rs:234:5
+ --> $DIR/diagnostic-derive.rs:231:5
|
LL | #[suggestion(nonsense = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: `#[suggestion(msg = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:243:18
+error: invalid nested attribute
+ --> $DIR/diagnostic-derive.rs:240:18
|
LL | #[suggestion(msg = "bar")]
- | ^^^^^^^^^^^
+ | ^^^
|
= help: only `style`, `code` and `applicability` are valid nested attributes
error: suggestion without `code = "..."`
- --> $DIR/diagnostic-derive.rs:243:5
+ --> $DIR/diagnostic-derive.rs:240:5
|
LL | #[suggestion(msg = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: wrong field type for suggestion
- --> $DIR/diagnostic-derive.rs:266:5
+ --> $DIR/diagnostic-derive.rs:263:5
|
LL | / #[suggestion(no_crate_suggestion, code = "This is suggested code")]
LL | |
@@ -305,75 +276,79 @@ LL | | suggestion: Applicability,
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:282:24
+ --> $DIR/diagnostic-derive.rs:279:24
|
LL | suggestion: (Span, Span, Applicability),
| ^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:282:18
+ --> $DIR/diagnostic-derive.rs:279:18
|
LL | suggestion: (Span, Span, Applicability),
| ^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:290:33
+ --> $DIR/diagnostic-derive.rs:287:33
|
LL | suggestion: (Applicability, Applicability, Span),
| ^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:290:18
+ --> $DIR/diagnostic-derive.rs:287:18
|
LL | suggestion: (Applicability, Applicability, Span),
| ^^^^^^^^^^^^^
error: `#[label = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:297:5
+ --> $DIR/diagnostic-derive.rs:294:5
|
LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:448:53
+ --> $DIR/diagnostic-derive.rs:445:5
|
LL | #[suggestion(no_crate_suggestion, code = "...", applicability = "maybe-incorrect")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:450:24
+ --> $DIR/diagnostic-derive.rs:447:24
|
LL | suggestion: (Span, Applicability),
| ^^^^^^^^^^^^^
error: invalid applicability
- --> $DIR/diagnostic-derive.rs:456:53
+ --> $DIR/diagnostic-derive.rs:453:69
|
LL | #[suggestion(no_crate_suggestion, code = "...", applicability = "batman")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^
-error: `#[label(foo)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:519:29
+error: the `#[help(...)]` attribute can only be applied to fields of type `Span`, `MultiSpan`, `bool` or `()`
+ --> $DIR/diagnostic-derive.rs:520:5
|
-LL | #[label(no_crate_label, foo)]
- | ^^^
+LL | #[help(no_crate_help)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: a diagnostic slug must be the first argument to the attribute
+ --> $DIR/diagnostic-derive.rs:529:32
|
- = help: a diagnostic slug must be the first argument to the attribute
+LL | #[label(no_crate_label, foo)]
+ | ^
-error: `#[label(foo = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:527:29
+error: invalid nested attribute
+ --> $DIR/diagnostic-derive.rs:537:29
|
LL | #[label(no_crate_label, foo = "...")]
- | ^^^^^^^^^^^
+ | ^^^
-error: `#[label(foo(...))]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:535:29
+error: invalid nested attribute
+ --> $DIR/diagnostic-derive.rs:545:29
|
LL | #[label(no_crate_label, foo("..."))]
- | ^^^^^^^^^^
+ | ^^^
error: `#[primary_span]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:547:5
+ --> $DIR/diagnostic-derive.rs:557:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
@@ -381,13 +356,13 @@ LL | #[primary_span]
= help: the `primary_span` field attribute is not valid for lint diagnostics
error: `#[error(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:567:1
+ --> $DIR/diagnostic-derive.rs:577:1
|
LL | #[error(no_crate_example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:567:1
+ --> $DIR/diagnostic-derive.rs:577:1
|
LL | / #[error(no_crate_example, code = "E0123")]
LL | |
@@ -399,13 +374,13 @@ LL | | struct ErrorAttribute {}
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
error: `#[warn_(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:574:1
+ --> $DIR/diagnostic-derive.rs:584:1
|
LL | #[warn_(no_crate_example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:574:1
+ --> $DIR/diagnostic-derive.rs:584:1
|
LL | / #[warn_(no_crate_example, code = "E0123")]
LL | |
@@ -417,13 +392,13 @@ LL | | struct WarnAttribute {}
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
error: `#[lint(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:581:1
+ --> $DIR/diagnostic-derive.rs:591:1
|
LL | #[lint(no_crate_example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:581:1
+ --> $DIR/diagnostic-derive.rs:591:1
|
LL | / #[lint(no_crate_example, code = "E0123")]
LL | |
@@ -435,19 +410,19 @@ LL | | struct LintAttributeOnSessionDiag {}
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
error: `#[lint(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:588:1
+ --> $DIR/diagnostic-derive.rs:598:1
|
LL | #[lint(no_crate_example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[lint(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:588:1
+ --> $DIR/diagnostic-derive.rs:598:1
|
LL | #[lint(no_crate_example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:588:1
+ --> $DIR/diagnostic-derive.rs:598:1
|
LL | / #[lint(no_crate_example, code = "E0123")]
LL | |
@@ -460,19 +435,19 @@ LL | | struct LintAttributeOnLintDiag {}
= help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest_example)]`
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:598:53
+ --> $DIR/diagnostic-derive.rs:608:53
|
LL | #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
- | ^^^^^^^^^^^^
+ | ^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:598:39
+ --> $DIR/diagnostic-derive.rs:608:39
|
LL | #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
- | ^^^^^^^^^^^^
+ | ^^^^
error: wrong types for suggestion
- --> $DIR/diagnostic-derive.rs:607:24
+ --> $DIR/diagnostic-derive.rs:617:24
|
LL | suggestion: (Span, usize),
| ^^^^^
@@ -480,7 +455,7 @@ LL | suggestion: (Span, usize),
= help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
error: wrong types for suggestion
- --> $DIR/diagnostic-derive.rs:615:17
+ --> $DIR/diagnostic-derive.rs:625:17
|
LL | suggestion: (Span,),
| ^^^^^^^
@@ -488,13 +463,13 @@ LL | suggestion: (Span,),
= help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
error: suggestion without `code = "..."`
- --> $DIR/diagnostic-derive.rs:622:5
+ --> $DIR/diagnostic-derive.rs:632:5
|
LL | #[suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[multipart_suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:629:1
+ --> $DIR/diagnostic-derive.rs:639:1
|
LL | #[multipart_suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -502,23 +477,21 @@ LL | #[multipart_suggestion(no_crate_suggestion)]
= help: consider creating a `Subdiagnostic` instead
error: `#[multipart_suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:632:1
- |
-LL | #[multipart_suggestion()]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: consider creating a `Subdiagnostic` instead
-
-error: `#[multipart_suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:636:5
+ --> $DIR/diagnostic-derive.rs:646:5
|
LL | #[multipart_suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider creating a `Subdiagnostic` instead
+error: unexpected end of input, unexpected token in nested attribute, expected ident
+ --> $DIR/diagnostic-derive.rs:642:24
+ |
+LL | #[multipart_suggestion()]
+ | ^
+
error: `#[suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:644:1
+ --> $DIR/diagnostic-derive.rs:654:1
|
LL | #[suggestion(no_crate_suggestion, code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -526,45 +499,39 @@ LL | #[suggestion(no_crate_suggestion, code = "...")]
= help: `#[label]` and `#[suggestion]` can only be applied to fields
error: `#[label]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:653:1
+ --> $DIR/diagnostic-derive.rs:663:1
|
LL | #[label]
| ^^^^^^^^
|
= help: `#[label]` and `#[suggestion]` can only be applied to fields
-error: `#[subdiagnostic(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:687:5
+error: `eager` is the only supported nested attribute for `subdiagnostic`
+ --> $DIR/diagnostic-derive.rs:697:7
|
LL | #[subdiagnostic(bad)]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = help: `eager` is the only supported nested attribute for `subdiagnostic`
+ | ^^^^^^^^^^^^^^^^^^
error: `#[subdiagnostic = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:695:5
+ --> $DIR/diagnostic-derive.rs:705:5
|
LL | #[subdiagnostic = "bad"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
-error: `#[subdiagnostic(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:703:5
+error: `eager` is the only supported nested attribute for `subdiagnostic`
+ --> $DIR/diagnostic-derive.rs:713:7
|
LL | #[subdiagnostic(bad, bad)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: `eager` is the only supported nested attribute for `subdiagnostic`
+ | ^^^^^^^^^^^^^^^^^^^^^^^
-error: `#[subdiagnostic(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:711:5
+error: `eager` is the only supported nested attribute for `subdiagnostic`
+ --> $DIR/diagnostic-derive.rs:721:7
|
LL | #[subdiagnostic("bad")]
- | ^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: `eager` is the only supported nested attribute for `subdiagnostic`
+ | ^^^^^^^^^^^^^^^^^^^^
error: `#[subdiagnostic(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:719:5
+ --> $DIR/diagnostic-derive.rs:729:5
|
LL | #[subdiagnostic(eager)]
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -572,25 +539,31 @@ LL | #[subdiagnostic(eager)]
= help: eager subdiagnostics are not supported on lints
error: expected at least one string literal for `code(...)`
- --> $DIR/diagnostic-derive.rs:777:18
+ --> $DIR/diagnostic-derive.rs:787:23
|
LL | #[suggestion(code())]
- | ^^^^^^
+ | ^
error: `code(...)` must contain only string literals
- --> $DIR/diagnostic-derive.rs:785:23
+ --> $DIR/diagnostic-derive.rs:795:23
+ |
+LL | #[suggestion(code(foo))]
+ | ^^^
+
+error: unexpected token
+ --> $DIR/diagnostic-derive.rs:795:23
|
LL | #[suggestion(code(foo))]
| ^^^
-error: `code = "..."`/`code(...)` must contain only string literals
- --> $DIR/diagnostic-derive.rs:793:18
+error: expected string literal
+ --> $DIR/diagnostic-derive.rs:804:25
|
LL | #[suggestion(code = 3)]
- | ^^^^^^^^
+ | ^
error: `#[suggestion(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:808:5
+ --> $DIR/diagnostic-derive.rs:819:5
|
LL | #[suggestion(no_crate_suggestion, code = "")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -606,61 +579,69 @@ LL | #[nonsense(no_crate_example, code = "E0123")]
| ^^^^^^^^
error: cannot find attribute `nonsense` in this scope
- --> $DIR/diagnostic-derive.rs:147:7
+ --> $DIR/diagnostic-derive.rs:144:7
|
LL | #[nonsense]
| ^^^^^^^^
error: cannot find attribute `error` in this scope
- --> $DIR/diagnostic-derive.rs:567:3
+ --> $DIR/diagnostic-derive.rs:577:3
|
LL | #[error(no_crate_example, code = "E0123")]
| ^^^^^
error: cannot find attribute `warn_` in this scope
- --> $DIR/diagnostic-derive.rs:574:3
+ --> $DIR/diagnostic-derive.rs:584:3
|
LL | #[warn_(no_crate_example, code = "E0123")]
| ^^^^^ help: a built-in attribute with a similar name exists: `warn`
error: cannot find attribute `lint` in this scope
- --> $DIR/diagnostic-derive.rs:581:3
+ --> $DIR/diagnostic-derive.rs:591:3
|
LL | #[lint(no_crate_example, code = "E0123")]
| ^^^^ help: a built-in attribute with a similar name exists: `link`
error: cannot find attribute `lint` in this scope
- --> $DIR/diagnostic-derive.rs:588:3
+ --> $DIR/diagnostic-derive.rs:598:3
|
LL | #[lint(no_crate_example, code = "E0123")]
| ^^^^ help: a built-in attribute with a similar name exists: `link`
error: cannot find attribute `multipart_suggestion` in this scope
- --> $DIR/diagnostic-derive.rs:629:3
+ --> $DIR/diagnostic-derive.rs:639:3
|
LL | #[multipart_suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^
error: cannot find attribute `multipart_suggestion` in this scope
- --> $DIR/diagnostic-derive.rs:632:3
+ --> $DIR/diagnostic-derive.rs:642:3
|
LL | #[multipart_suggestion()]
| ^^^^^^^^^^^^^^^^^^^^
error: cannot find attribute `multipart_suggestion` in this scope
- --> $DIR/diagnostic-derive.rs:636:7
+ --> $DIR/diagnostic-derive.rs:646:7
|
LL | #[multipart_suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^
error[E0425]: cannot find value `nonsense` in module `crate::fluent_generated`
- --> $DIR/diagnostic-derive.rs:70:8
+ --> $DIR/diagnostic-derive.rs:69:8
|
LL | #[diag(nonsense, code = "E0123")]
| ^^^^^^^^ not found in `crate::fluent_generated`
+error[E0425]: cannot find value `__code_34` in this scope
+ --> $DIR/diagnostic-derive.rs:801:10
+ |
+LL | #[derive(Diagnostic)]
+ | ^^^^^^^^^^ not found in this scope
+ |
+ = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
- --> $DIR/diagnostic-derive.rs:341:10
+ --> $DIR/diagnostic-derive.rs:338:10
|
LL | #[derive(Diagnostic)]
| ^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
index c882f7792..1d928ca93 100644
--- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
@@ -82,7 +82,7 @@ struct F {
#[derive(Subdiagnostic)]
#[label(bug = "...")]
-//~^ ERROR `#[label(bug = ...)]` is not a valid attribute
+//~^ ERROR invalid nested attribute
//~| ERROR diagnostic slug must be first argument
struct G {
#[primary_span]
@@ -92,8 +92,7 @@ struct G {
#[derive(Subdiagnostic)]
#[label("...")]
-//~^ ERROR `#[label("...")]` is not a valid attribute
-//~| ERROR diagnostic slug must be first argument
+//~^ ERROR unexpected literal in nested attribute, expected ident
struct H {
#[primary_span]
span: Span,
@@ -102,7 +101,7 @@ struct H {
#[derive(Subdiagnostic)]
#[label(slug = 4)]
-//~^ ERROR `#[label(slug = ...)]` is not a valid attribute
+//~^ ERROR invalid nested attribute
//~| ERROR diagnostic slug must be first argument
struct J {
#[primary_span]
@@ -112,7 +111,7 @@ struct J {
#[derive(Subdiagnostic)]
#[label(slug("..."))]
-//~^ ERROR `#[label(slug(...))]` is not a valid attribute
+//~^ ERROR invalid nested attribute
//~| ERROR diagnostic slug must be first argument
struct K {
#[primary_span]
@@ -132,7 +131,7 @@ struct L {
#[derive(Subdiagnostic)]
#[label()]
-//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
+//~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
struct M {
#[primary_span]
span: Span,
@@ -141,7 +140,7 @@ struct M {
#[derive(Subdiagnostic)]
#[label(no_crate_example, code = "...")]
-//~^ ERROR `#[label(code = ...)]` is not a valid attribute
+//~^ ERROR invalid nested attribute
struct N {
#[primary_span]
span: Span,
@@ -150,7 +149,7 @@ struct N {
#[derive(Subdiagnostic)]
#[label(no_crate_example, applicability = "machine-applicable")]
-//~^ ERROR `#[label(applicability = ...)]` is not a valid attribute
+//~^ ERROR invalid nested attribute
struct O {
#[primary_span]
span: Span,
@@ -222,7 +221,7 @@ enum T {
enum U {
#[label(code = "...")]
//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
- //~| ERROR `#[label(code = ...)]` is not a valid attribute
+ //~| ERROR invalid nested attribute
A {
#[primary_span]
span: Span,
@@ -323,7 +322,7 @@ struct AD {
#[derive(Subdiagnostic)]
#[label(no_crate_example, no_crate::example)]
-//~^ ERROR `#[label(no_crate::example)]` is not a valid attribute
+//~^ ERROR a diagnostic slug must be the first argument to the attribute
struct AE {
#[primary_span]
span: Span,
@@ -537,7 +536,7 @@ struct BA {
#[derive(Subdiagnostic)]
#[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
//~^ ERROR multipart suggestion without any `#[suggestion_part(...)]` fields
-//~| ERROR `#[multipart_suggestion(code = ...)]` is not a valid attribute
+//~| ERROR invalid nested attribute
struct BBa {
var: String,
}
@@ -554,7 +553,7 @@ struct BBb {
#[multipart_suggestion(no_crate_example, applicability = "machine-applicable")]
struct BBc {
#[suggestion_part()]
- //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
+ //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
span1: Span,
}
@@ -574,10 +573,11 @@ struct BD {
//~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
span1: Span,
#[suggestion_part()]
- //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
+ //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
span2: Span,
#[suggestion_part(foo = "bar")]
- //~^ ERROR `#[suggestion_part(foo = ...)]` is not a valid attribute
+ //~^ ERROR `code` is the only valid nested attribute
+ //~| ERROR expected `,`
span4: Span,
#[suggestion_part(code = "...")]
//~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@@ -669,6 +669,7 @@ enum BL {
struct BM {
#[suggestion_part(code("foo"))]
//~^ ERROR expected exactly one string literal for `code = ...`
+ //~| ERROR unexpected token
span: Span,
r#type: String,
}
@@ -678,6 +679,7 @@ struct BM {
struct BN {
#[suggestion_part(code("foo", "bar"))]
//~^ ERROR expected exactly one string literal for `code = ...`
+ //~| ERROR unexpected token
span: Span,
r#type: String,
}
@@ -687,6 +689,7 @@ struct BN {
struct BO {
#[suggestion_part(code(3))]
//~^ ERROR expected exactly one string literal for `code = ...`
+ //~| ERROR unexpected token
span: Span,
r#type: String,
}
@@ -701,10 +704,13 @@ struct BP {
}
#[derive(Subdiagnostic)]
+//~^ ERROR cannot find value `__code_29` in this scope
+//~| NOTE in this expansion
+//~| NOTE not found in this scope
#[multipart_suggestion(no_crate_example)]
struct BQ {
#[suggestion_part(code = 3)]
- //~^ ERROR `code = "..."`/`code(...)` must contain only string literals
+ //~^ ERROR expected string literal
span: Span,
r#type: String,
}
@@ -779,7 +785,7 @@ struct SuggestionStyleInvalid1 {
#[derive(Subdiagnostic)]
#[suggestion(no_crate_example, code = "", style = 42)]
-//~^ ERROR `#[suggestion(style = ...)]` is not a valid attribute
+//~^ ERROR expected `= "xxx"`
struct SuggestionStyleInvalid2 {
#[primary_span]
sub: Span,
@@ -787,7 +793,7 @@ struct SuggestionStyleInvalid2 {
#[derive(Subdiagnostic)]
#[suggestion(no_crate_example, code = "", style)]
-//~^ ERROR `#[suggestion(style)]` is not a valid attribute
+//~^ ERROR a diagnostic slug must be the first argument to the attribute
struct SuggestionStyleInvalid3 {
#[primary_span]
sub: Span,
@@ -795,7 +801,8 @@ struct SuggestionStyleInvalid3 {
#[derive(Subdiagnostic)]
#[suggestion(no_crate_example, code = "", style("foo"))]
-//~^ ERROR `#[suggestion(style(...))]` is not a valid attribute
+//~^ ERROR expected `= "xxx"`
+//~| ERROr expected `,`
struct SuggestionStyleInvalid4 {
#[primary_span]
sub: Span,
diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
index 343134af6..4211b91f0 100644
--- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
@@ -26,11 +26,11 @@ error: `#[label = ...]` is not a valid attribute
LL | #[label = "..."]
| ^^^^^^^^^^^^^^^^
-error: `#[label(bug = ...)]` is not a valid attribute
+error: invalid nested attribute
--> $DIR/subdiagnostic-derive.rs:84:9
|
LL | #[label(bug = "...")]
- | ^^^^^^^^^^^
+ | ^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive.rs:84:1
@@ -38,110 +38,104 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute
LL | #[label(bug = "...")]
| ^^^^^^^^^^^^^^^^^^^^^
-error: `#[label("...")]` is not a valid attribute
+error: unexpected literal in nested attribute, expected ident
--> $DIR/subdiagnostic-derive.rs:94:9
|
LL | #[label("...")]
| ^^^^^
-error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:94:1
- |
-LL | #[label("...")]
- | ^^^^^^^^^^^^^^^
-
-error: `#[label(slug = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:104:9
+error: invalid nested attribute
+ --> $DIR/subdiagnostic-derive.rs:103:9
|
LL | #[label(slug = 4)]
- | ^^^^^^^^
+ | ^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:104:1
+ --> $DIR/subdiagnostic-derive.rs:103:1
|
LL | #[label(slug = 4)]
| ^^^^^^^^^^^^^^^^^^
-error: `#[label(slug(...))]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:114:9
+error: invalid nested attribute
+ --> $DIR/subdiagnostic-derive.rs:113:9
|
LL | #[label(slug("..."))]
- | ^^^^^^^^^^^
+ | ^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:114:1
+ --> $DIR/subdiagnostic-derive.rs:113:1
|
LL | #[label(slug("..."))]
| ^^^^^^^^^^^^^^^^^^^^^
-error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:134:1
+error: unexpected end of input, unexpected token in nested attribute, expected ident
+ --> $DIR/subdiagnostic-derive.rs:133:9
|
LL | #[label()]
- | ^^^^^^^^^^
+ | ^
-error: `#[label(code = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:143:27
+error: invalid nested attribute
+ --> $DIR/subdiagnostic-derive.rs:142:27
|
LL | #[label(no_crate_example, code = "...")]
- | ^^^^^^^^^^^^
+ | ^^^^
-error: `#[label(applicability = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:152:27
+error: invalid nested attribute
+ --> $DIR/subdiagnostic-derive.rs:151:27
|
LL | #[label(no_crate_example, applicability = "machine-applicable")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^
error: unsupported type attribute for subdiagnostic enum
- --> $DIR/subdiagnostic-derive.rs:161:1
+ --> $DIR/subdiagnostic-derive.rs:160:1
|
LL | #[foo]
| ^^^^^^
error: `#[bar]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:175:5
+ --> $DIR/subdiagnostic-derive.rs:174:5
|
LL | #[bar]
| ^^^^^^
error: `#[bar = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:187:5
+ --> $DIR/subdiagnostic-derive.rs:186:5
|
LL | #[bar = "..."]
| ^^^^^^^^^^^^^^
error: `#[bar = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:199:5
+ --> $DIR/subdiagnostic-derive.rs:198:5
|
LL | #[bar = 4]
| ^^^^^^^^^^
error: `#[bar(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:211:5
+ --> $DIR/subdiagnostic-derive.rs:210:5
|
LL | #[bar("...")]
| ^^^^^^^^^^^^^
-error: `#[label(code = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:223:13
+error: invalid nested attribute
+ --> $DIR/subdiagnostic-derive.rs:222:13
|
LL | #[label(code = "...")]
- | ^^^^^^^^^^^^
+ | ^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:223:5
+ --> $DIR/subdiagnostic-derive.rs:222:5
|
LL | #[label(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^
error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/subdiagnostic-derive.rs:252:5
+ --> $DIR/subdiagnostic-derive.rs:251:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: label without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:249:1
+ --> $DIR/subdiagnostic-derive.rs:248:1
|
LL | / #[label(no_crate_example)]
LL | |
@@ -153,13 +147,13 @@ LL | | }
| |_^
error: `#[applicability]` is only valid on suggestions
- --> $DIR/subdiagnostic-derive.rs:262:5
+ --> $DIR/subdiagnostic-derive.rs:261:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: `#[bar]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:272:5
+ --> $DIR/subdiagnostic-derive.rs:271:5
|
LL | #[bar]
| ^^^^^^
@@ -167,13 +161,13 @@ LL | #[bar]
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
error: `#[bar = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:283:5
+ --> $DIR/subdiagnostic-derive.rs:282:5
|
LL | #[bar = "..."]
| ^^^^^^^^^^^^^^
error: `#[bar(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:294:5
+ --> $DIR/subdiagnostic-derive.rs:293:5
|
LL | #[bar("...")]
| ^^^^^^^^^^^^^
@@ -181,7 +175,7 @@ LL | #[bar("...")]
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
error: unexpected unsupported untagged union
- --> $DIR/subdiagnostic-derive.rs:310:1
+ --> $DIR/subdiagnostic-derive.rs:309:1
|
LL | / union AC {
LL | |
@@ -190,76 +184,74 @@ LL | | b: u64,
LL | | }
| |_^
-error: `#[label(no_crate::example)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:325:27
+error: a diagnostic slug must be the first argument to the attribute
+ --> $DIR/subdiagnostic-derive.rs:324:44
|
LL | #[label(no_crate_example, no_crate::example)]
- | ^^^^^^^^^^^^^^^^^
- |
- = help: a diagnostic slug must be the first argument to the attribute
+ | ^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:338:5
+ --> $DIR/subdiagnostic-derive.rs:337:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:335:5
+ --> $DIR/subdiagnostic-derive.rs:334:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: subdiagnostic kind not specified
- --> $DIR/subdiagnostic-derive.rs:344:8
+ --> $DIR/subdiagnostic-derive.rs:343:8
|
LL | struct AG {
| ^^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:381:46
+ --> $DIR/subdiagnostic-derive.rs:380:46
|
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
- | ^^^^^^^^^^^^
+ | ^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:381:32
+ --> $DIR/subdiagnostic-derive.rs:380:32
|
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
- | ^^^^^^^^^^^^
+ | ^^^^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:399:5
+ --> $DIR/subdiagnostic-derive.rs:398:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:396:5
+ --> $DIR/subdiagnostic-derive.rs:395:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: the `#[applicability]` attribute can only be applied to fields of type `Applicability`
- --> $DIR/subdiagnostic-derive.rs:409:5
+ --> $DIR/subdiagnostic-derive.rs:408:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: suggestion without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:422:1
+ --> $DIR/subdiagnostic-derive.rs:421:1
|
LL | #[suggestion(no_crate_example)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid applicability
- --> $DIR/subdiagnostic-derive.rs:432:46
+ --> $DIR/subdiagnostic-derive.rs:431:62
|
LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")]
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^
error: suggestion without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:450:1
+ --> $DIR/subdiagnostic-derive.rs:449:1
|
LL | / #[suggestion(no_crate_example, code = "...")]
LL | |
@@ -269,25 +261,25 @@ LL | | }
| |_^
error: unsupported type attribute for subdiagnostic enum
- --> $DIR/subdiagnostic-derive.rs:464:1
+ --> $DIR/subdiagnostic-derive.rs:463:1
|
LL | #[label]
| ^^^^^^^^
error: `var` doesn't refer to a field on this type
- --> $DIR/subdiagnostic-derive.rs:484:39
+ --> $DIR/subdiagnostic-derive.rs:483:39
|
LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
| ^^^^^^^
error: `var` doesn't refer to a field on this type
- --> $DIR/subdiagnostic-derive.rs:503:43
+ --> $DIR/subdiagnostic-derive.rs:502:43
|
LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
| ^^^^^^^
error: `#[suggestion_part]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:526:5
+ --> $DIR/subdiagnostic-derive.rs:525:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
@@ -295,7 +287,7 @@ LL | #[suggestion_part]
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead
error: `#[suggestion_part(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:529:5
+ --> $DIR/subdiagnostic-derive.rs:528:5
|
LL | #[suggestion_part(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -303,7 +295,7 @@ LL | #[suggestion_part(code = "...")]
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions
error: suggestion without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:523:1
+ --> $DIR/subdiagnostic-derive.rs:522:1
|
LL | / #[suggestion(no_crate_example, code = "...")]
LL | |
@@ -314,16 +306,16 @@ LL | | var: String,
LL | | }
| |_^
-error: `#[multipart_suggestion(code = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:538:42
+error: invalid nested attribute
+ --> $DIR/subdiagnostic-derive.rs:537:42
|
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
- | ^^^^^^^^^^^^
+ | ^^^^
|
= help: only `style` and `applicability` are valid nested attributes
error: multipart suggestion without any `#[suggestion_part(...)]` fields
- --> $DIR/subdiagnostic-derive.rs:538:1
+ --> $DIR/subdiagnostic-derive.rs:537:1
|
LL | / #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
LL | |
@@ -334,19 +326,19 @@ LL | | }
| |_^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:548:5
+ --> $DIR/subdiagnostic-derive.rs:547:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
-error: `#[suggestion_part(...)]` attribute without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:556:5
+error: unexpected end of input, unexpected token in nested attribute, expected ident
+ --> $DIR/subdiagnostic-derive.rs:555:23
|
LL | #[suggestion_part()]
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^
error: `#[primary_span]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:565:5
+ --> $DIR/subdiagnostic-derive.rs:564:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
@@ -354,7 +346,7 @@ LL | #[primary_span]
= help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`
error: multipart suggestion without any `#[suggestion_part(...)]` fields
- --> $DIR/subdiagnostic-derive.rs:562:1
+ --> $DIR/subdiagnostic-derive.rs:561:1
|
LL | / #[multipart_suggestion(no_crate_example)]
LL | |
@@ -366,24 +358,16 @@ LL | | }
| |_^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:573:5
+ --> $DIR/subdiagnostic-derive.rs:572:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
-error: `#[suggestion_part(...)]` attribute without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:576:5
- |
-LL | #[suggestion_part()]
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: `#[suggestion_part(foo = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:579:23
+error: `code` is the only valid nested attribute
+ --> $DIR/subdiagnostic-derive.rs:578:23
|
LL | #[suggestion_part(foo = "bar")]
- | ^^^^^^^^^^^
- |
- = help: `code` is the only valid nested attribute
+ | ^^^
error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
--> $DIR/subdiagnostic-derive.rs:582:5
@@ -397,17 +381,29 @@ error: the `#[suggestion_part(...)]` attribute can only be applied to fields of
LL | #[suggestion_part()]
| ^^^^^^^^^^^^^^^^^^^^
+error: unexpected end of input, unexpected token in nested attribute, expected ident
+ --> $DIR/subdiagnostic-derive.rs:575:23
+ |
+LL | #[suggestion_part()]
+ | ^
+
+error: expected `,`
+ --> $DIR/subdiagnostic-derive.rs:578:27
+ |
+LL | #[suggestion_part(foo = "bar")]
+ | ^
+
error: specified multiple times
--> $DIR/subdiagnostic-derive.rs:593:37
|
LL | #[suggestion_part(code = "...", code = ",,,")]
- | ^^^^^^^^^^^^
+ | ^^^^
|
note: previously specified here
--> $DIR/subdiagnostic-derive.rs:593:23
|
LL | #[suggestion_part(code = "...", code = ",,,")]
- | ^^^^^^^^^^^^
+ | ^^^^
error: `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."`
--> $DIR/subdiagnostic-derive.rs:622:5
@@ -416,49 +412,67 @@ LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: expected exactly one string literal for `code = ...`
- --> $DIR/subdiagnostic-derive.rs:670:23
+ --> $DIR/subdiagnostic-derive.rs:670:34
|
LL | #[suggestion_part(code("foo"))]
- | ^^^^^^^^^^^
+ | ^
+
+error: unexpected token
+ --> $DIR/subdiagnostic-derive.rs:670:28
+ |
+LL | #[suggestion_part(code("foo"))]
+ | ^^^^^
error: expected exactly one string literal for `code = ...`
- --> $DIR/subdiagnostic-derive.rs:679:23
+ --> $DIR/subdiagnostic-derive.rs:680:41
+ |
+LL | #[suggestion_part(code("foo", "bar"))]
+ | ^
+
+error: unexpected token
+ --> $DIR/subdiagnostic-derive.rs:680:28
|
LL | #[suggestion_part(code("foo", "bar"))]
- | ^^^^^^^^^^^^^^^^^^
+ | ^^^^^
error: expected exactly one string literal for `code = ...`
- --> $DIR/subdiagnostic-derive.rs:688:23
+ --> $DIR/subdiagnostic-derive.rs:690:30
|
LL | #[suggestion_part(code(3))]
- | ^^^^^^^
+ | ^
+
+error: unexpected token
+ --> $DIR/subdiagnostic-derive.rs:690:28
+ |
+LL | #[suggestion_part(code(3))]
+ | ^
error: expected exactly one string literal for `code = ...`
- --> $DIR/subdiagnostic-derive.rs:697:23
+ --> $DIR/subdiagnostic-derive.rs:700:29
|
LL | #[suggestion_part(code())]
- | ^^^^^^
+ | ^
-error: `code = "..."`/`code(...)` must contain only string literals
- --> $DIR/subdiagnostic-derive.rs:706:23
+error: expected string literal
+ --> $DIR/subdiagnostic-derive.rs:712:30
|
LL | #[suggestion_part(code = 3)]
- | ^^^^^^^^
+ | ^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:748:61
+ --> $DIR/subdiagnostic-derive.rs:754:1
|
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:748:43
+ --> $DIR/subdiagnostic-derive.rs:754:1
|
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[suggestion_hidden(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:757:1
+ --> $DIR/subdiagnostic-derive.rs:763:1
|
LL | #[suggestion_hidden(no_crate_example, code = "")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -466,7 +480,7 @@ LL | #[suggestion_hidden(no_crate_example, code = "")]
= help: Use `#[suggestion(..., style = "hidden")]` instead
error: `#[suggestion_hidden(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:765:1
+ --> $DIR/subdiagnostic-derive.rs:771:1
|
LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -474,35 +488,39 @@ LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
= help: Use `#[suggestion(..., style = "hidden")]` instead
error: invalid suggestion style
- --> $DIR/subdiagnostic-derive.rs:773:51
+ --> $DIR/subdiagnostic-derive.rs:779:51
|
LL | #[suggestion(no_crate_example, code = "", style = "foo")]
| ^^^^^
|
= help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`
-error: `#[suggestion(style = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:781:43
+error: expected `= "xxx"`
+ --> $DIR/subdiagnostic-derive.rs:787:49
|
LL | #[suggestion(no_crate_example, code = "", style = 42)]
- | ^^^^^^^^^^
+ | ^
-error: `#[suggestion(style)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:789:43
+error: a diagnostic slug must be the first argument to the attribute
+ --> $DIR/subdiagnostic-derive.rs:795:48
|
LL | #[suggestion(no_crate_example, code = "", style)]
- | ^^^^^
+ | ^
+
+error: expected `= "xxx"`
+ --> $DIR/subdiagnostic-derive.rs:803:48
|
- = help: a diagnostic slug must be the first argument to the attribute
+LL | #[suggestion(no_crate_example, code = "", style("foo"))]
+ | ^
-error: `#[suggestion(style(...))]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:797:43
+error: expected `,`
+ --> $DIR/subdiagnostic-derive.rs:803:48
|
LL | #[suggestion(no_crate_example, code = "", style("foo"))]
- | ^^^^^^^^^^^^
+ | ^
error: `#[primary_span]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:808:5
+ --> $DIR/subdiagnostic-derive.rs:815:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
@@ -511,7 +529,7 @@ LL | #[primary_span]
= help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead
error: suggestion without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:805:1
+ --> $DIR/subdiagnostic-derive.rs:812:1
|
LL | / #[suggestion(no_crate_example, code = "")]
LL | |
@@ -529,59 +547,67 @@ LL | #[foo]
| ^^^
error: cannot find attribute `foo` in this scope
- --> $DIR/subdiagnostic-derive.rs:161:3
+ --> $DIR/subdiagnostic-derive.rs:160:3
|
LL | #[foo]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:175:7
+ --> $DIR/subdiagnostic-derive.rs:174:7
|
LL | #[bar]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:187:7
+ --> $DIR/subdiagnostic-derive.rs:186:7
|
LL | #[bar = "..."]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:199:7
+ --> $DIR/subdiagnostic-derive.rs:198:7
|
LL | #[bar = 4]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:211:7
+ --> $DIR/subdiagnostic-derive.rs:210:7
|
LL | #[bar("...")]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:272:7
+ --> $DIR/subdiagnostic-derive.rs:271:7
|
LL | #[bar]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:283:7
+ --> $DIR/subdiagnostic-derive.rs:282:7
|
LL | #[bar = "..."]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:294:7
+ --> $DIR/subdiagnostic-derive.rs:293:7
|
LL | #[bar("...")]
| ^^^
error[E0425]: cannot find value `slug` in module `crate::fluent_generated`
- --> $DIR/subdiagnostic-derive.rs:124:9
+ --> $DIR/subdiagnostic-derive.rs:123:9
|
LL | #[label(slug)]
| ^^^^ not found in `crate::fluent_generated`
-error: aborting due to 81 previous errors
+error[E0425]: cannot find value `__code_29` in this scope
+ --> $DIR/subdiagnostic-derive.rs:706:10
+ |
+LL | #[derive(Subdiagnostic)]
+ | ^^^^^^^^^^^^^ not found in this scope
+ |
+ = note: this error originates in the derive macro `Subdiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 86 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui-fulldeps/stable-mir/crate-info.rs b/tests/ui-fulldeps/stable-mir/crate-info.rs
new file mode 100644
index 000000000..dfde8c97e
--- /dev/null
+++ b/tests/ui-fulldeps/stable-mir/crate-info.rs
@@ -0,0 +1,129 @@
+// run-pass
+// Test that users are able to use stable mir APIs to retrieve information of the current crate
+
+// ignore-stage1
+// ignore-cross-compile
+// ignore-remote
+// edition: 2021
+
+#![feature(rustc_private)]
+
+extern crate rustc_driver;
+extern crate rustc_hir;
+extern crate rustc_interface;
+extern crate rustc_middle;
+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_smir::{rustc_internal, stable_mir};
+use std::io::Write;
+
+const CRATE_NAME: &str = "input";
+
+/// This function uses the Stable MIR APIs to get information about the test crate.
+fn test_stable_mir(tcx: TyCtxt<'_>) {
+ // Get the local crate using stable_mir API.
+ let local = stable_mir::local_crate();
+ assert_eq!(&local.name, CRATE_NAME);
+
+ assert_eq!(stable_mir::entry_fn(), None);
+
+ // Find items in the local crate.
+ let items = stable_mir::all_local_items();
+ assert!(get_item(tcx, &items, (DefKind::Fn, "foo_bar")).is_some());
+ assert!(get_item(tcx, &items, (DefKind::Fn, "foo::bar")).is_some());
+
+ // Find the `std` crate.
+ assert!(stable_mir::find_crate("std").is_some());
+
+ let bar = get_item(tcx, &items, (DefKind::Fn, "bar")).unwrap();
+ let body = bar.body();
+ assert_eq!(body.blocks.len(), 1);
+ let block = &body.blocks[0];
+ assert_eq!(block.statements.len(), 1);
+ match &block.statements[0] {
+ stable_mir::mir::Statement::Assign(..) => {}
+ other => panic!("{other:?}"),
+ }
+ match &block.terminator {
+ stable_mir::mir::Terminator::Return => {}
+ other => panic!("{other:?}"),
+ }
+}
+
+// Use internal API to find a function in a crate.
+fn get_item<'a>(
+ tcx: TyCtxt,
+ items: &'a stable_mir::CrateItems,
+ item: (DefKind, &str),
+) -> Option<&'a stable_mir::CrateItem> {
+ items.iter().find(|crate_item| {
+ let def_id = rustc_internal::item_def_id(crate_item);
+ tcx.def_kind(def_id) == item.0 && tcx.def_path_str(def_id) == item.1
+ })
+}
+
+/// This test will generate and analyze a dummy crate using the stable mir.
+/// For that, it will first write the dummy crate into a file.
+/// It will invoke the compiler using a custom Callback implementation, which will
+/// invoke Stable MIR APIs after the compiler has finished its analysis.
+fn main() {
+ let path = "input.rs";
+ generate_input(&path).unwrap();
+ let args = vec![
+ "rustc".to_string(),
+ "--crate-type=lib".to_string(),
+ "--crate-name".to_string(),
+ CRATE_NAME.to_string(),
+ path.to_string(),
+ ];
+ rustc_driver::catch_fatal_errors(|| {
+ RunCompiler::new(&args, &mut SMirCalls {}).run().unwrap();
+ })
+ .unwrap();
+}
+
+struct SMirCalls {}
+
+impl Callbacks for SMirCalls {
+ /// Called after analysis. Return value instructs the compiler whether to
+ /// continue the compilation afterwards (defaults to `Compilation::Continue`)
+ fn after_analysis<'tcx>(
+ &mut self,
+ _compiler: &interface::Compiler,
+ queries: &'tcx Queries<'tcx>,
+ ) -> Compilation {
+ queries.global_ctxt().unwrap().enter(|tcx| {
+ test_stable_mir(tcx);
+ });
+ // No need to keep going.
+ Compilation::Stop
+ }
+}
+
+fn generate_input(path: &str) -> std::io::Result<()> {
+ let mut file = std::fs::File::create(path)?;
+ write!(
+ file,
+ r#"
+ mod foo {{
+ pub fn bar(i: i32) -> i64 {{
+ i as i64
+ }}
+ }}
+
+ pub fn bar(x: i32) -> i32 {{
+ x
+ }}
+
+ pub fn foo_bar(x: i32, y: i32) -> i64 {{
+ let x_64 = foo::bar(x);
+ let y_64 = foo::bar(y);
+ x_64.wrapping_add(y_64)
+ }}"#
+ )?;
+ Ok(())
+}
diff --git a/tests/ui/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs
index a455eef42..039507d51 100644
--- a/tests/ui/abi/stack-probes-lto.rs
+++ b/tests/ui/abi/stack-probes-lto.rs
@@ -9,7 +9,6 @@
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-musl FIXME #31506
-// ignore-pretty
// ignore-fuchsia no exception handler registered for segfault
// compile-flags: -C lto
// no-prefer-dynamic
diff --git a/tests/ui/argument-suggestions/issue-109425.fixed b/tests/ui/argument-suggestions/issue-109425.fixed
new file mode 100644
index 000000000..143ddf995
--- /dev/null
+++ b/tests/ui/argument-suggestions/issue-109425.fixed
@@ -0,0 +1,20 @@
+// run-rustfix
+
+fn f() {}
+fn i(_: u32) {}
+fn is(_: u32, _: &str) {}
+fn s(_: &str) {}
+
+fn main() {
+ // code expected suggestion
+ f(); // f()
+ //~^ error: this function takes 0 arguments but 2 arguments were supplied
+ i(0,); // i(0,)
+ //~^ error: this function takes 1 argument but 3 arguments were supplied
+ i(0); // i(0)
+ //~^ error: this function takes 1 argument but 3 arguments were supplied
+ is(0, ""); // is(0, "")
+ //~^ error: this function takes 2 arguments but 4 arguments were supplied
+ s(""); // s("")
+ //~^ error: this function takes 1 argument but 3 arguments were supplied
+}
diff --git a/tests/ui/argument-suggestions/issue-109425.rs b/tests/ui/argument-suggestions/issue-109425.rs
new file mode 100644
index 000000000..a845c4195
--- /dev/null
+++ b/tests/ui/argument-suggestions/issue-109425.rs
@@ -0,0 +1,20 @@
+// run-rustfix
+
+fn f() {}
+fn i(_: u32) {}
+fn is(_: u32, _: &str) {}
+fn s(_: &str) {}
+
+fn main() {
+ // code expected suggestion
+ f(0, 1,); // f()
+ //~^ error: this function takes 0 arguments but 2 arguments were supplied
+ i(0, 1, 2,); // i(0,)
+ //~^ error: this function takes 1 argument but 3 arguments were supplied
+ i(0, 1, 2); // i(0)
+ //~^ error: this function takes 1 argument but 3 arguments were supplied
+ is(0, 1, 2, ""); // is(0, "")
+ //~^ error: this function takes 2 arguments but 4 arguments were supplied
+ s(0, 1, ""); // s("")
+ //~^ error: this function takes 1 argument but 3 arguments were supplied
+}
diff --git a/tests/ui/argument-suggestions/issue-109425.stderr b/tests/ui/argument-suggestions/issue-109425.stderr
new file mode 100644
index 000000000..1514f1cb4
--- /dev/null
+++ b/tests/ui/argument-suggestions/issue-109425.stderr
@@ -0,0 +1,98 @@
+error[E0061]: this function takes 0 arguments but 2 arguments were supplied
+ --> $DIR/issue-109425.rs:10:5
+ |
+LL | f(0, 1,); // f()
+ | ^ - - unexpected argument of type `{integer}`
+ | |
+ | unexpected argument of type `{integer}`
+ |
+note: function defined here
+ --> $DIR/issue-109425.rs:3:4
+ |
+LL | fn f() {}
+ | ^
+help: remove the extra arguments
+ |
+LL - f(0, 1,); // f()
+LL + f(); // f()
+ |
+
+error[E0061]: this function takes 1 argument but 3 arguments were supplied
+ --> $DIR/issue-109425.rs:12:5
+ |
+LL | i(0, 1, 2,); // i(0,)
+ | ^ - - unexpected argument of type `{integer}`
+ | |
+ | unexpected argument of type `{integer}`
+ |
+note: function defined here
+ --> $DIR/issue-109425.rs:4:4
+ |
+LL | fn i(_: u32) {}
+ | ^ ------
+help: remove the extra arguments
+ |
+LL - i(0, 1, 2,); // i(0,)
+LL + i(0,); // i(0,)
+ |
+
+error[E0061]: this function takes 1 argument but 3 arguments were supplied
+ --> $DIR/issue-109425.rs:14:5
+ |
+LL | i(0, 1, 2); // i(0)
+ | ^ - - unexpected argument of type `{integer}`
+ | |
+ | unexpected argument of type `{integer}`
+ |
+note: function defined here
+ --> $DIR/issue-109425.rs:4:4
+ |
+LL | fn i(_: u32) {}
+ | ^ ------
+help: remove the extra arguments
+ |
+LL - i(0, 1, 2); // i(0)
+LL + i(0); // i(0)
+ |
+
+error[E0061]: this function takes 2 arguments but 4 arguments were supplied
+ --> $DIR/issue-109425.rs:16:5
+ |
+LL | is(0, 1, 2, ""); // is(0, "")
+ | ^^ - - unexpected argument of type `{integer}`
+ | |
+ | unexpected argument of type `{integer}`
+ |
+note: function defined here
+ --> $DIR/issue-109425.rs:5:4
+ |
+LL | fn is(_: u32, _: &str) {}
+ | ^^ ------ -------
+help: remove the extra arguments
+ |
+LL - is(0, 1, 2, ""); // is(0, "")
+LL + is(0, ""); // is(0, "")
+ |
+
+error[E0061]: this function takes 1 argument but 3 arguments were supplied
+ --> $DIR/issue-109425.rs:18:5
+ |
+LL | s(0, 1, ""); // s("")
+ | ^ - - unexpected argument of type `{integer}`
+ | |
+ | unexpected argument of type `{integer}`
+ |
+note: function defined here
+ --> $DIR/issue-109425.rs:6:4
+ |
+LL | fn s(_: &str) {}
+ | ^ -------
+help: remove the extra arguments
+ |
+LL - s(0, 1, ""); // s("")
+LL + s(""); // s("")
+ |
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0061`.
diff --git a/tests/ui/argument-suggestions/issue-109831.rs b/tests/ui/argument-suggestions/issue-109831.rs
new file mode 100644
index 000000000..2e8ae40f6
--- /dev/null
+++ b/tests/ui/argument-suggestions/issue-109831.rs
@@ -0,0 +1,9 @@
+struct A;
+struct B;
+
+fn f(b1: B, b2: B, a2: C) {} //~ ERROR E0412
+
+fn main() {
+ f(A, A, B, C); //~ ERROR E0425
+ //~^ ERROR E0061
+}
diff --git a/tests/ui/argument-suggestions/issue-109831.stderr b/tests/ui/argument-suggestions/issue-109831.stderr
new file mode 100644
index 000000000..7b9a3c9ef
--- /dev/null
+++ b/tests/ui/argument-suggestions/issue-109831.stderr
@@ -0,0 +1,51 @@
+error[E0412]: cannot find type `C` in this scope
+ --> $DIR/issue-109831.rs:4:24
+ |
+LL | struct A;
+ | --------- similarly named struct `A` defined here
+...
+LL | fn f(b1: B, b2: B, a2: C) {}
+ | ^
+ |
+help: a struct with a similar name exists
+ |
+LL | fn f(b1: B, b2: B, a2: A) {}
+ | ~
+help: you might be missing a type parameter
+ |
+LL | fn f<C>(b1: B, b2: B, a2: C) {}
+ | +++
+
+error[E0425]: cannot find value `C` in this scope
+ --> $DIR/issue-109831.rs:7:16
+ |
+LL | struct A;
+ | --------- similarly named unit struct `A` defined here
+...
+LL | f(A, A, B, C);
+ | ^ help: a unit struct with a similar name exists: `A`
+
+error[E0061]: this function takes 3 arguments but 4 arguments were supplied
+ --> $DIR/issue-109831.rs:7:5
+ |
+LL | f(A, A, B, C);
+ | ^ - - - unexpected argument
+ | | |
+ | | expected `B`, found `A`
+ | expected `B`, found `A`
+ |
+note: function defined here
+ --> $DIR/issue-109831.rs:4:4
+ |
+LL | fn f(b1: B, b2: B, a2: C) {}
+ | ^ ----- ----- -----
+help: remove the extra argument
+ |
+LL - f(A, A, B, C);
+LL + f(/* B */, /* B */, B);
+ |
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0061, E0412, E0425.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/tests/ui/array-slice-vec/repeat_empty_ok.stderr b/tests/ui/array-slice-vec/repeat_empty_ok.stderr
index 724bdcd92..e8bac04ac 100644
--- a/tests/ui/array-slice-vec/repeat_empty_ok.stderr
+++ b/tests/ui/array-slice-vec/repeat_empty_ok.stderr
@@ -7,7 +7,8 @@ LL | let headers = [Header{value: &[]}; 128];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Header<'_>` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | pub struct Header<'a> {
|
error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied
@@ -19,7 +20,8 @@ LL | let headers = [Header{value: &[0]}; 128];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Header<'_>` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | pub struct Header<'a> {
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/asm/aarch64/parse-error.rs b/tests/ui/asm/aarch64/parse-error.rs
index cbc93cd3f..9b8170840 100644
--- a/tests/ui/asm/aarch64/parse-error.rs
+++ b/tests/ui/asm/aarch64/parse-error.rs
@@ -37,8 +37,7 @@ fn main() {
asm!("", options(nomem, foo));
//~^ ERROR expected one of
asm!("{}", options(), const foo);
- //~^ ERROR arguments are not allowed after options
- //~^^ ERROR attempt to use a non-constant value in a constant
+ //~^ ERROR attempt to use a non-constant value in a constant
asm!("", clobber_abi(foo));
//~^ ERROR expected string literal
asm!("", clobber_abi("C" foo));
@@ -46,12 +45,10 @@ fn main() {
asm!("", clobber_abi("C", foo));
//~^ ERROR expected string literal
asm!("{}", clobber_abi("C"), const foo);
- //~^ ERROR arguments are not allowed after clobber_abi
- //~^^ ERROR attempt to use a non-constant value in a constant
+ //~^ ERROR attempt to use a non-constant value in a constant
asm!("", options(), clobber_abi("C"));
- //~^ ERROR clobber_abi is not allowed after options
asm!("{}", options(), clobber_abi("C"), const foo);
- //~^ ERROR clobber_abi is not allowed after options
+ //~^ ERROR attempt to use a non-constant value in a constant
asm!("{a}", a = const foo, a = const bar);
//~^ ERROR duplicate argument named `a`
//~^^ ERROR argument never used
@@ -60,11 +57,9 @@ fn main() {
asm!("", a = in("x0") foo);
//~^ ERROR explicit register arguments cannot have names
asm!("{a}", in("x0") foo, a = const bar);
- //~^ ERROR named arguments cannot follow explicit register arguments
- //~^^ 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("x0") foo, a = const bar);
- //~^ ERROR named arguments cannot follow explicit register arguments
- //~^^ ERROR attempt to use a non-constant value in a constant
+ //~^ ERROR attempt to use a non-constant value in a constant
asm!("{1}", in("x0") 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
@@ -106,7 +101,6 @@ global_asm!("", options(nomem FOO));
global_asm!("", options(nomem, FOO));
//~^ ERROR expected one of
global_asm!("{}", options(), const FOO);
-//~^ ERROR arguments are not allowed after options
global_asm!("", clobber_abi(FOO));
//~^ ERROR expected string literal
global_asm!("", clobber_abi("C" FOO));
@@ -114,12 +108,11 @@ global_asm!("", clobber_abi("C" FOO));
global_asm!("", clobber_abi("C", FOO));
//~^ ERROR expected string literal
global_asm!("{}", clobber_abi("C"), const FOO);
-//~^ ERROR arguments are not allowed after clobber_abi
-//~^^ ERROR `clobber_abi` cannot be used with `global_asm!`
+//~^ ERROR `clobber_abi` cannot be used with `global_asm!`
global_asm!("", options(), clobber_abi("C"));
-//~^ ERROR clobber_abi is not allowed after options
+//~^ ERROR `clobber_abi` cannot be used with `global_asm!`
global_asm!("{}", options(), clobber_abi("C"), const FOO);
-//~^ ERROR clobber_abi is not allowed after options
+//~^ ERROR `clobber_abi` cannot be used with `global_asm!`
global_asm!("{a}", a = const FOO, a = const BAR);
//~^ ERROR duplicate argument named `a`
//~^^ ERROR argument never used
diff --git a/tests/ui/asm/aarch64/parse-error.stderr b/tests/ui/asm/aarch64/parse-error.stderr
index 804966b06..46984a1fe 100644
--- a/tests/ui/asm/aarch64/parse-error.stderr
+++ b/tests/ui/asm/aarch64/parse-error.stderr
@@ -82,58 +82,26 @@ error: expected one of `)`, `att_syntax`, `may_unwind`, `nomem`, `noreturn`, `no
LL | asm!("", options(nomem, foo));
| ^^^ expected one of 10 possible tokens
-error: arguments are not allowed after options
- --> $DIR/parse-error.rs:39:31
- |
-LL | asm!("{}", options(), const foo);
- | --------- ^^^^^^^^^ argument
- | |
- | previous options
-
error: expected string literal
- --> $DIR/parse-error.rs:42:30
+ --> $DIR/parse-error.rs:41:30
|
LL | asm!("", clobber_abi(foo));
| ^^^ not a string literal
error: expected one of `)` or `,`, found `foo`
- --> $DIR/parse-error.rs:44:34
+ --> $DIR/parse-error.rs:43:34
|
LL | asm!("", clobber_abi("C" foo));
| ^^^ expected one of `)` or `,`
error: expected string literal
- --> $DIR/parse-error.rs:46:35
+ --> $DIR/parse-error.rs:45:35
|
LL | asm!("", clobber_abi("C", foo));
| ^^^ not a string literal
-error: arguments are not allowed after clobber_abi
- --> $DIR/parse-error.rs:48:38
- |
-LL | asm!("{}", clobber_abi("C"), const foo);
- | ---------------- ^^^^^^^^^ argument
- | |
- | clobber_abi
-
-error: clobber_abi is not allowed after options
- --> $DIR/parse-error.rs:51:29
- |
-LL | asm!("", options(), clobber_abi("C"));
- | --------- ^^^^^^^^^^^^^^^^
- | |
- | options
-
-error: clobber_abi is not allowed after options
- --> $DIR/parse-error.rs:53:31
- |
-LL | asm!("{}", options(), clobber_abi("C"), const foo);
- | --------- ^^^^^^^^^^^^^^^^
- | |
- | options
-
error: duplicate argument named `a`
- --> $DIR/parse-error.rs:55:36
+ --> $DIR/parse-error.rs:52:36
|
LL | asm!("{a}", a = const foo, a = const bar);
| ------------- ^^^^^^^^^^^^^ duplicate argument
@@ -141,7 +109,7 @@ LL | asm!("{a}", a = const foo, a = const bar);
| previously here
error: argument never used
- --> $DIR/parse-error.rs:55:36
+ --> $DIR/parse-error.rs:52:36
|
LL | asm!("{a}", a = const foo, a = const bar);
| ^^^^^^^^^^^^^ argument never used
@@ -149,29 +117,13 @@ LL | asm!("{a}", a = const foo, a = const bar);
= 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:60:18
+ --> $DIR/parse-error.rs:57:18
|
LL | asm!("", a = in("x0") foo);
| ^^^^^^^^^^^^^^^^
-error: named arguments cannot follow explicit register arguments
- --> $DIR/parse-error.rs:62:35
- |
-LL | asm!("{a}", in("x0") foo, a = const bar);
- | ------------ ^^^^^^^^^^^^^ named argument
- | |
- | explicit register argument
-
-error: named arguments cannot follow explicit register arguments
- --> $DIR/parse-error.rs:65:35
- |
-LL | asm!("{a}", in("x0") foo, a = const bar);
- | ------------ ^^^^^^^^^^^^^ named argument
- | |
- | explicit register argument
-
error: positional arguments cannot follow named arguments or explicit register arguments
- --> $DIR/parse-error.rs:68:35
+ --> $DIR/parse-error.rs:63:35
|
LL | asm!("{1}", in("x0") foo, const bar);
| ------------ ^^^^^^^^^ positional argument
@@ -179,19 +131,19 @@ LL | asm!("{1}", in("x0") foo, const bar);
| explicit register argument
error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `""`
- --> $DIR/parse-error.rs:71:29
+ --> $DIR/parse-error.rs:66: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:73:33
+ --> $DIR/parse-error.rs:68: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:75:14
+ --> $DIR/parse-error.rs:70:14
|
LL | asm!(format!("{{{}}}", 0), in(reg) foo);
| ^^^^^^^^^^^^^^^^^^^^
@@ -199,7 +151,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:77:21
+ --> $DIR/parse-error.rs:72:21
|
LL | asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
| ^^^^^^^^^^^^^^^^^^^^
@@ -207,135 +159,115 @@ 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:79:28
+ --> $DIR/parse-error.rs:74:28
|
LL | asm!("{}", in(reg) _);
| ^
error: _ cannot be used for input operands
- --> $DIR/parse-error.rs:81:31
+ --> $DIR/parse-error.rs:76:31
|
LL | asm!("{}", inout(reg) _);
| ^
error: _ cannot be used for input operands
- --> $DIR/parse-error.rs:83:35
+ --> $DIR/parse-error.rs:78:35
|
LL | asm!("{}", inlateout(reg) _);
| ^
error: requires at least a template string argument
- --> $DIR/parse-error.rs:90:1
+ --> $DIR/parse-error.rs:85:1
|
LL | global_asm!();
| ^^^^^^^^^^^^^
error: asm template must be a string literal
- --> $DIR/parse-error.rs:92:13
+ --> $DIR/parse-error.rs:87:13
|
LL | global_asm!(FOO);
| ^^^
error: expected token: `,`
- --> $DIR/parse-error.rs:94:18
+ --> $DIR/parse-error.rs:89:18
|
LL | global_asm!("{}" FOO);
| ^^^ expected `,`
error: expected operand, options, or additional template string
- --> $DIR/parse-error.rs:96:19
+ --> $DIR/parse-error.rs:91:19
|
LL | global_asm!("{}", FOO);
| ^^^ expected operand, options, or additional template string
error: expected expression, found end of macro arguments
- --> $DIR/parse-error.rs:98:24
+ --> $DIR/parse-error.rs:93:24
|
LL | global_asm!("{}", const);
| ^ expected expression
error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
- --> $DIR/parse-error.rs:100:30
+ --> $DIR/parse-error.rs:95: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:102:25
+ --> $DIR/parse-error.rs:97: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:104:25
+ --> $DIR/parse-error.rs:99: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:106:25
+ --> $DIR/parse-error.rs:101:25
|
LL | global_asm!("", options(nomem, FOO));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
-error: arguments are not allowed after options
- --> $DIR/parse-error.rs:108:30
- |
-LL | global_asm!("{}", options(), const FOO);
- | --------- ^^^^^^^^^ argument
- | |
- | previous options
-
error: expected string literal
- --> $DIR/parse-error.rs:110:29
+ --> $DIR/parse-error.rs:104:29
|
LL | global_asm!("", clobber_abi(FOO));
| ^^^ not a string literal
error: expected one of `)` or `,`, found `FOO`
- --> $DIR/parse-error.rs:112:33
+ --> $DIR/parse-error.rs:106:33
|
LL | global_asm!("", clobber_abi("C" FOO));
| ^^^ expected one of `)` or `,`
error: expected string literal
- --> $DIR/parse-error.rs:114:34
+ --> $DIR/parse-error.rs:108:34
|
LL | global_asm!("", clobber_abi("C", FOO));
| ^^^ not a string literal
-error: arguments are not allowed after clobber_abi
- --> $DIR/parse-error.rs:116:37
- |
-LL | global_asm!("{}", clobber_abi("C"), const FOO);
- | ---------------- ^^^^^^^^^ argument
- | |
- | clobber_abi
-
error: `clobber_abi` cannot be used with `global_asm!`
- --> $DIR/parse-error.rs:116:19
+ --> $DIR/parse-error.rs:110:19
|
LL | global_asm!("{}", clobber_abi("C"), const FOO);
| ^^^^^^^^^^^^^^^^
-error: clobber_abi is not allowed after options
- --> $DIR/parse-error.rs:119:28
+error: `clobber_abi` cannot be used with `global_asm!`
+ --> $DIR/parse-error.rs:112:28
|
LL | global_asm!("", options(), clobber_abi("C"));
- | --------- ^^^^^^^^^^^^^^^^
- | |
- | options
+ | ^^^^^^^^^^^^^^^^
-error: clobber_abi is not allowed after options
- --> $DIR/parse-error.rs:121:30
+error: `clobber_abi` cannot be used with `global_asm!`
+ --> $DIR/parse-error.rs:114:30
|
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
- | --------- ^^^^^^^^^^^^^^^^
- | |
- | options
+ | ^^^^^^^^^^^^^^^^
error: duplicate argument named `a`
- --> $DIR/parse-error.rs:123:35
+ --> $DIR/parse-error.rs:116:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ------------- ^^^^^^^^^^^^^ duplicate argument
@@ -343,7 +275,7 @@ LL | global_asm!("{a}", a = const FOO, a = const BAR);
| previously here
error: argument never used
- --> $DIR/parse-error.rs:123:35
+ --> $DIR/parse-error.rs:116:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ^^^^^^^^^^^^^ argument never used
@@ -351,19 +283,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:126:28
+ --> $DIR/parse-error.rs:119: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:128:30
+ --> $DIR/parse-error.rs:121: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:130:13
+ --> $DIR/parse-error.rs:123:13
|
LL | global_asm!(format!("{{{}}}", 0), const FOO);
| ^^^^^^^^^^^^^^^^^^^^
@@ -371,7 +303,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:132:20
+ --> $DIR/parse-error.rs:125:20
|
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
| ^^^^^^^^^^^^^^^^^^^^
@@ -388,7 +320,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:48:44
+ --> $DIR/parse-error.rs:47:44
|
LL | let mut foo = 0;
| ----------- help: consider using `const` instead of `let`: `const foo`
@@ -397,7 +329,16 @@ 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:55:31
+ --> $DIR/parse-error.rs:50:55
+ |
+LL | let mut foo = 0;
+ | ----------- help: consider using `const` instead of `let`: `const foo`
+...
+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:52:31
|
LL | let mut foo = 0;
| ----------- help: consider using `const` instead of `let`: `const foo`
@@ -406,7 +347,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:55:46
+ --> $DIR/parse-error.rs:52:46
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -415,7 +356,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:62:45
+ --> $DIR/parse-error.rs:59:45
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -424,7 +365,7 @@ LL | asm!("{a}", in("x0") foo, a = const bar);
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:65:45
+ --> $DIR/parse-error.rs:61:45
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -433,7 +374,7 @@ LL | asm!("{a}", in("x0") foo, a = const bar);
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:68:41
+ --> $DIR/parse-error.rs:63:41
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -441,6 +382,6 @@ LL | let mut bar = 0;
LL | asm!("{1}", in("x0") foo, const bar);
| ^^^ non-constant value
-error: aborting due to 64 previous errors
+error: aborting due to 57 previous errors
For more information about this error, try `rustc --explain E0435`.
diff --git a/tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr b/tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr
index bb6a222b2..b16f9a06c 100644
--- a/tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr
+++ b/tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr
@@ -81,6 +81,11 @@ note: explicit register arguments cannot be used in the asm template
|
LL | asm!("{}", in("x0") foo);
| ^^^^^^^^^^^^
+help: use the register name directly in the assembly code
+ --> $DIR/bad-template.rs:48:20
+ |
+LL | asm!("{}", in("x0") foo);
+ | ^^^^^^^^^^^^
error: asm template modifier must be a single character
--> $DIR/bad-template.rs:50:17
diff --git a/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr b/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr
index bb6a222b2..b16f9a06c 100644
--- a/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr
+++ b/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr
@@ -81,6 +81,11 @@ note: explicit register arguments cannot be used in the asm template
|
LL | asm!("{}", in("x0") foo);
| ^^^^^^^^^^^^
+help: use the register name directly in the assembly code
+ --> $DIR/bad-template.rs:48:20
+ |
+LL | asm!("{}", in("x0") foo);
+ | ^^^^^^^^^^^^
error: asm template modifier must be a single character
--> $DIR/bad-template.rs:50:17
diff --git a/tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr b/tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr
index 903b5e959..41ac37c33 100644
--- a/tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr
+++ b/tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr
@@ -81,6 +81,11 @@ note: explicit register arguments cannot be used in the asm template
|
LL | asm!("{}", in("eax") foo);
| ^^^^^^^^^^^^^
+help: use the register name directly in the assembly code
+ --> $DIR/bad-template.rs:45:20
+ |
+LL | asm!("{}", in("eax") foo);
+ | ^^^^^^^^^^^^^
error: asm template modifier must be a single character
--> $DIR/bad-template.rs:50:17
diff --git a/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr b/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr
index 903b5e959..41ac37c33 100644
--- a/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr
+++ b/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr
@@ -81,6 +81,11 @@ note: explicit register arguments cannot be used in the asm template
|
LL | asm!("{}", in("eax") foo);
| ^^^^^^^^^^^^^
+help: use the register name directly in the assembly code
+ --> $DIR/bad-template.rs:45:20
+ |
+LL | asm!("{}", in("eax") foo);
+ | ^^^^^^^^^^^^^
error: asm template modifier must be a single character
--> $DIR/bad-template.rs:50:17
diff --git a/tests/ui/asm/x86_64/issue-89875.rs b/tests/ui/asm/x86_64/issue-89875.rs
index 669fd7e7e..39c645640 100644
--- a/tests/ui/asm/x86_64/issue-89875.rs
+++ b/tests/ui/asm/x86_64/issue-89875.rs
@@ -7,7 +7,7 @@
use std::arch::asm;
#[target_feature(enable = "avx")]
-fn main() {
+fn foo() {
unsafe {
asm!(
"/* {} */",
@@ -15,3 +15,5 @@ fn main() {
);
}
}
+
+fn main() {}
diff --git a/tests/ui/asm/x86_64/parse-error.rs b/tests/ui/asm/x86_64/parse-error.rs
index 9aeb6b285..2e714d464 100644
--- a/tests/ui/asm/x86_64/parse-error.rs
+++ b/tests/ui/asm/x86_64/parse-error.rs
@@ -37,8 +37,7 @@ fn main() {
asm!("", options(nomem, foo));
//~^ ERROR expected one of
asm!("{}", options(), const foo);
- //~^ ERROR arguments are not allowed after options
- //~^^ ERROR attempt to use a non-constant value in a constant
+ //~^ ERROR attempt to use a non-constant value in a constant
asm!("", clobber_abi());
//~^ ERROR at least one abi must be provided
asm!("", clobber_abi(foo));
@@ -48,12 +47,10 @@ fn main() {
asm!("", clobber_abi("C", foo));
//~^ ERROR expected string literal
asm!("{}", clobber_abi("C"), const foo);
- //~^ ERROR arguments are not allowed after clobber_abi
- //~^^ ERROR attempt to use a non-constant value in a constant
+ //~^ ERROR attempt to use a non-constant value in a constant
asm!("", options(), clobber_abi("C"));
- //~^ ERROR clobber_abi is not allowed after options
asm!("{}", options(), clobber_abi("C"), const foo);
- //~^ ERROR clobber_abi is not allowed after options
+ //~^ ERROR attempt to use a non-constant value in a constant
asm!("{a}", a = const foo, a = const bar);
//~^ ERROR duplicate argument named `a`
//~^^ ERROR argument never used
@@ -62,11 +59,9 @@ fn main() {
asm!("", a = in("eax") foo);
//~^ ERROR explicit register arguments cannot have names
asm!("{a}", in("eax") foo, a = const bar);
- //~^ ERROR named arguments cannot follow explicit register arguments
- //~^^ 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, a = const bar);
- //~^ ERROR named arguments cannot follow explicit register arguments
- //~^^ ERROR attempt to use a non-constant value in a constant
+ //~^ 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
@@ -108,7 +103,6 @@ global_asm!("", options(nomem FOO));
global_asm!("", options(nomem, FOO));
//~^ ERROR expected one of
global_asm!("{}", options(), const FOO);
-//~^ ERROR arguments are not allowed after options
global_asm!("", clobber_abi(FOO));
//~^ ERROR expected string literal
global_asm!("", clobber_abi("C" FOO));
@@ -116,12 +110,11 @@ global_asm!("", clobber_abi("C" FOO));
global_asm!("", clobber_abi("C", FOO));
//~^ ERROR expected string literal
global_asm!("{}", clobber_abi("C"), const FOO);
-//~^ ERROR arguments are not allowed after clobber_abi
-//~^^ ERROR `clobber_abi` cannot be used with `global_asm!`
+//~^ ERROR `clobber_abi` cannot be used with `global_asm!`
global_asm!("", options(), clobber_abi("C"));
-//~^ ERROR clobber_abi is not allowed after options
+//~^ ERROR `clobber_abi` cannot be used with `global_asm!`
global_asm!("{}", options(), clobber_abi("C"), const FOO);
-//~^ ERROR clobber_abi is not allowed after options
+//~^ ERROR `clobber_abi` cannot be used with `global_asm!`
global_asm!("", clobber_abi("C"), clobber_abi("C"));
//~^ ERROR `clobber_abi` cannot be used with `global_asm!`
global_asm!("{a}", a = const FOO, a = const BAR);
diff --git a/tests/ui/asm/x86_64/parse-error.stderr b/tests/ui/asm/x86_64/parse-error.stderr
index 57702c37b..0c9d6f715 100644
--- a/tests/ui/asm/x86_64/parse-error.stderr
+++ b/tests/ui/asm/x86_64/parse-error.stderr
@@ -82,64 +82,32 @@ error: expected one of `)`, `att_syntax`, `may_unwind`, `nomem`, `noreturn`, `no
LL | asm!("", options(nomem, foo));
| ^^^ expected one of 10 possible tokens
-error: arguments are not allowed after options
- --> $DIR/parse-error.rs:39:31
- |
-LL | asm!("{}", options(), const foo);
- | --------- ^^^^^^^^^ argument
- | |
- | previous options
-
error: at least one abi must be provided as an argument to `clobber_abi`
- --> $DIR/parse-error.rs:42:30
+ --> $DIR/parse-error.rs:41:30
|
LL | asm!("", clobber_abi());
| ^
error: expected string literal
- --> $DIR/parse-error.rs:44:30
+ --> $DIR/parse-error.rs:43:30
|
LL | asm!("", clobber_abi(foo));
| ^^^ not a string literal
error: expected one of `)` or `,`, found `foo`
- --> $DIR/parse-error.rs:46:34
+ --> $DIR/parse-error.rs:45:34
|
LL | asm!("", clobber_abi("C" foo));
| ^^^ expected one of `)` or `,`
error: expected string literal
- --> $DIR/parse-error.rs:48:35
+ --> $DIR/parse-error.rs:47:35
|
LL | asm!("", clobber_abi("C", foo));
| ^^^ not a string literal
-error: arguments are not allowed after clobber_abi
- --> $DIR/parse-error.rs:50:38
- |
-LL | asm!("{}", clobber_abi("C"), const foo);
- | ---------------- ^^^^^^^^^ argument
- | |
- | clobber_abi
-
-error: clobber_abi is not allowed after options
- --> $DIR/parse-error.rs:53:29
- |
-LL | asm!("", options(), clobber_abi("C"));
- | --------- ^^^^^^^^^^^^^^^^
- | |
- | options
-
-error: clobber_abi is not allowed after options
- --> $DIR/parse-error.rs:55:31
- |
-LL | asm!("{}", options(), clobber_abi("C"), const foo);
- | --------- ^^^^^^^^^^^^^^^^
- | |
- | options
-
error: duplicate argument named `a`
- --> $DIR/parse-error.rs:57:36
+ --> $DIR/parse-error.rs:54:36
|
LL | asm!("{a}", a = const foo, a = const bar);
| ------------- ^^^^^^^^^^^^^ duplicate argument
@@ -147,7 +115,7 @@ LL | asm!("{a}", a = const foo, a = const bar);
| previously here
error: argument never used
- --> $DIR/parse-error.rs:57:36
+ --> $DIR/parse-error.rs:54:36
|
LL | asm!("{a}", a = const foo, a = const bar);
| ^^^^^^^^^^^^^ argument never used
@@ -155,29 +123,13 @@ LL | asm!("{a}", a = const foo, a = const bar);
= 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:62:18
+ --> $DIR/parse-error.rs:59:18
|
LL | asm!("", a = in("eax") foo);
| ^^^^^^^^^^^^^^^^^
-error: named arguments cannot follow explicit register arguments
- --> $DIR/parse-error.rs:64:36
- |
-LL | asm!("{a}", in("eax") foo, a = const bar);
- | ------------- ^^^^^^^^^^^^^ named argument
- | |
- | explicit register argument
-
-error: named arguments cannot follow explicit register arguments
- --> $DIR/parse-error.rs:67:36
- |
-LL | asm!("{a}", in("eax") foo, a = const bar);
- | ------------- ^^^^^^^^^^^^^ named argument
- | |
- | explicit register argument
-
error: positional arguments cannot follow named arguments or explicit register arguments
- --> $DIR/parse-error.rs:70:36
+ --> $DIR/parse-error.rs:65:36
|
LL | asm!("{1}", in("eax") foo, const bar);
| ------------- ^^^^^^^^^ positional argument
@@ -185,19 +137,19 @@ LL | asm!("{1}", in("eax") foo, const bar);
| explicit register argument
error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `""`
- --> $DIR/parse-error.rs:73:29
+ --> $DIR/parse-error.rs:68: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:75:33
+ --> $DIR/parse-error.rs:70: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:77:14
+ --> $DIR/parse-error.rs:72:14
|
LL | asm!(format!("{{{}}}", 0), in(reg) foo);
| ^^^^^^^^^^^^^^^^^^^^
@@ -205,7 +157,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:79:21
+ --> $DIR/parse-error.rs:74:21
|
LL | asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
| ^^^^^^^^^^^^^^^^^^^^
@@ -213,141 +165,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:81:28
+ --> $DIR/parse-error.rs:76:28
|
LL | asm!("{}", in(reg) _);
| ^
error: _ cannot be used for input operands
- --> $DIR/parse-error.rs:83:31
+ --> $DIR/parse-error.rs:78:31
|
LL | asm!("{}", inout(reg) _);
| ^
error: _ cannot be used for input operands
- --> $DIR/parse-error.rs:85:35
+ --> $DIR/parse-error.rs:80:35
|
LL | asm!("{}", inlateout(reg) _);
| ^
error: requires at least a template string argument
- --> $DIR/parse-error.rs:92:1
+ --> $DIR/parse-error.rs:87:1
|
LL | global_asm!();
| ^^^^^^^^^^^^^
error: asm template must be a string literal
- --> $DIR/parse-error.rs:94:13
+ --> $DIR/parse-error.rs:89:13
|
LL | global_asm!(FOO);
| ^^^
error: expected token: `,`
- --> $DIR/parse-error.rs:96:18
+ --> $DIR/parse-error.rs:91:18
|
LL | global_asm!("{}" FOO);
| ^^^ expected `,`
error: expected operand, options, or additional template string
- --> $DIR/parse-error.rs:98:19
+ --> $DIR/parse-error.rs:93:19
|
LL | global_asm!("{}", FOO);
| ^^^ expected operand, options, or additional template string
error: expected expression, found end of macro arguments
- --> $DIR/parse-error.rs:100:24
+ --> $DIR/parse-error.rs:95:24
|
LL | global_asm!("{}", const);
| ^ expected expression
error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
- --> $DIR/parse-error.rs:102:30
+ --> $DIR/parse-error.rs:97: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:104:25
+ --> $DIR/parse-error.rs:99: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:106:25
+ --> $DIR/parse-error.rs:101: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:108:25
+ --> $DIR/parse-error.rs:103:25
|
LL | global_asm!("", options(nomem, FOO));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
-error: arguments are not allowed after options
- --> $DIR/parse-error.rs:110:30
- |
-LL | global_asm!("{}", options(), const FOO);
- | --------- ^^^^^^^^^ argument
- | |
- | previous options
-
error: expected string literal
- --> $DIR/parse-error.rs:112:29
+ --> $DIR/parse-error.rs:106:29
|
LL | global_asm!("", clobber_abi(FOO));
| ^^^ not a string literal
error: expected one of `)` or `,`, found `FOO`
- --> $DIR/parse-error.rs:114:33
+ --> $DIR/parse-error.rs:108:33
|
LL | global_asm!("", clobber_abi("C" FOO));
| ^^^ expected one of `)` or `,`
error: expected string literal
- --> $DIR/parse-error.rs:116:34
+ --> $DIR/parse-error.rs:110:34
|
LL | global_asm!("", clobber_abi("C", FOO));
| ^^^ not a string literal
-error: arguments are not allowed after clobber_abi
- --> $DIR/parse-error.rs:118:37
- |
-LL | global_asm!("{}", clobber_abi("C"), const FOO);
- | ---------------- ^^^^^^^^^ argument
- | |
- | clobber_abi
-
error: `clobber_abi` cannot be used with `global_asm!`
- --> $DIR/parse-error.rs:118:19
+ --> $DIR/parse-error.rs:112:19
|
LL | global_asm!("{}", clobber_abi("C"), const FOO);
| ^^^^^^^^^^^^^^^^
-error: clobber_abi is not allowed after options
- --> $DIR/parse-error.rs:121:28
+error: `clobber_abi` cannot be used with `global_asm!`
+ --> $DIR/parse-error.rs:114:28
|
LL | global_asm!("", options(), clobber_abi("C"));
- | --------- ^^^^^^^^^^^^^^^^
- | |
- | options
+ | ^^^^^^^^^^^^^^^^
-error: clobber_abi is not allowed after options
- --> $DIR/parse-error.rs:123:30
+error: `clobber_abi` cannot be used with `global_asm!`
+ --> $DIR/parse-error.rs:116:30
|
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
- | --------- ^^^^^^^^^^^^^^^^
- | |
- | options
+ | ^^^^^^^^^^^^^^^^
error: `clobber_abi` cannot be used with `global_asm!`
- --> $DIR/parse-error.rs:125:17
+ --> $DIR/parse-error.rs:118:17
|
LL | global_asm!("", clobber_abi("C"), clobber_abi("C"));
| ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
error: duplicate argument named `a`
- --> $DIR/parse-error.rs:127:35
+ --> $DIR/parse-error.rs:120:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ------------- ^^^^^^^^^^^^^ duplicate argument
@@ -355,7 +287,7 @@ LL | global_asm!("{a}", a = const FOO, a = const BAR);
| previously here
error: argument never used
- --> $DIR/parse-error.rs:127:35
+ --> $DIR/parse-error.rs:120:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ^^^^^^^^^^^^^ argument never used
@@ -363,19 +295,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:130:28
+ --> $DIR/parse-error.rs:123: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:132:30
+ --> $DIR/parse-error.rs:125: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:134:13
+ --> $DIR/parse-error.rs:127:13
|
LL | global_asm!(format!("{{{}}}", 0), const FOO);
| ^^^^^^^^^^^^^^^^^^^^
@@ -383,7 +315,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:136:20
+ --> $DIR/parse-error.rs:129:20
|
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
| ^^^^^^^^^^^^^^^^^^^^
@@ -400,7 +332,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:50:44
+ --> $DIR/parse-error.rs:49:44
|
LL | let mut foo = 0;
| ----------- help: consider using `const` instead of `let`: `const foo`
@@ -409,7 +341,16 @@ 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:57:31
+ --> $DIR/parse-error.rs:52:55
+ |
+LL | let mut foo = 0;
+ | ----------- help: consider using `const` instead of `let`: `const foo`
+...
+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
|
LL | let mut foo = 0;
| ----------- help: consider using `const` instead of `let`: `const foo`
@@ -418,7 +359,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:57:46
+ --> $DIR/parse-error.rs:54:46
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -427,7 +368,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:64:46
+ --> $DIR/parse-error.rs:61:46
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -436,7 +377,7 @@ 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:67:46
+ --> $DIR/parse-error.rs:63:46
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -445,7 +386,7 @@ 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:70:42
+ --> $DIR/parse-error.rs:65:42
|
LL | let mut bar = 0;
| ----------- help: consider using `const` instead of `let`: `const bar`
@@ -453,6 +394,6 @@ LL | let mut bar = 0;
LL | asm!("{1}", in("eax") foo, const bar);
| ^^^ non-constant value
-error: aborting due to 66 previous errors
+error: aborting due to 59 previous errors
For more information about this error, try `rustc --explain E0435`.
diff --git a/tests/ui/associated-consts/associated-const-dead-code.stderr b/tests/ui/associated-consts/associated-const-dead-code.stderr
index cc701cc4b..7e485a314 100644
--- a/tests/ui/associated-consts/associated-const-dead-code.stderr
+++ b/tests/ui/associated-consts/associated-const-dead-code.stderr
@@ -1,6 +1,8 @@
error: associated constant `BAR` is never used
--> $DIR/associated-const-dead-code.rs:6:11
|
+LL | impl MyFoo {
+ | ---------- associated constant in this implementation
LL | const BAR: u32 = 1;
| ^^^
|
diff --git a/tests/ui/associated-consts/defaults-not-assumed-fail.stderr b/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
index fb7159e40..9b761b006 100644
--- a/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
+++ b/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
@@ -26,14 +26,6 @@ LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
|
= note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
-note: erroneous constant used
- --> $DIR/defaults-not-assumed-fail.rs:33:5
- |
-LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
-
error: aborting due to previous error
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/associated-consts/issue-93775.rs b/tests/ui/associated-consts/issue-93775.rs
index 7a007b732..db788fe6e 100644
--- a/tests/ui/associated-consts/issue-93775.rs
+++ b/tests/ui/associated-consts/issue-93775.rs
@@ -3,7 +3,7 @@
// Regression for #93775, needs build-pass to test it.
-#![recursion_limit = "1000"]
+#![recursion_limit = "1001"]
use std::marker::PhantomData;
diff --git a/tests/ui/associated-inherent-types/issue-109299-1.rs b/tests/ui/associated-inherent-types/issue-109299-1.rs
new file mode 100644
index 000000000..6f9527311
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109299-1.rs
@@ -0,0 +1,12 @@
+#![feature(inherent_associated_types, non_lifetime_binders, type_alias_impl_trait)]
+#![allow(incomplete_features)]
+
+struct Lexer<T>(T);
+
+impl Lexer<i32> {
+ type Cursor = ();
+}
+
+type X = impl for<T> Fn() -> Lexer<T>::Cursor; //~ ERROR associated type `Cursor` not found for `Lexer<T>` in the current scope
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/issue-109299-1.stderr b/tests/ui/associated-inherent-types/issue-109299-1.stderr
new file mode 100644
index 000000000..dc59b56ee
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109299-1.stderr
@@ -0,0 +1,15 @@
+error[E0220]: associated type `Cursor` not found for `Lexer<T>` in the current scope
+ --> $DIR/issue-109299-1.rs:10:40
+ |
+LL | struct Lexer<T>(T);
+ | --------------- associated item `Cursor` not found for this struct
+...
+LL | type X = impl for<T> Fn() -> Lexer<T>::Cursor;
+ | ^^^^^^ associated item not found in `Lexer<T>`
+ |
+ = note: the associated type was found for
+ - `Lexer<i32>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0220`.
diff --git a/tests/ui/associated-inherent-types/issue-109299.rs b/tests/ui/associated-inherent-types/issue-109299.rs
new file mode 100644
index 000000000..84e4f9e72
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109299.rs
@@ -0,0 +1,12 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+struct Lexer<'d>(&'d ());
+
+impl Lexer<'d> { //~ ERROR use of undeclared lifetime name `'d`
+ type Cursor = ();
+}
+
+fn test(_: Lexer::Cursor) {}
+
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/issue-109299.stderr b/tests/ui/associated-inherent-types/issue-109299.stderr
new file mode 100644
index 000000000..63f50732d
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-109299.stderr
@@ -0,0 +1,11 @@
+error[E0261]: use of undeclared lifetime name `'d`
+ --> $DIR/issue-109299.rs:6:12
+ |
+LL | impl Lexer<'d> {
+ | - ^^ undeclared lifetime
+ | |
+ | help: consider introducing lifetime `'d` here: `<'d>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr b/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr
index 4162cdaa8..575b00e09 100644
--- a/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr
+++ b/tests/ui/associated-type-bounds/ambiguous-associated-type2.stderr
@@ -5,7 +5,7 @@ LL | trait Baz: Foo + Bar<Self::Item> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which immediately requires computing the super traits of `Baz` with associated type name `Item` again
-note: cycle used when computing the super traits of `Baz`
+note: cycle used when computing the super predicates of `Baz`
--> $DIR/ambiguous-associated-type2.rs:7:1
|
LL | trait Baz: Foo + Bar<Self::Item> {}
diff --git a/tests/ui/associated-type-bounds/issue-104916.rs b/tests/ui/associated-type-bounds/issue-104916.rs
new file mode 100644
index 000000000..3361fa011
--- /dev/null
+++ b/tests/ui/associated-type-bounds/issue-104916.rs
@@ -0,0 +1,14 @@
+#![feature(associated_type_bounds)]
+
+trait B {
+ type AssocType;
+}
+
+fn f()
+where
+ dyn for<'j> B<AssocType: 'j>:,
+ //~^ ERROR: associated type bounds are only allowed in where clauses and function signatures
+{
+}
+
+fn main() {}
diff --git a/tests/ui/associated-type-bounds/issue-104916.stderr b/tests/ui/associated-type-bounds/issue-104916.stderr
new file mode 100644
index 000000000..35435962f
--- /dev/null
+++ b/tests/ui/associated-type-bounds/issue-104916.stderr
@@ -0,0 +1,8 @@
+error: associated type bounds are only allowed in where clauses and function signatures, not in bounds
+ --> $DIR/issue-104916.rs:9:19
+ |
+LL | dyn for<'j> B<AssocType: 'j>:,
+ | ^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
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
new file mode 100644
index 000000000..79cee5517
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs
@@ -0,0 +1,22 @@
+// edition: 2021
+
+#![feature(return_type_notation, async_fn_in_trait)]
+//~^ WARN the feature `return_type_notation` is incomplete
+//~| WARN the feature `async_fn_in_trait` is incomplete
+
+trait Trait {
+ async fn method() {}
+}
+
+fn foo<T: Trait<method(i32): Send>>() {}
+//~^ ERROR argument types not allowed with return type notation
+//~| ERROR associated type bounds are unstable
+
+fn bar<T: Trait<method() -> (): Send>>() {}
+//~^ ERROR return type not allowed with return type notation
+//~| ERROR associated type bounds are unstable
+
+fn baz<T: Trait<method(..): Send>>() {}
+//~^ ERROR return type notation uses `()` instead of `(..)` for elided arguments
+
+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.stderr
new file mode 100644
index 000000000..b23e0f791
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr
@@ -0,0 +1,56 @@
+error: return type notation uses `()` instead of `(..)` for elided arguments
+ --> $DIR/bad-inputs-and-output.rs:19:24
+ |
+LL | fn baz<T: Trait<method(..): Send>>() {}
+ | ^^ help: remove the `..`
+
+error[E0658]: associated type bounds are unstable
+ --> $DIR/bad-inputs-and-output.rs:11: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:15: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:3: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: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/bad-inputs-and-output.rs:3:34
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+
+error: argument types not allowed with return type notation
+ --> $DIR/bad-inputs-and-output.rs:11: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:15:25
+ |
+LL | fn bar<T: Trait<method() -> (): Send>>() {}
+ | ^^^^^^ help: remove the return type
+
+error: aborting due to 5 previous errors; 2 warnings emitted
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.rs b/tests/ui/associated-type-bounds/return-type-notation/basic.rs
new file mode 100644
index 000000000..0b7530b65
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/basic.rs
@@ -0,0 +1,28 @@
+// revisions: with without
+// edition: 2021
+//[with] check-pass
+
+#![feature(return_type_notation, async_fn_in_trait)]
+//~^ WARN the feature `return_type_notation` is incomplete
+//~| WARN the feature `async_fn_in_trait` is incomplete
+
+trait Foo {
+ async fn method() -> Result<(), ()>;
+}
+
+async fn foo<T: Foo>() -> Result<(), ()> {
+ T::method().await?;
+ Ok(())
+}
+
+fn is_send(_: impl Send) {}
+
+fn test<
+ #[cfg(with)] T: Foo<method(): Send>,
+ #[cfg(without)] T: Foo,
+>() {
+ is_send(foo::<T>());
+ //[without]~^ ERROR future cannot be sent between threads safely
+}
+
+fn main() {}
diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.with.stderr b/tests/ui/associated-type-bounds/return-type-notation/basic.with.stderr
new file mode 100644
index 000000000..722c774cb
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/basic.with.stderr
@@ -0,0 +1,19 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/basic.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
+
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/basic.rs:5:34
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr b/tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr
new file mode 100644
index 000000000..1645d8c26
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/basic.without.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/basic.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
+
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/basic.rs:5:34
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+
+error: future cannot be sent between threads safely
+ --> $DIR/basic.rs:24: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:14: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:18:20
+ |
+LL | fn is_send(_: impl Send) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to previous error; 2 warnings 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
new file mode 100644
index 000000000..75f757e90
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/equality.rs
@@ -0,0 +1,16 @@
+// edition: 2021
+
+#![feature(return_type_notation, async_fn_in_trait)]
+//~^ WARN the feature `return_type_notation` is incomplete
+//~| WARN the feature `async_fn_in_trait` is incomplete
+
+use std::future::Future;
+
+trait Trait {
+ async fn method() {}
+}
+
+fn test<T: Trait<method() = Box<dyn Future<Output = ()>>>>() {}
+//~^ ERROR return type notation is not allowed to use type equality
+
+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.stderr
new file mode 100644
index 000000000..c5b2e5710
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/equality.stderr
@@ -0,0 +1,25 @@
+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
+ |
+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: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/equality.rs:3:34
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+
+error: return type notation is not allowed to use type equality
+ --> $DIR/equality.rs:13:18
+ |
+LL | fn test<T: Trait<method() = Box<dyn Future<Output = ()>>>>() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error; 2 warnings emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/missing.rs b/tests/ui/associated-type-bounds/return-type-notation/missing.rs
new file mode 100644
index 000000000..7b98a5cda
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/missing.rs
@@ -0,0 +1,14 @@
+// edition: 2021
+
+#![feature(return_type_notation, async_fn_in_trait)]
+//~^ WARN the feature `return_type_notation` is incomplete
+//~| WARN the feature `async_fn_in_trait` is incomplete
+
+trait Trait {
+ async fn method() {}
+}
+
+fn bar<T: Trait<methid(): Send>>() {}
+//~^ ERROR cannot find associated function `methid` in trait `Trait`
+
+fn main() {}
diff --git a/tests/ui/associated-type-bounds/return-type-notation/missing.stderr b/tests/ui/associated-type-bounds/return-type-notation/missing.stderr
new file mode 100644
index 000000000..34f5bda88
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/missing.stderr
@@ -0,0 +1,25 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/missing.rs:3: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: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/missing.rs:3:34
+ |
+LL | #![feature(return_type_notation, async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+
+error: cannot find associated function `methid` in trait `Trait`
+ --> $DIR/missing.rs:11:17
+ |
+LL | fn bar<T: Trait<methid(): Send>>() {}
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error; 2 warnings emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.rs b/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.rs
new file mode 100644
index 000000000..db5f6fe38
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.rs
@@ -0,0 +1,11 @@
+#![feature(return_type_notation)]
+//~^ WARN the feature `return_type_notation` is incomplete
+
+trait Trait {
+ fn method() {}
+}
+
+fn test<T: Trait<method(): Send>>() {}
+//~^ ERROR return type notation used on function that is not `async` and does not return `impl Trait`
+
+fn main() {}
diff --git a/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.stderr b/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.stderr
new file mode 100644
index 000000000..31b793995
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.stderr
@@ -0,0 +1,22 @@
+warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/non-rpitit.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: return type notation used on function that is not `async` and does not return `impl Trait`
+ --> $DIR/non-rpitit.rs:8:18
+ |
+LL | fn method() {}
+ | ----------- this function must be `async` or return `impl Trait`
+...
+LL | fn test<T: Trait<method(): Send>>() {}
+ | ^^^^^^^^^^^^^^
+ |
+ = note: function returns `()`, which is not compatible with associated type return bounds
+
+error: aborting due to previous error; 1 warning emitted
+
diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs
new file mode 100644
index 000000000..9129f37e0
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs
@@ -0,0 +1,11 @@
+// edition: 2021
+// compile-flags: -Zunpretty=expanded
+
+trait Trait {
+ async fn method() {}
+}
+
+fn foo<T: Trait<method(i32): Send>>() {}
+//~^ ERROR associated type bounds are unstable
+
+fn main() {}
diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr
new file mode 100644
index 000000000..77e015b41
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr
@@ -0,0 +1,12 @@
+error[E0658]: associated type bounds are unstable
+ --> $DIR/unpretty-parenthesized.rs:8: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: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout
new file mode 100644
index 000000000..b3dea8f6e
--- /dev/null
+++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout
@@ -0,0 +1,15 @@
+#![feature(prelude_import)]
+#[prelude_import]
+use std::prelude::rust_2021::*;
+#[macro_use]
+extern crate std;
+// edition: 2021
+// compile-flags: -Zunpretty=expanded
+
+trait Trait {
+ async fn method() {}
+}
+
+fn foo<T: Trait<method(i32) : Send>>() {}
+
+fn main() {}
diff --git a/tests/ui/associated-types/associated-types-in-ambiguous-context.rs b/tests/ui/associated-types/associated-types-in-ambiguous-context.rs
index 51b53908f..5d6b1b591 100644
--- a/tests/ui/associated-types/associated-types-in-ambiguous-context.rs
+++ b/tests/ui/associated-types/associated-types-in-ambiguous-context.rs
@@ -1,3 +1,5 @@
+// normalize-stderr-test: "and \d+ other candidates" -> "and N other candidates"
+
trait Get {
type Value;
fn get(&self) -> <Self as Get>::Value;
diff --git a/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr b/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr
index 00856b55d..1ff6fd4b8 100644
--- a/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr
+++ b/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr
@@ -1,5 +1,5 @@
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:6:36
+ --> $DIR/associated-types-in-ambiguous-context.rs:8:36
|
LL | fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
| ^^^^^^^^^^
@@ -10,30 +10,37 @@ LL | fn get<T:Get,U:Get>(x: T, y: U) -> <Example as Get>::Value {}
| ~~~~~~~~~~~~~~~~~~~~~~~
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:20:17
+ --> $DIR/associated-types-in-ambiguous-context.rs:22:17
|
LL | trait Foo where Foo::Assoc: Bar {
| ^^^^^^^^^^ help: use the fully-qualified path: `<Self as Foo>::Assoc`
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:25:10
+ --> $DIR/associated-types-in-ambiguous-context.rs:27:10
|
LL | type X = std::ops::Deref::Target;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
-help: if there were a type named `Example` that implemented `Deref`, you could use the fully-qualified path
+help: use the fully-qualified path
|
-LL | type X = <Example as Deref>::Target;
+LL | type X = <CString as Deref>::Target;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | type X = <IoSlice<'_> as Deref>::Target;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | type X = <IoSliceMut<'_> as Deref>::Target;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | type X = <OsString as Deref>::Target;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ and N other candidates
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:11:23
+ --> $DIR/associated-types-in-ambiguous-context.rs:13:23
|
LL | fn grab(&self) -> Grab::Value;
| ^^^^^^^^^^^ help: use the fully-qualified path: `<Self as Grab>::Value`
error[E0223]: ambiguous associated type
- --> $DIR/associated-types-in-ambiguous-context.rs:14:22
+ --> $DIR/associated-types-in-ambiguous-context.rs:16:22
|
LL | fn get(&self) -> Get::Value;
| ^^^^^^^^^^
diff --git a/tests/ui/associated-types/defaults-suitability.stderr b/tests/ui/associated-types/defaults-suitability.stderr
index 248575875..4b2094691 100644
--- a/tests/ui/associated-types/defaults-suitability.stderr
+++ b/tests/ui/associated-types/defaults-suitability.stderr
@@ -11,7 +11,8 @@ LL | type Ty: Clone = NotClone;
| ^^^^^ required by this bound in `Tr::Ty`
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NotClone;
|
error[E0277]: the trait bound `NotClone: Clone` is not satisfied
@@ -30,7 +31,8 @@ LL | type Ty = NotClone;
| -- required by a bound in this associated type
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NotClone;
|
error[E0277]: the trait bound `T: Clone` is not satisfied
diff --git a/tests/ui/associated-types/issue-20825.stderr b/tests/ui/associated-types/issue-20825.stderr
index be2bbd448..c4dea68b8 100644
--- a/tests/ui/associated-types/issue-20825.stderr
+++ b/tests/ui/associated-types/issue-20825.stderr
@@ -5,7 +5,7 @@ LL | pub trait Processor: Subscriber<Input = Self::Input> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which immediately requires computing the super traits of `Processor` with associated type name `Input` again
-note: cycle used when computing the super traits of `Processor`
+note: cycle used when computing the super predicates of `Processor`
--> $DIR/issue-20825.rs:5:1
|
LL | pub trait Processor: Subscriber<Input = Self::Input> {
diff --git a/tests/ui/associated-types/issue-63591.rs b/tests/ui/associated-types/issue-63591.rs
index 4d2e39f4d..d07c12349 100644
--- a/tests/ui/associated-types/issue-63591.rs
+++ b/tests/ui/associated-types/issue-63591.rs
@@ -1,11 +1,13 @@
// check-pass
#![feature(associated_type_bounds)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
fn main() {}
-trait Bar { type Assoc; }
+trait Bar {
+ type Assoc;
+}
trait Thing {
type Out;
@@ -13,7 +15,9 @@ trait Thing {
}
struct AssocIsCopy;
-impl Bar for AssocIsCopy { type Assoc = u8; }
+impl Bar for AssocIsCopy {
+ type Assoc = u8;
+}
impl Thing for AssocIsCopy {
type Out = impl Bar<Assoc: Copy>;
diff --git a/tests/ui/associated-types/issue-67684.rs b/tests/ui/associated-types/issue-67684.rs
index 49efe8a1b..c6920cf8d 100644
--- a/tests/ui/associated-types/issue-67684.rs
+++ b/tests/ui/associated-types/issue-67684.rs
@@ -1,4 +1,10 @@
-// check-pass
+// revisions: check build
+// [check]check-pass
+//
+// This second configuration aims to verify that we do not ICE in ConstProp because of
+// normalization failure.
+// [build]build-pass
+// [build]compile-flags: -Zmir-opt-level=3 --emit=mir
#![allow(dead_code)]
diff --git a/tests/ui/async-await/async-trait-fn.current.stderr b/tests/ui/async-await/async-trait-fn.current.stderr
new file mode 100644
index 000000000..7ccf2f230
--- /dev/null
+++ b/tests/ui/async-await/async-trait-fn.current.stderr
@@ -0,0 +1,42 @@
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/async-trait-fn.rs:6:5
+ |
+LL | async fn foo() {}
+ | -----^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/async-trait-fn.rs:7:5
+ |
+LL | async fn bar(&self) {}
+ | -----^^^^^^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/async-trait-fn.rs:8:5
+ |
+LL | async fn baz() {
+ | -----^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0706`.
diff --git a/tests/ui/async-await/async-trait-fn.next.stderr b/tests/ui/async-await/async-trait-fn.next.stderr
new file mode 100644
index 000000000..7ccf2f230
--- /dev/null
+++ b/tests/ui/async-await/async-trait-fn.next.stderr
@@ -0,0 +1,42 @@
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/async-trait-fn.rs:6:5
+ |
+LL | async fn foo() {}
+ | -----^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/async-trait-fn.rs:7:5
+ |
+LL | async fn bar(&self) {}
+ | -----^^^^^^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/async-trait-fn.rs:8:5
+ |
+LL | async fn baz() {
+ | -----^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0706`.
diff --git a/tests/ui/async-await/async-trait-fn.rs b/tests/ui/async-await/async-trait-fn.rs
index e2062e827..04123badb 100644
--- a/tests/ui/async-await/async-trait-fn.rs
+++ b/tests/ui/async-await/async-trait-fn.rs
@@ -1,4 +1,5 @@
// edition:2018
+
trait T {
async fn foo() {} //~ ERROR functions in traits cannot be declared `async`
async fn bar(&self) {} //~ ERROR functions in traits cannot be declared `async`
diff --git a/tests/ui/async-await/async-trait-fn.stderr b/tests/ui/async-await/async-trait-fn.stderr
index afbe25cf7..68ebe3507 100644
--- a/tests/ui/async-await/async-trait-fn.stderr
+++ b/tests/ui/async-await/async-trait-fn.stderr
@@ -1,5 +1,5 @@
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/async-trait-fn.rs:3:5
+ --> $DIR/async-trait-fn.rs:4:5
|
LL | async fn foo() {}
| -----^^^^^^^^^
@@ -12,7 +12,7 @@ LL | async fn foo() {}
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/async-trait-fn.rs:4:5
+ --> $DIR/async-trait-fn.rs:5:5
|
LL | async fn bar(&self) {}
| -----^^^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL | async fn bar(&self) {}
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/async-trait-fn.rs:5:5
+ --> $DIR/async-trait-fn.rs:6:5
|
LL | async fn baz() {
| -----^^^^^^^^^
diff --git a/tests/ui/async-await/edition-deny-async-fns-2015.stderr b/tests/ui/async-await/edition-deny-async-fns-2015.current.stderr
index ba918eb28..c47b99e65 100644
--- a/tests/ui/async-await/edition-deny-async-fns-2015.stderr
+++ b/tests/ui/async-await/edition-deny-async-fns-2015.current.stderr
@@ -1,5 +1,5 @@
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:3:1
+ --> $DIR/edition-deny-async-fns-2015.rs:5:1
|
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -8,7 +8,7 @@ LL | async fn foo() {}
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:5:12
+ --> $DIR/edition-deny-async-fns-2015.rs:7:12
|
LL | fn baz() { async fn foo() {} }
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -17,7 +17,7 @@ LL | fn baz() { async fn foo() {} }
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:7:1
+ --> $DIR/edition-deny-async-fns-2015.rs:9:1
|
LL | async fn async_baz() {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -26,7 +26,7 @@ LL | async fn async_baz() {
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:8:5
+ --> $DIR/edition-deny-async-fns-2015.rs:10:5
|
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -35,7 +35,7 @@ LL | async fn bar() {}
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:14:5
+ --> $DIR/edition-deny-async-fns-2015.rs:16:5
|
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -44,7 +44,7 @@ LL | async fn foo() {}
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:18:5
+ --> $DIR/edition-deny-async-fns-2015.rs:20:5
|
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -53,7 +53,7 @@ LL | async fn foo() {}
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:36:9
+ --> $DIR/edition-deny-async-fns-2015.rs:38:9
|
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -62,7 +62,7 @@ LL | async fn bar() {}
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:26:9
+ --> $DIR/edition-deny-async-fns-2015.rs:28:9
|
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -71,7 +71,7 @@ LL | async fn foo() {}
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
- --> $DIR/edition-deny-async-fns-2015.rs:31:13
+ --> $DIR/edition-deny-async-fns-2015.rs:33:13
|
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -80,7 +80,7 @@ LL | async fn bar() {}
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/edition-deny-async-fns-2015.rs:18:5
+ --> $DIR/edition-deny-async-fns-2015.rs:20:5
|
LL | async fn foo() {}
| -----^^^^^^^^^
diff --git a/tests/ui/async-await/edition-deny-async-fns-2015.next.stderr b/tests/ui/async-await/edition-deny-async-fns-2015.next.stderr
new file mode 100644
index 000000000..c47b99e65
--- /dev/null
+++ b/tests/ui/async-await/edition-deny-async-fns-2015.next.stderr
@@ -0,0 +1,98 @@
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:5:1
+ |
+LL | async fn foo() {}
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:7:12
+ |
+LL | fn baz() { async fn foo() {} }
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:9:1
+ |
+LL | async fn async_baz() {
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:10:5
+ |
+LL | async fn bar() {}
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:16:5
+ |
+LL | async fn foo() {}
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:20:5
+ |
+LL | async fn foo() {}
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:38:9
+ |
+LL | async fn bar() {}
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:28:9
+ |
+LL | async fn foo() {}
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0670]: `async fn` is not permitted in Rust 2015
+ --> $DIR/edition-deny-async-fns-2015.rs:33:13
+ |
+LL | async fn bar() {}
+ | ^^^^^ to use `async fn`, switch to Rust 2018 or later
+ |
+ = help: pass `--edition 2021` to `rustc`
+ = note: for more on editions, read https://doc.rust-lang.org/edition-guide
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/edition-deny-async-fns-2015.rs:20:5
+ |
+LL | async fn foo() {}
+ | -----^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
+
+error: aborting due to 10 previous errors
+
+Some errors have detailed explanations: E0670, E0706.
+For more information about an error, try `rustc --explain E0670`.
diff --git a/tests/ui/async-await/edition-deny-async-fns-2015.rs b/tests/ui/async-await/edition-deny-async-fns-2015.rs
index 6bd6d879a..d4c30dc9d 100644
--- a/tests/ui/async-await/edition-deny-async-fns-2015.rs
+++ b/tests/ui/async-await/edition-deny-async-fns-2015.rs
@@ -1,4 +1,6 @@
// edition:2015
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
diff --git a/tests/ui/async-await/generator-desc.stderr b/tests/ui/async-await/generator-desc.stderr
index 51ac9d86b..042766f19 100644
--- a/tests/ui/async-await/generator-desc.stderr
+++ b/tests/ui/async-await/generator-desc.stderr
@@ -2,16 +2,18 @@ error[E0308]: mismatched types
--> $DIR/generator-desc.rs:10:19
|
LL | fun(async {}, async {});
- | -------- ^^^^^^^^
- | | |
- | | expected `async` block, found a different `async` block
- | | arguments to this function are incorrect
- | the expected `async` block
+ | --- -------- ^^^^^^^^ expected `async` block, found a different `async` block
+ | | |
+ | | the expected `async` block
+ | arguments to this function are incorrect
|
= note: expected `async` block `[async block@$DIR/generator-desc.rs:10:9: 10:17]`
found `async` block `[async block@$DIR/generator-desc.rs:10:19: 10:27]`
note: function defined here
- --> $SRC_DIR/core/src/future/mod.rs:LL:COL
+ --> $DIR/generator-desc.rs:8:4
+ |
+LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
+ | ^^^ -----
error[E0308]: mismatched types
--> $DIR/generator-desc.rs:12:16
diff --git a/tests/ui/async-await/in-trait/async-associated-types.rs b/tests/ui/async-await/in-trait/async-associated-types.rs
index 974f5aaff..89ca4039b 100644
--- a/tests/ui/async-await/in-trait/async-associated-types.rs
+++ b/tests/ui/async-await/in-trait/async-associated-types.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)]
#![feature(impl_trait_projections)]
diff --git a/tests/ui/async-await/in-trait/async-associated-types2.rs b/tests/ui/async-await/in-trait/async-associated-types2.rs
index e546a0579..b889f616a 100644
--- a/tests/ui/async-await/in-trait/async-associated-types2.rs
+++ b/tests/ui/async-await/in-trait/async-associated-types2.rs
@@ -1,8 +1,10 @@
// check-pass
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
#![allow(incomplete_features)]
use std::future::Future;
@@ -21,9 +23,7 @@ impl MyTrait for i32 {
Self: 'a;
fn foo<'a>(&'a self) -> Self::Fut<'a> {
- async {
- *self
- }
+ async { *self }
}
}
diff --git a/tests/ui/async-await/in-trait/async-default-fn-overridden.stderr b/tests/ui/async-await/in-trait/async-default-fn-overridden.current.stderr
index 61a826258..2142ee232 100644
--- a/tests/ui/async-await/in-trait/async-default-fn-overridden.stderr
+++ b/tests/ui/async-await/in-trait/async-default-fn-overridden.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/async-default-fn-overridden.rs:4:12
+ --> $DIR/async-default-fn-overridden.rs:6:12
|
LL | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/async-await/in-trait/async-default-fn-overridden.next.stderr b/tests/ui/async-await/in-trait/async-default-fn-overridden.next.stderr
new file mode 100644
index 000000000..2142ee232
--- /dev/null
+++ b/tests/ui/async-await/in-trait/async-default-fn-overridden.next.stderr
@@ -0,0 +1,11 @@
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/async-default-fn-overridden.rs:6:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/async-await/in-trait/async-default-fn-overridden.rs b/tests/ui/async-await/in-trait/async-default-fn-overridden.rs
index 0fd1a2703..dd1af93d7 100644
--- a/tests/ui/async-await/in-trait/async-default-fn-overridden.rs
+++ b/tests/ui/async-await/in-trait/async-default-fn-overridden.rs
@@ -1,5 +1,7 @@
// run-pass
// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.current.stderr
index 168ef8e9e..b5ace9ada 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
+++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.current.stderr
@@ -1,11 +1,11 @@
error[E0053]: method `foo` has an incompatible type for trait
- --> $DIR/async-example-desugared-boxed-in-trait.rs:15:28
+ --> $DIR/async-example-desugared-boxed-in-trait.rs:17:28
|
LL | async fn foo(&self) -> i32 {
| ^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
|
note: type in trait
- --> $DIR/async-example-desugared-boxed-in-trait.rs:11:22
+ --> $DIR/async-example-desugared-boxed-in-trait.rs:13:22
|
LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.next.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.next.stderr
new file mode 100644
index 000000000..b5ace9ada
--- /dev/null
+++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.next.stderr
@@ -0,0 +1,17 @@
+error[E0053]: method `foo` has an incompatible type for trait
+ --> $DIR/async-example-desugared-boxed-in-trait.rs:17:28
+ |
+LL | async fn foo(&self) -> i32 {
+ | ^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
+ |
+note: type in trait
+ --> $DIR/async-example-desugared-boxed-in-trait.rs:13:22
+ |
+LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: expected signature `fn(&i32) -> Pin<Box<dyn Future<Output = i32>>>`
+ found signature `fn(&i32) -> impl Future<Output = i32>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs
index 38ba29718..7b53379b2 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs
+++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs
@@ -1,4 +1,6 @@
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed.current.stderr
index 60fa534a6..6c0b58591 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr
+++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed.current.stderr
@@ -1,5 +1,5 @@
error: method `foo` should be async because the method from the trait is async
- --> $DIR/async-example-desugared-boxed.rs:15:5
+ --> $DIR/async-example-desugared-boxed.rs:17:5
|
LL | async fn foo(&self) -> i32;
| --------------------------- required because the trait method is async
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.next.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed.next.stderr
new file mode 100644
index 000000000..6c0b58591
--- /dev/null
+++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed.next.stderr
@@ -0,0 +1,11 @@
+error: method `foo` should be async because the method from the trait is async
+ --> $DIR/async-example-desugared-boxed.rs:17:5
+ |
+LL | async fn foo(&self) -> i32;
+ | --------------------------- required because the trait method is async
+...
+LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.rs b/tests/ui/async-await/in-trait/async-example-desugared-boxed.rs
index 1b1b3cffd..916488ffa 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-boxed.rs
+++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed.rs
@@ -1,4 +1,6 @@
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-extra.rs b/tests/ui/async-await/in-trait/async-example-desugared-extra.rs
index 81e1e59a3..edac0b374 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-extra.rs
+++ b/tests/ui/async-await/in-trait/async-example-desugared-extra.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)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs b/tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs
index feeda719e..934f7643d 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-in-trait.rs
+++ b/tests/ui/async-await/in-trait/async-example-desugared-in-trait.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)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr b/tests/ui/async-await/in-trait/async-example-desugared-manual.current.stderr
index 567a36a86..0d2551ab8 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr
+++ b/tests/ui/async-await/in-trait/async-example-desugared-manual.current.stderr
@@ -1,5 +1,5 @@
error: method `foo` should be async because the method from the trait is async
- --> $DIR/async-example-desugared-manual.rs:23:5
+ --> $DIR/async-example-desugared-manual.rs:25:5
|
LL | async fn foo(&self) -> i32;
| --------------------------- required because the trait method is async
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.next.stderr b/tests/ui/async-await/in-trait/async-example-desugared-manual.next.stderr
new file mode 100644
index 000000000..0d2551ab8
--- /dev/null
+++ b/tests/ui/async-await/in-trait/async-example-desugared-manual.next.stderr
@@ -0,0 +1,11 @@
+error: method `foo` should be async because the method from the trait is async
+ --> $DIR/async-example-desugared-manual.rs:25:5
+ |
+LL | async fn foo(&self) -> i32;
+ | --------------------------- required because the trait method is async
+...
+LL | fn foo(&self) -> MyFuture {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.rs b/tests/ui/async-await/in-trait/async-example-desugared-manual.rs
index 71473e745..4883828d3 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-manual.rs
+++ b/tests/ui/async-await/in-trait/async-example-desugared-manual.rs
@@ -1,4 +1,6 @@
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/async-await/in-trait/async-example-desugared.rs b/tests/ui/async-await/in-trait/async-example-desugared.rs
index fb92ec786..214171b2e 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared.rs
+++ b/tests/ui/async-await/in-trait/async-example-desugared.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)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr b/tests/ui/async-await/in-trait/async-generics-and-bounds.current.stderr
index f1f0d7e59..780da0689 100644
--- a/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr
+++ b/tests/ui/async-await/in-trait/async-generics-and-bounds.current.stderr
@@ -1,33 +1,33 @@
error[E0311]: the parameter type `U` may not live long enough
- --> $DIR/async-generics-and-bounds.rs:12:28
+ --> $DIR/async-generics-and-bounds.rs:14:28
|
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^^^
|
note: the parameter type `U` must be valid for the anonymous lifetime defined here...
- --> $DIR/async-generics-and-bounds.rs:12:18
+ --> $DIR/async-generics-and-bounds.rs:14:18
|
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
- --> $DIR/async-generics-and-bounds.rs:12:28
+ --> $DIR/async-generics-and-bounds.rs:14:28
|
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^^^
error[E0311]: the parameter type `T` may not live long enough
- --> $DIR/async-generics-and-bounds.rs:12:28
+ --> $DIR/async-generics-and-bounds.rs:14:28
|
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^^^
|
note: the parameter type `T` must be valid for the anonymous lifetime defined here...
- --> $DIR/async-generics-and-bounds.rs:12:18
+ --> $DIR/async-generics-and-bounds.rs:14:18
|
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
- --> $DIR/async-generics-and-bounds.rs:12:28
+ --> $DIR/async-generics-and-bounds.rs:14:28
|
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^^^
diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.next.stderr b/tests/ui/async-await/in-trait/async-generics-and-bounds.next.stderr
new file mode 100644
index 000000000..780da0689
--- /dev/null
+++ b/tests/ui/async-await/in-trait/async-generics-and-bounds.next.stderr
@@ -0,0 +1,37 @@
+error[E0311]: the parameter type `U` may not live long enough
+ --> $DIR/async-generics-and-bounds.rs:14:28
+ |
+LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
+ | ^^^^^^^
+ |
+note: the parameter type `U` must be valid for the anonymous lifetime defined here...
+ --> $DIR/async-generics-and-bounds.rs:14:18
+ |
+LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
+ | ^^^^^
+note: ...so that the reference type `&(T, U)` does not outlive the data it points at
+ --> $DIR/async-generics-and-bounds.rs:14:28
+ |
+LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
+ | ^^^^^^^
+
+error[E0311]: the parameter type `T` may not live long enough
+ --> $DIR/async-generics-and-bounds.rs:14:28
+ |
+LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
+ | ^^^^^^^
+ |
+note: the parameter type `T` must be valid for the anonymous lifetime defined here...
+ --> $DIR/async-generics-and-bounds.rs:14:18
+ |
+LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
+ | ^^^^^
+note: ...so that the reference type `&(T, U)` does not outlive the data it points at
+ --> $DIR/async-generics-and-bounds.rs:14:28
+ |
+LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
+ | ^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0311`.
diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.rs b/tests/ui/async-await/in-trait/async-generics-and-bounds.rs
index a73d55adf..146e74ec2 100644
--- a/tests/ui/async-await/in-trait/async-generics-and-bounds.rs
+++ b/tests/ui/async-await/in-trait/async-generics-and-bounds.rs
@@ -1,6 +1,8 @@
// check-fail
// known-bug: #102682
// 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-generics.stderr b/tests/ui/async-await/in-trait/async-generics.current.stderr
index 2f0556456..04e1ab6d7 100644
--- a/tests/ui/async-await/in-trait/async-generics.stderr
+++ b/tests/ui/async-await/in-trait/async-generics.current.stderr
@@ -1,33 +1,33 @@
error[E0311]: the parameter type `U` may not live long enough
- --> $DIR/async-generics.rs:9:28
+ --> $DIR/async-generics.rs:11:28
|
LL | async fn foo(&self) -> &(T, U);
| ^^^^^^^
|
note: the parameter type `U` must be valid for the anonymous lifetime defined here...
- --> $DIR/async-generics.rs:9:18
+ --> $DIR/async-generics.rs:11:18
|
LL | async fn foo(&self) -> &(T, U);
| ^^^^^
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
- --> $DIR/async-generics.rs:9:28
+ --> $DIR/async-generics.rs:11:28
|
LL | async fn foo(&self) -> &(T, U);
| ^^^^^^^
error[E0311]: the parameter type `T` may not live long enough
- --> $DIR/async-generics.rs:9:28
+ --> $DIR/async-generics.rs:11:28
|
LL | async fn foo(&self) -> &(T, U);
| ^^^^^^^
|
note: the parameter type `T` must be valid for the anonymous lifetime defined here...
- --> $DIR/async-generics.rs:9:18
+ --> $DIR/async-generics.rs:11:18
|
LL | async fn foo(&self) -> &(T, U);
| ^^^^^
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
- --> $DIR/async-generics.rs:9:28
+ --> $DIR/async-generics.rs:11:28
|
LL | async fn foo(&self) -> &(T, U);
| ^^^^^^^
diff --git a/tests/ui/async-await/in-trait/async-generics.next.stderr b/tests/ui/async-await/in-trait/async-generics.next.stderr
new file mode 100644
index 000000000..04e1ab6d7
--- /dev/null
+++ b/tests/ui/async-await/in-trait/async-generics.next.stderr
@@ -0,0 +1,37 @@
+error[E0311]: the parameter type `U` may not live long enough
+ --> $DIR/async-generics.rs:11:28
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^^^
+ |
+note: the parameter type `U` must be valid for the anonymous lifetime defined here...
+ --> $DIR/async-generics.rs:11:18
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^
+note: ...so that the reference type `&(T, U)` does not outlive the data it points at
+ --> $DIR/async-generics.rs:11:28
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^^^
+
+error[E0311]: the parameter type `T` may not live long enough
+ --> $DIR/async-generics.rs:11:28
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^^^
+ |
+note: the parameter type `T` must be valid for the anonymous lifetime defined here...
+ --> $DIR/async-generics.rs:11:18
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^
+note: ...so that the reference type `&(T, U)` does not outlive the data it points at
+ --> $DIR/async-generics.rs:11:28
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0311`.
diff --git a/tests/ui/async-await/in-trait/async-generics.rs b/tests/ui/async-await/in-trait/async-generics.rs
index 67000e577..507500abf 100644
--- a/tests/ui/async-await/in-trait/async-generics.rs
+++ b/tests/ui/async-await/in-trait/async-generics.rs
@@ -1,6 +1,8 @@
// check-fail
// known-bug: #102682
// 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-recursive-generic.stderr b/tests/ui/async-await/in-trait/async-recursive-generic.current.stderr
index cab173bdd..67b491f19 100644
--- a/tests/ui/async-await/in-trait/async-recursive-generic.stderr
+++ b/tests/ui/async-await/in-trait/async-recursive-generic.current.stderr
@@ -1,5 +1,5 @@
error[E0733]: recursion in an `async fn` requires boxing
- --> $DIR/async-recursive-generic.rs:11:48
+ --> $DIR/async-recursive-generic.rs:13:48
|
LL | async fn foo_recursive(&self, n: usize) -> T {
| ^ recursive `async fn`
diff --git a/tests/ui/async-await/in-trait/async-recursive-generic.next.stderr b/tests/ui/async-await/in-trait/async-recursive-generic.next.stderr
new file mode 100644
index 000000000..67b491f19
--- /dev/null
+++ b/tests/ui/async-await/in-trait/async-recursive-generic.next.stderr
@@ -0,0 +1,12 @@
+error[E0733]: recursion in an `async fn` requires boxing
+ --> $DIR/async-recursive-generic.rs:13:48
+ |
+LL | async fn foo_recursive(&self, n: usize) -> T {
+ | ^ recursive `async fn`
+ |
+ = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`
+ = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0733`.
diff --git a/tests/ui/async-await/in-trait/async-recursive-generic.rs b/tests/ui/async-await/in-trait/async-recursive-generic.rs
index 6839abd38..64c6ba15c 100644
--- a/tests/ui/async-await/in-trait/async-recursive-generic.rs
+++ b/tests/ui/async-await/in-trait/async-recursive-generic.rs
@@ -1,4 +1,6 @@
// 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-recursive.stderr b/tests/ui/async-await/in-trait/async-recursive.current.stderr
index 9feff37b3..85af27e37 100644
--- a/tests/ui/async-await/in-trait/async-recursive.stderr
+++ b/tests/ui/async-await/in-trait/async-recursive.current.stderr
@@ -1,5 +1,5 @@
error[E0733]: recursion in an `async fn` requires boxing
- --> $DIR/async-recursive.rs:11:48
+ --> $DIR/async-recursive.rs:13:48
|
LL | async fn foo_recursive(&self, n: usize) -> i32 {
| ^^^ recursive `async fn`
diff --git a/tests/ui/async-await/in-trait/async-recursive.next.stderr b/tests/ui/async-await/in-trait/async-recursive.next.stderr
new file mode 100644
index 000000000..85af27e37
--- /dev/null
+++ b/tests/ui/async-await/in-trait/async-recursive.next.stderr
@@ -0,0 +1,12 @@
+error[E0733]: recursion in an `async fn` requires boxing
+ --> $DIR/async-recursive.rs:13:48
+ |
+LL | async fn foo_recursive(&self, n: usize) -> i32 {
+ | ^^^ recursive `async fn`
+ |
+ = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`
+ = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0733`.
diff --git a/tests/ui/async-await/in-trait/async-recursive.rs b/tests/ui/async-await/in-trait/async-recursive.rs
index 61119f809..d928909e3 100644
--- a/tests/ui/async-await/in-trait/async-recursive.rs
+++ b/tests/ui/async-await/in-trait/async-recursive.rs
@@ -1,4 +1,6 @@
// 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/bad-signatures.stderr b/tests/ui/async-await/in-trait/bad-signatures.current.stderr
index e0ba7b53e..5a05b080c 100644
--- a/tests/ui/async-await/in-trait/bad-signatures.stderr
+++ b/tests/ui/async-await/in-trait/bad-signatures.current.stderr
@@ -1,11 +1,11 @@
error: expected identifier, found keyword `self`
- --> $DIR/bad-signatures.rs:7:23
+ --> $DIR/bad-signatures.rs:9:23
|
LL | async fn bar(&abc self);
| ^^^^ expected identifier, found keyword
error: expected one of `:`, `@`, or `|`, found keyword `self`
- --> $DIR/bad-signatures.rs:7:23
+ --> $DIR/bad-signatures.rs:9:23
|
LL | async fn bar(&abc self);
| -----^^^^
@@ -14,7 +14,7 @@ LL | async fn bar(&abc self);
| help: declare the type after the parameter binding: `<identifier>: <type>`
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/bad-signatures.rs:3:12
+ --> $DIR/bad-signatures.rs:5:12
|
LL | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/async-await/in-trait/bad-signatures.next.stderr b/tests/ui/async-await/in-trait/bad-signatures.next.stderr
new file mode 100644
index 000000000..5a05b080c
--- /dev/null
+++ b/tests/ui/async-await/in-trait/bad-signatures.next.stderr
@@ -0,0 +1,26 @@
+error: expected identifier, found keyword `self`
+ --> $DIR/bad-signatures.rs:9:23
+ |
+LL | async fn bar(&abc self);
+ | ^^^^ expected identifier, found keyword
+
+error: expected one of `:`, `@`, or `|`, found keyword `self`
+ --> $DIR/bad-signatures.rs:9:23
+ |
+LL | async fn bar(&abc self);
+ | -----^^^^
+ | | |
+ | | expected one of `:`, `@`, or `|`
+ | help: declare the type after the parameter binding: `<identifier>: <type>`
+
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/bad-signatures.rs:5:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
diff --git a/tests/ui/async-await/in-trait/bad-signatures.rs b/tests/ui/async-await/in-trait/bad-signatures.rs
index b86f1d1c1..e0093be8c 100644
--- a/tests/ui/async-await/in-trait/bad-signatures.rs
+++ b/tests/ui/async-await/in-trait/bad-signatures.rs
@@ -1,4 +1,6 @@
// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
//~^ WARN the feature `async_fn_in_trait` is incomplete
diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.current.stderr
index f71fd9980..1e67cdca2 100644
--- a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr
+++ b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/dont-project-to-specializable-projection.rs:4:12
+ --> $DIR/dont-project-to-specializable-projection.rs:6:12
|
LL | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(async_fn_in_trait)]
= note: `#[warn(incomplete_features)]` on by default
error: async associated function in trait cannot be specialized
- --> $DIR/dont-project-to-specializable-projection.rs:14:5
+ --> $DIR/dont-project-to-specializable-projection.rs:16:5
|
LL | default async fn foo(_: T) -> &'static str {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.next.stderr b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.next.stderr
new file mode 100644
index 000000000..fa89c6b77
--- /dev/null
+++ b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.next.stderr
@@ -0,0 +1,34 @@
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/dont-project-to-specializable-projection.rs:6:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0053]: method `foo` has an incompatible type for trait
+ --> $DIR/dont-project-to-specializable-projection.rs:16:35
+ |
+LL | default async fn foo(_: T) -> &'static str {
+ | ^^^^^^^^^^^^ expected associated type, found future
+ |
+note: type in trait
+ --> $DIR/dont-project-to-specializable-projection.rs:12:27
+ |
+LL | async fn foo(_: T) -> &'static str;
+ | ^^^^^^^^^^^^
+ = note: expected signature `fn(_) -> impl Future<Output = &'static str>`
+ found signature `fn(_) -> impl Future<Output = &'static str>`
+
+error: async associated function in trait cannot be specialized
+ --> $DIR/dont-project-to-specializable-projection.rs:16:5
+ |
+LL | default async fn foo(_: T) -> &'static str {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: specialization behaves in inconsistent and surprising ways with `#![feature(async_fn_in_trait)]`, and for now is disallowed
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs
index afd3db5e0..7183eaccc 100644
--- a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs
+++ b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs
@@ -1,5 +1,7 @@
// edition: 2021
// known-bug: #108309
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
#![feature(min_specialization)]
diff --git a/tests/ui/async-await/in-trait/early-bound-1.rs b/tests/ui/async-await/in-trait/early-bound-1.rs
index 6b3b14201..30843473d 100644
--- a/tests/ui/async-await/in-trait/early-bound-1.rs
+++ b/tests/ui/async-await/in-trait/early-bound-1.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/early-bound-2.rs b/tests/ui/async-await/in-trait/early-bound-2.rs
index 270443229..1c5a68c2a 100644
--- a/tests/ui/async-await/in-trait/early-bound-2.rs
+++ b/tests/ui/async-await/in-trait/early-bound-2.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/fn-not-async-err2.stderr b/tests/ui/async-await/in-trait/fn-not-async-err2.current.stderr
index 37d9669c0..1a7495149 100644
--- a/tests/ui/async-await/in-trait/fn-not-async-err2.stderr
+++ b/tests/ui/async-await/in-trait/fn-not-async-err2.current.stderr
@@ -1,5 +1,5 @@
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
- --> $DIR/fn-not-async-err2.rs:13:22
+ --> $DIR/fn-not-async-err2.rs:15:22
|
LL | fn foo(&self) -> impl Future<Output = i32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/async-await/in-trait/fn-not-async-err2.next.stderr b/tests/ui/async-await/in-trait/fn-not-async-err2.next.stderr
new file mode 100644
index 000000000..1a7495149
--- /dev/null
+++ b/tests/ui/async-await/in-trait/fn-not-async-err2.next.stderr
@@ -0,0 +1,12 @@
+error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
+ --> $DIR/fn-not-async-err2.rs:15:22
+ |
+LL | fn foo(&self) -> impl Future<Output = i32> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0562`.
diff --git a/tests/ui/async-await/in-trait/fn-not-async-err2.rs b/tests/ui/async-await/in-trait/fn-not-async-err2.rs
index 78017429f..5fdb7296a 100644
--- a/tests/ui/async-await/in-trait/fn-not-async-err2.rs
+++ b/tests/ui/async-await/in-trait/fn-not-async-err2.rs
@@ -1,4 +1,6 @@
// 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/generics-mismatch.current.stderr b/tests/ui/async-await/in-trait/generics-mismatch.current.stderr
new file mode 100644
index 000000000..be23384e0
--- /dev/null
+++ b/tests/ui/async-await/in-trait/generics-mismatch.current.stderr
@@ -0,0 +1,16 @@
+error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
+ --> $DIR/generics-mismatch.rs:13:18
+ |
+LL | trait Foo {
+ | ---
+LL | async fn foo<T>();
+ | - expected type parameter
+...
+LL | impl Foo for () {
+ | ---------------
+LL | async fn foo<const N: usize>() {}
+ | ^^^^^^^^^^^^^^ found const parameter of type `usize`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/async-await/in-trait/generics-mismatch.next.stderr b/tests/ui/async-await/in-trait/generics-mismatch.next.stderr
new file mode 100644
index 000000000..be23384e0
--- /dev/null
+++ b/tests/ui/async-await/in-trait/generics-mismatch.next.stderr
@@ -0,0 +1,16 @@
+error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
+ --> $DIR/generics-mismatch.rs:13:18
+ |
+LL | trait Foo {
+ | ---
+LL | async fn foo<T>();
+ | - expected type parameter
+...
+LL | impl Foo for () {
+ | ---------------
+LL | async fn foo<const N: usize>() {}
+ | ^^^^^^^^^^^^^^ found const parameter of type `usize`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/async-await/in-trait/generics-mismatch.rs b/tests/ui/async-await/in-trait/generics-mismatch.rs
new file mode 100644
index 000000000..fc29783c0
--- /dev/null
+++ b/tests/ui/async-await/in-trait/generics-mismatch.rs
@@ -0,0 +1,15 @@
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+trait Foo {
+ async fn foo<T>();
+}
+
+impl Foo for () {
+ async fn foo<const N: usize>() {}
+ //~^ ERROR: method `foo` has an incompatible generic parameter for trait `Foo` [E0053]
+}
+
+fn main() {}
diff --git a/tests/ui/async-await/in-trait/generics-mismatch.stderr b/tests/ui/async-await/in-trait/generics-mismatch.stderr
new file mode 100644
index 000000000..3518aa05c
--- /dev/null
+++ b/tests/ui/async-await/in-trait/generics-mismatch.stderr
@@ -0,0 +1,16 @@
+error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
+ --> $DIR/generics-mismatch.rs:11:18
+ |
+LL | trait Foo {
+ | ---
+LL | async fn foo<T>();
+ | - expected type parameter
+...
+LL | impl Foo for () {
+ | ---------------
+LL | async fn foo<const N: usize>() {}
+ | ^^^^^^^^^^^^^^ found const parameter of type `usize`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/async-await/in-trait/implied-bounds.rs b/tests/ui/async-await/in-trait/implied-bounds.rs
index 52bceb3cc..45ada1d84 100644
--- a/tests/ui/async-await/in-trait/implied-bounds.rs
+++ b/tests/ui/async-await/in-trait/implied-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/issue-102138.rs b/tests/ui/async-await/in-trait/issue-102138.rs
index f61b34ed9..ced30b7e4 100644
--- a/tests/ui/async-await/in-trait/issue-102138.rs
+++ b/tests/ui/async-await/in-trait/issue-102138.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/issue-102219.rs b/tests/ui/async-await/in-trait/issue-102219.rs
index 9a35f6515..f3fdfa345 100644
--- a/tests/ui/async-await/in-trait/issue-102219.rs
+++ b/tests/ui/async-await/in-trait/issue-102219.rs
@@ -1,6 +1,8 @@
// compile-flags:--crate-type=lib
// edition:2021
// check-pass
+// [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/issue-102310.rs b/tests/ui/async-await/in-trait/issue-102310.rs
index 49c3e9fee..8e5dbd08e 100644
--- a/tests/ui/async-await/in-trait/issue-102310.rs
+++ b/tests/ui/async-await/in-trait/issue-102310.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/issue-104678.rs b/tests/ui/async-await/in-trait/issue-104678.rs
index e396df4e5..3d010f180 100644
--- a/tests/ui/async-await/in-trait/issue-104678.rs
+++ b/tests/ui/async-await/in-trait/issue-104678.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)]
#![allow(incomplete_features)]
diff --git a/tests/ui/async-await/in-trait/lifetime-mismatch.stderr b/tests/ui/async-await/in-trait/lifetime-mismatch.current.stderr
index d87adcc78..0e9477544 100644
--- a/tests/ui/async-await/in-trait/lifetime-mismatch.stderr
+++ b/tests/ui/async-await/in-trait/lifetime-mismatch.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/lifetime-mismatch.rs:3:12
+ --> $DIR/lifetime-mismatch.rs:5:12
|
LL | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(async_fn_in_trait)]
= note: `#[warn(incomplete_features)]` on by default
error[E0195]: lifetime parameters or bounds on method `foo` do not match the trait declaration
- --> $DIR/lifetime-mismatch.rs:12:17
+ --> $DIR/lifetime-mismatch.rs:14:17
|
LL | async fn foo<'a>(&self);
| ---- lifetimes in impl do not match this method in trait
diff --git a/tests/ui/async-await/in-trait/lifetime-mismatch.next.stderr b/tests/ui/async-await/in-trait/lifetime-mismatch.next.stderr
new file mode 100644
index 000000000..0e9477544
--- /dev/null
+++ b/tests/ui/async-await/in-trait/lifetime-mismatch.next.stderr
@@ -0,0 +1,21 @@
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/lifetime-mismatch.rs:5:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0195]: lifetime parameters or bounds on method `foo` do not match the trait declaration
+ --> $DIR/lifetime-mismatch.rs:14:17
+ |
+LL | async fn foo<'a>(&self);
+ | ---- lifetimes in impl do not match this method in trait
+...
+LL | async fn foo(&self) {}
+ | ^ lifetimes do not match method in trait
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0195`.
diff --git a/tests/ui/async-await/in-trait/lifetime-mismatch.rs b/tests/ui/async-await/in-trait/lifetime-mismatch.rs
index 45ede193c..5ff5a01a1 100644
--- a/tests/ui/async-await/in-trait/lifetime-mismatch.rs
+++ b/tests/ui/async-await/in-trait/lifetime-mismatch.rs
@@ -1,4 +1,6 @@
// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
diff --git a/tests/ui/async-await/in-trait/missing-send-bound.stderr b/tests/ui/async-await/in-trait/missing-send-bound.current.stderr
index 5cedf3ddb..319ed582e 100644
--- a/tests/ui/async-await/in-trait/missing-send-bound.stderr
+++ b/tests/ui/async-await/in-trait/missing-send-bound.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/missing-send-bound.rs:3:12
+ --> $DIR/missing-send-bound.rs:5:12
|
LL | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
@@ -8,19 +8,19 @@ LL | #![feature(async_fn_in_trait)]
= note: `#[warn(incomplete_features)]` on by default
error: future cannot be sent between threads safely
- --> $DIR/missing-send-bound.rs:15:20
+ --> $DIR/missing-send-bound.rs:17:20
|
LL | assert_is_send(test::<T>());
| ^^^^^^^^^^^ future returned by `test` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
note: future is not `Send` as it awaits another future which is not `Send`
- --> $DIR/missing-send-bound.rs:11:5
+ --> $DIR/missing-send-bound.rs:13:5
|
LL | T::bar().await;
| ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
note: required by a bound in `assert_is_send`
- --> $DIR/missing-send-bound.rs:19:27
+ --> $DIR/missing-send-bound.rs:21:27
|
LL | fn assert_is_send(_: impl Send) {}
| ^^^^ required by this bound in `assert_is_send`
diff --git a/tests/ui/async-await/in-trait/missing-send-bound.next.stderr b/tests/ui/async-await/in-trait/missing-send-bound.next.stderr
new file mode 100644
index 000000000..319ed582e
--- /dev/null
+++ b/tests/ui/async-await/in-trait/missing-send-bound.next.stderr
@@ -0,0 +1,29 @@
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/missing-send-bound.rs:5:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: future cannot be sent between threads safely
+ --> $DIR/missing-send-bound.rs:17:20
+ |
+LL | assert_is_send(test::<T>());
+ | ^^^^^^^^^^^ future returned by `test` is not `Send`
+ |
+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
+note: future is not `Send` as it awaits another future which is not `Send`
+ --> $DIR/missing-send-bound.rs:13:5
+ |
+LL | T::bar().await;
+ | ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
+note: required by a bound in `assert_is_send`
+ --> $DIR/missing-send-bound.rs:21:27
+ |
+LL | fn assert_is_send(_: impl Send) {}
+ | ^^^^ required by this bound in `assert_is_send`
+
+error: aborting due to previous error; 1 warning emitted
+
diff --git a/tests/ui/async-await/in-trait/missing-send-bound.rs b/tests/ui/async-await/in-trait/missing-send-bound.rs
index 78922b59b..705fcf322 100644
--- a/tests/ui/async-await/in-trait/missing-send-bound.rs
+++ b/tests/ui/async-await/in-trait/missing-send-bound.rs
@@ -1,4 +1,6 @@
// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
diff --git a/tests/ui/async-await/in-trait/object-safety.stderr b/tests/ui/async-await/in-trait/object-safety.current.stderr
index 0b318f71f..90e049a99 100644
--- a/tests/ui/async-await/in-trait/object-safety.stderr
+++ b/tests/ui/async-await/in-trait/object-safety.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/object-safety.rs:3:12
+ --> $DIR/object-safety.rs:5:12
|
LL | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
@@ -8,13 +8,13 @@ LL | #![feature(async_fn_in_trait)]
= note: `#[warn(incomplete_features)]` on by default
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:11:12
+ --> $DIR/object-safety.rs:13:12
|
LL | let x: &dyn Foo = todo!();
| ^^^^^^^^ `Foo` cannot be made into an object
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:7:14
+ --> $DIR/object-safety.rs:9:14
|
LL | trait Foo {
| --- this trait cannot be made into an object...
diff --git a/tests/ui/async-await/in-trait/object-safety.next.stderr b/tests/ui/async-await/in-trait/object-safety.next.stderr
new file mode 100644
index 000000000..90e049a99
--- /dev/null
+++ b/tests/ui/async-await/in-trait/object-safety.next.stderr
@@ -0,0 +1,27 @@
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/object-safety.rs:5:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0038]: the trait `Foo` cannot be made into an object
+ --> $DIR/object-safety.rs:13:12
+ |
+LL | let x: &dyn Foo = todo!();
+ | ^^^^^^^^ `Foo` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/object-safety.rs:9:14
+ |
+LL | trait Foo {
+ | --- this trait cannot be made into an object...
+LL | async fn foo(&self);
+ | ^^^ ...because method `foo` is `async`
+ = help: consider moving `foo` to another trait
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/async-await/in-trait/object-safety.rs b/tests/ui/async-await/in-trait/object-safety.rs
index a8bc35f7e..f67286a20 100644
--- a/tests/ui/async-await/in-trait/object-safety.rs
+++ b/tests/ui/async-await/in-trait/object-safety.rs
@@ -1,4 +1,6 @@
// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
diff --git a/tests/ui/async-await/in-trait/return-type-suggestion.stderr b/tests/ui/async-await/in-trait/return-type-suggestion.current.stderr
index b8d83d0f2..a5efc7571 100644
--- a/tests/ui/async-await/in-trait/return-type-suggestion.stderr
+++ b/tests/ui/async-await/in-trait/return-type-suggestion.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/return-type-suggestion.rs:3:12
+ --> $DIR/return-type-suggestion.rs:5:12
|
LL | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(async_fn_in_trait)]
= note: `#[warn(incomplete_features)]` on by default
error[E0308]: mismatched types
- --> $DIR/return-type-suggestion.rs:8:9
+ --> $DIR/return-type-suggestion.rs:10:9
|
LL | Ok(())
| ^^^^^^- help: consider using a semicolon here: `;`
diff --git a/tests/ui/async-await/in-trait/return-type-suggestion.next.stderr b/tests/ui/async-await/in-trait/return-type-suggestion.next.stderr
new file mode 100644
index 000000000..a5efc7571
--- /dev/null
+++ b/tests/ui/async-await/in-trait/return-type-suggestion.next.stderr
@@ -0,0 +1,23 @@
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/return-type-suggestion.rs:5:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0308]: mismatched types
+ --> $DIR/return-type-suggestion.rs:10:9
+ |
+LL | Ok(())
+ | ^^^^^^- help: consider using a semicolon here: `;`
+ | |
+ | expected `()`, found `Result<(), _>`
+ |
+ = note: expected unit type `()`
+ found enum `Result<(), _>`
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/async-await/in-trait/return-type-suggestion.rs b/tests/ui/async-await/in-trait/return-type-suggestion.rs
index 3446761d1..3de66306d 100644
--- a/tests/ui/async-await/in-trait/return-type-suggestion.rs
+++ b/tests/ui/async-await/in-trait/return-type-suggestion.rs
@@ -1,4 +1,6 @@
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait)]
//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
diff --git a/tests/ui/async-await/issue-108572.rs b/tests/ui/async-await/issue-108572.rs
new file mode 100644
index 000000000..efcb8b8eb
--- /dev/null
+++ b/tests/ui/async-await/issue-108572.rs
@@ -0,0 +1,12 @@
+// edition: 2021
+
+use std::future::Future;
+fn foo() -> impl Future<Output=()> {
+ async { }
+}
+
+fn main() {
+ let fut = foo();
+ fut.poll();
+ //~^ ERROR no method named `poll` found for opaque type `impl Future<Output = ()>` in the current scope [E0599]
+}
diff --git a/tests/ui/async-await/issue-108572.stderr b/tests/ui/async-await/issue-108572.stderr
new file mode 100644
index 000000000..0dbcf4d66
--- /dev/null
+++ b/tests/ui/async-await/issue-108572.stderr
@@ -0,0 +1,12 @@
+error[E0599]: no method named `poll` found for opaque type `impl Future<Output = ()>` in the current scope
+ --> $DIR/issue-108572.rs:10:9
+ |
+LL | fut.poll();
+ | ^^^^ method not found in `impl Future<Output = ()>`
+ |
+ = help: method `poll` found on `Pin<&mut impl Future<Output = ()>>`, see documentation for `std::pin::Pin`
+ = help: self type must be pinned to call `Future::poll`, see https://rust-lang.github.io/async-book/04_pinning/01_chapter.html#pinning-in-practice
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/async-await/large_moves.attribute.stderr b/tests/ui/async-await/large_moves.attribute.stderr
index 0c5452475..94f61caa2 100644
--- a/tests/ui/async-await/large_moves.attribute.stderr
+++ b/tests/ui/async-await/large_moves.attribute.stderr
@@ -1,14 +1,8 @@
error: moving 10024 bytes
- --> $DIR/large_moves.rs:13:13
+ --> $DIR/large_moves.rs:19:14
|
-LL | let x = async {
- | _____________^
-LL | | let y = [0; 9999];
-LL | | dbg!(y);
-LL | | thing(&y).await;
-LL | | dbg!(y);
-LL | | };
- | |_____^ value moved from here
+LL | let z = (x, 42);
+ | ^ value moved from here
|
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
note: the lint level is defined here
@@ -18,14 +12,6 @@ LL | #![deny(large_assignments)]
| ^^^^^^^^^^^^^^^^^
error: moving 10024 bytes
- --> $DIR/large_moves.rs:19:14
- |
-LL | let z = (x, 42);
- | ^ value moved from here
- |
- = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
-
-error: moving 10024 bytes
--> $DIR/large_moves.rs:19:13
|
LL | let z = (x, 42);
@@ -41,5 +27,5 @@ LL | let a = z.0;
|
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
diff --git a/tests/ui/async-await/large_moves.option.stderr b/tests/ui/async-await/large_moves.option.stderr
index 0c5452475..94f61caa2 100644
--- a/tests/ui/async-await/large_moves.option.stderr
+++ b/tests/ui/async-await/large_moves.option.stderr
@@ -1,14 +1,8 @@
error: moving 10024 bytes
- --> $DIR/large_moves.rs:13:13
+ --> $DIR/large_moves.rs:19:14
|
-LL | let x = async {
- | _____________^
-LL | | let y = [0; 9999];
-LL | | dbg!(y);
-LL | | thing(&y).await;
-LL | | dbg!(y);
-LL | | };
- | |_____^ value moved from here
+LL | let z = (x, 42);
+ | ^ value moved from here
|
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
note: the lint level is defined here
@@ -18,14 +12,6 @@ LL | #![deny(large_assignments)]
| ^^^^^^^^^^^^^^^^^
error: moving 10024 bytes
- --> $DIR/large_moves.rs:19:14
- |
-LL | let z = (x, 42);
- | ^ value moved from here
- |
- = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
-
-error: moving 10024 bytes
--> $DIR/large_moves.rs:19:13
|
LL | let z = (x, 42);
@@ -41,5 +27,5 @@ LL | let a = z.0;
|
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
diff --git a/tests/ui/async-await/large_moves.rs b/tests/ui/async-await/large_moves.rs
index d43d0eec0..c8ed6bafe 100644
--- a/tests/ui/async-await/large_moves.rs
+++ b/tests/ui/async-await/large_moves.rs
@@ -10,7 +10,7 @@
// compile-flags: -Zmir-opt-level=0
fn main() {
- let x = async { //~ ERROR large_assignments
+ let x = async {
let y = [0; 9999];
dbg!(y);
thing(&y).await;
diff --git a/tests/ui/async-await/missed-capture-issue-107414.rs b/tests/ui/async-await/missed-capture-issue-107414.rs
new file mode 100644
index 000000000..0ab4f5ade
--- /dev/null
+++ b/tests/ui/async-await/missed-capture-issue-107414.rs
@@ -0,0 +1,24 @@
+// check-pass
+// edition:2018
+
+fn main() {}
+
+struct StructA {}
+struct StructB {}
+
+impl StructA {
+ fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
+ true
+ }
+}
+
+async fn get_struct_a_async() -> StructA {
+ StructA {}
+}
+
+async fn ice() {
+ match Some(StructB {}) {
+ Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
+ _ => {}
+ }
+}
diff --git a/tests/ui/async-await/no-const-async.rs b/tests/ui/async-await/no-const-async.rs
index cfb0ef1b3..b3c59734e 100644
--- a/tests/ui/async-await/no-const-async.rs
+++ b/tests/ui/async-await/no-const-async.rs
@@ -3,4 +3,3 @@
pub const async fn x() {}
//~^ ERROR functions cannot be both `const` and `async`
-//~| ERROR cycle detected
diff --git a/tests/ui/async-await/no-const-async.stderr b/tests/ui/async-await/no-const-async.stderr
index 71c228958..90ec646c8 100644
--- a/tests/ui/async-await/no-const-async.stderr
+++ b/tests/ui/async-await/no-const-async.stderr
@@ -7,36 +7,5 @@ LL | pub const async fn x() {}
| | `async` because of this
| `const` because of this
-error[E0391]: cycle detected when computing type of `x::{opaque#0}`
- --> $DIR/no-const-async.rs:4:24
- |
-LL | pub const async fn x() {}
- | ^
- |
-note: ...which requires borrow-checking `x`...
- --> $DIR/no-const-async.rs:4:1
- |
-LL | pub const async fn x() {}
- | ^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `x`...
- --> $DIR/no-const-async.rs:4:1
- |
-LL | pub const async fn x() {}
- | ^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `x`...
- --> $DIR/no-const-async.rs:4:1
- |
-LL | pub const async fn x() {}
- | ^^^^^^^^^^^^^^^^^^^^^^
- = note: ...which requires computing whether `x::{opaque#0}` is freeze...
- = note: ...which requires evaluating trait selection obligation `x::{opaque#0}: core::marker::Freeze`...
- = note: ...which again requires computing type of `x::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
- --> $DIR/no-const-async.rs:4:1
- |
-LL | pub const async fn x() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/async-await/pin-needed-to-poll-2.stderr b/tests/ui/async-await/pin-needed-to-poll-2.stderr
index 0a6f705e2..61126faf8 100644
--- a/tests/ui/async-await/pin-needed-to-poll-2.stderr
+++ b/tests/ui/async-await/pin-needed-to-poll-2.stderr
@@ -6,7 +6,8 @@ LL | Pin::new(&mut self.sleep).poll(cx)
| |
| required by a bound introduced by this call
|
- = note: consider using `Box::pin`
+ = note: consider using the `pin!` macro
+ consider using `Box::pin` if you need to access the pinned value outside of the current scope
note: required because it appears within the type `Sleep`
--> $DIR/pin-needed-to-poll-2.rs:8:8
|
diff --git a/tests/ui/async-await/task-context-arg.rs b/tests/ui/async-await/task-context-arg.rs
new file mode 100644
index 000000000..937723ca7
--- /dev/null
+++ b/tests/ui/async-await/task-context-arg.rs
@@ -0,0 +1,25 @@
+// Checks that we don't get conflicting arguments in our debug info with a particular async function
+// structure.
+
+// edition:2021
+// compile-flags: -Cdebuginfo=2
+// build-pass
+
+#![crate_type = "lib"]
+
+use std::future::Future;
+
+// The compiler produces a closure as part of this function. That closure initially takes an
+// argument _task_context. Later, when the MIR for that closure is transformed into a generator
+// state machine, _task_context is demoted to not be an argument, but just part of an unnamed
+// argument. If we emit debug info saying that both _task_context and the unnamed argument are both
+// argument number 2, then LLVM will fail with "conflicting debug info for argument". See
+// https://github.com/rust-lang/rust/pull/109466#issuecomment-1500879195 for details.
+async fn recv_unit() {
+ std::future::ready(()).await;
+}
+
+pub fn poll_recv() {
+ // This box is necessary in order to reproduce the problem.
+ let _: Box<dyn Future<Output = ()>> = Box::new(recv_unit());
+}
diff --git a/tests/ui/async-await/track-caller/async-block.rs b/tests/ui/async-await/track-caller/async-block.rs
index 8e81387c3..8ddd4ab11 100644
--- a/tests/ui/async-await/track-caller/async-block.rs
+++ b/tests/ui/async-await/track-caller/async-block.rs
@@ -1,9 +1,9 @@
// edition:2021
-#![feature(closure_track_caller, stmt_expr_attributes)]
+#![feature(stmt_expr_attributes)]
fn main() {
let _ = #[track_caller] async {
- //~^ ERROR attribute should be applied to a function definition [E0739]
+ //~^ ERROR `#[track_caller]` on closures is currently unstable [E0658]
};
}
diff --git a/tests/ui/async-await/track-caller/async-block.stderr b/tests/ui/async-await/track-caller/async-block.stderr
index 407439921..21d1054d2 100644
--- a/tests/ui/async-await/track-caller/async-block.stderr
+++ b/tests/ui/async-await/track-caller/async-block.stderr
@@ -1,12 +1,12 @@
-error[E0739]: attribute should be applied to a function definition
+error[E0658]: `#[track_caller]` on closures is currently unstable
--> $DIR/async-block.rs:6:13
|
-LL | let _ = #[track_caller] async {
- | _____________^^^^^^^^^^^^^^^_-
-LL | |
-LL | | };
- | |_____- not a function definition
+LL | let _ = #[track_caller] async {
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information
+ = help: add `#![feature(closure_track_caller)]` to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0739`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/async-await/track-caller/panic-track-caller.rs b/tests/ui/async-await/track-caller/panic-track-caller.rs
index f45243b0e..65bb23e0b 100644
--- a/tests/ui/async-await/track-caller/panic-track-caller.rs
+++ b/tests/ui/async-await/track-caller/panic-track-caller.rs
@@ -79,6 +79,16 @@ async fn foo_closure() {
c().await
}
+// Since compilation is expected to fail for this fn when using
+// `nofeat`, we test that separately in `async-block.rs`
+#[cfg(feat)]
+async fn foo_block() {
+ let a = #[track_caller] async {
+ panic!();
+ };
+ a.await
+}
+
fn panicked_at(f: impl FnOnce() + panic::UnwindSafe) -> u32 {
let loc = Arc::new(Mutex::new(None));
@@ -110,4 +120,7 @@ fn main() {
#[cfg(feat)]
assert_eq!(panicked_at(|| block_on(foo_closure())), 79);
+
+ #[cfg(feat)]
+ assert_eq!(panicked_at(|| block_on(foo_block())), 89);
}
diff --git a/tests/ui/attributes/issue-105594-invalid-attr-validation.rs b/tests/ui/attributes/issue-105594-invalid-attr-validation.rs
index 6c68e6b04..096ce97ab 100644
--- a/tests/ui/attributes/issue-105594-invalid-attr-validation.rs
+++ b/tests/ui/attributes/issue-105594-invalid-attr-validation.rs
@@ -1,7 +1,7 @@
// This checks that the attribute validation ICE in issue #105594 doesn't
// recur.
//
-// ignore-thumbv8m.base
+// ignore-thumbv8m.base-none-eabi
#![feature(cmse_nonsecure_entry)]
fn main() {}
diff --git a/tests/ui/attributes/no-mangle-closure.rs b/tests/ui/attributes/no-mangle-closure.rs
new file mode 100644
index 000000000..c76baa27f
--- /dev/null
+++ b/tests/ui/attributes/no-mangle-closure.rs
@@ -0,0 +1,11 @@
+// Check that we do not ICE when `no_mangle` is applied to something that has no name.
+
+#![crate_type = "lib"]
+#![feature(stmt_expr_attributes)]
+
+pub struct S([usize; 8]);
+
+pub fn outer_function(x: S, y: S) -> usize {
+ (#[no_mangle] || y.0[0])()
+ //~^ ERROR `#[no_mangle]` cannot be used on a closure as it has no name
+}
diff --git a/tests/ui/attributes/no-mangle-closure.stderr b/tests/ui/attributes/no-mangle-closure.stderr
new file mode 100644
index 000000000..949eb7051
--- /dev/null
+++ b/tests/ui/attributes/no-mangle-closure.stderr
@@ -0,0 +1,8 @@
+error: `#[no_mangle]` cannot be used on a closure as it has no name
+ --> $DIR/no-mangle-closure.rs:9:6
+ |
+LL | (#[no_mangle] || y.0[0])()
+ | ^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/auto-traits/suspicious-negative-impls-lint.rs b/tests/ui/auto-traits/suspicious-negative-impls-lint.rs
new file mode 100644
index 000000000..34842e594
--- /dev/null
+++ b/tests/ui/auto-traits/suspicious-negative-impls-lint.rs
@@ -0,0 +1,21 @@
+#![feature(negative_impls)]
+#![deny(suspicious_auto_trait_impls)]
+
+use std::marker::PhantomData;
+
+struct ContainsVec<T>(Vec<T>);
+impl !Send for ContainsVec<u32> {}
+//~^ ERROR
+//~| WARNING this will change its meaning
+
+pub struct WithPhantomDataSend<T, U>(PhantomData<T>, U);
+impl<T> !Send for WithPhantomDataSend<*const T, u8> {}
+//~^ ERROR
+//~| WARNING this will change its meaning
+
+pub struct WithLifetime<'a, T>(&'a (), T);
+impl<T> !Sync for WithLifetime<'static, Option<T>> {}
+//~^ ERROR
+//~| WARNING this will change its meaning
+
+fn main() {}
diff --git a/tests/ui/auto-traits/suspicious-negative-impls-lint.stderr b/tests/ui/auto-traits/suspicious-negative-impls-lint.stderr
new file mode 100644
index 000000000..ee03ea125
--- /dev/null
+++ b/tests/ui/auto-traits/suspicious-negative-impls-lint.stderr
@@ -0,0 +1,52 @@
+error: cross-crate traits with a default impl, like `Send`, should not be specialized
+ --> $DIR/suspicious-negative-impls-lint.rs:7:1
+ |
+LL | impl !Send for ContainsVec<u32> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this will change its meaning in a future release!
+ = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
+ = note: `u32` is not a generic parameter
+note: try using the same sequence of generic parameters as the struct definition
+ --> $DIR/suspicious-negative-impls-lint.rs:6:1
+ |
+LL | struct ContainsVec<T>(Vec<T>);
+ | ^^^^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/suspicious-negative-impls-lint.rs:2:9
+ |
+LL | #![deny(suspicious_auto_trait_impls)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: cross-crate traits with a default impl, like `Send`, should not be specialized
+ --> $DIR/suspicious-negative-impls-lint.rs:12:1
+ |
+LL | impl<T> !Send for WithPhantomDataSend<*const T, u8> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this will change its meaning in a future release!
+ = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
+ = note: `*const T` is not a generic parameter
+note: try using the same sequence of generic parameters as the struct definition
+ --> $DIR/suspicious-negative-impls-lint.rs:11:1
+ |
+LL | pub struct WithPhantomDataSend<T, U>(PhantomData<T>, U);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: cross-crate traits with a default impl, like `Sync`, should not be specialized
+ --> $DIR/suspicious-negative-impls-lint.rs:17:1
+ |
+LL | impl<T> !Sync for WithLifetime<'static, Option<T>> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this will change its meaning in a future release!
+ = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
+ = note: `Option<T>` is not a generic parameter
+note: try using the same sequence of generic parameters as the struct definition
+ --> $DIR/suspicious-negative-impls-lint.rs:16:1
+ |
+LL | pub struct WithLifetime<'a, T>(&'a (), T);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/autoref-autoderef/issue-38940.rs b/tests/ui/autoref-autoderef/issue-38940.rs
deleted file mode 100644
index d2f1c6e32..000000000
--- a/tests/ui/autoref-autoderef/issue-38940.rs
+++ /dev/null
@@ -1,52 +0,0 @@
-// issue-38940: error printed twice for deref recursion limit exceeded
-// Test that the recursion limit can be changed. In this case, we have
-// deeply nested types that will fail the `Send` check by overflow
-// when the recursion limit is set very low.
-// compile-flags: -Zdeduplicate-diagnostics=yes
-
-#![allow(dead_code)]
-#![recursion_limit = "10"]
-macro_rules! link {
- ($outer:ident, $inner:ident) => {
- struct $outer($inner);
- impl $outer {
- fn new() -> $outer {
- $outer($inner::new())
- }
- }
- impl std::ops::Deref for $outer {
- type Target = $inner;
- fn deref(&self) -> &$inner {
- &self.0
- }
- }
- };
-}
-
-struct Bottom;
-
-impl Bottom {
- fn new() -> Bottom {
- Bottom
- }
-}
-
-link!(Top, A);
-link!(A, B);
-link!(B, C);
-link!(C, D);
-link!(D, E);
-link!(E, F);
-link!(F, G);
-link!(G, H);
-link!(H, I);
-link!(I, J);
-link!(J, K);
-link!(K, Bottom);
-
-fn main() {
- let t = Top::new();
- let x: &Bottom = &t;
- //~^ ERROR mismatched types
- //~| ERROR reached the recursion limit while auto-dereferencing `J`
-}
diff --git a/tests/ui/autoref-autoderef/issue-38940.stderr b/tests/ui/autoref-autoderef/issue-38940.stderr
deleted file mode 100644
index 8e98bfcd9..000000000
--- a/tests/ui/autoref-autoderef/issue-38940.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0055]: reached the recursion limit while auto-dereferencing `J`
- --> $DIR/issue-38940.rs:49:22
- |
-LL | let x: &Bottom = &t;
- | ^^ deref recursion limit reached
- |
- = help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]` attribute to your crate (`issue_38940`)
-
-error[E0308]: mismatched types
- --> $DIR/issue-38940.rs:49:22
- |
-LL | let x: &Bottom = &t;
- | ------- ^^ expected `&Bottom`, found `&Top`
- | |
- | expected due to this
- |
- = note: expected reference `&Bottom`
- found reference `&Top`
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0055, E0308.
-For more information about an error, try `rustc --explain E0055`.
diff --git a/tests/ui-fulldeps/auxiliary/issue-13560-1.rs b/tests/ui/auxiliary/issue-13560-1.rs
index c3a2ae679..c3a2ae679 100644
--- a/tests/ui-fulldeps/auxiliary/issue-13560-1.rs
+++ b/tests/ui/auxiliary/issue-13560-1.rs
diff --git a/tests/ui-fulldeps/auxiliary/issue-13560-2.rs b/tests/ui/auxiliary/issue-13560-2.rs
index 39c261e11..39c261e11 100644
--- a/tests/ui-fulldeps/auxiliary/issue-13560-2.rs
+++ b/tests/ui/auxiliary/issue-13560-2.rs
diff --git a/tests/ui-fulldeps/auxiliary/issue-13560-3.rs b/tests/ui/auxiliary/issue-13560-3.rs
index e991bcc1a..e991bcc1a 100644
--- a/tests/ui-fulldeps/auxiliary/issue-13560-3.rs
+++ b/tests/ui/auxiliary/issue-13560-3.rs
diff --git a/tests/ui-fulldeps/auxiliary/issue-16822.rs b/tests/ui/auxiliary/issue-16822.rs
index 9042dd391..9042dd391 100644
--- a/tests/ui-fulldeps/auxiliary/issue-16822.rs
+++ b/tests/ui/auxiliary/issue-16822.rs
diff --git a/tests/ui-fulldeps/auxiliary/issue-18502.rs b/tests/ui/auxiliary/issue-18502.rs
index 4d4230607..4d4230607 100644
--- a/tests/ui-fulldeps/auxiliary/issue-18502.rs
+++ b/tests/ui/auxiliary/issue-18502.rs
diff --git a/tests/ui-fulldeps/auxiliary/issue-24106.rs b/tests/ui/auxiliary/issue-24106.rs
index 2c6a60348..2c6a60348 100644
--- a/tests/ui-fulldeps/auxiliary/issue-24106.rs
+++ b/tests/ui/auxiliary/issue-24106.rs
diff --git a/tests/ui/binding/issue-53114-safety-checks.rs b/tests/ui/binding/issue-53114-safety-checks.rs
index e234db516..f4be2b482 100644
--- a/tests/ui/binding/issue-53114-safety-checks.rs
+++ b/tests/ui/binding/issue-53114-safety-checks.rs
@@ -21,7 +21,7 @@ fn let_wild_gets_unsafe_field() {
let u2 = U { a: I(1) };
let p = P { a: &2, b: &3 };
let _ = &p.b; //~ ERROR reference to packed field
- let _ = u1.a; // #53114: should eventually signal error as well
+ let _ = u1.a; //~ ERROR [E0133]
let _ = &u2.a; //~ ERROR [E0133]
// variation on above with `_` in substructure
@@ -30,6 +30,20 @@ fn let_wild_gets_unsafe_field() {
let (_,) = (&u2.a,); //~ ERROR [E0133]
}
+fn let_ascribe_gets_unsafe_field() {
+ let u1 = U { a: I(0) };
+ let u2 = U { a: I(1) };
+ let p = P { a: &2, b: &3 };
+ let _: _ = &p.b; //~ ERROR reference to packed field
+ let _: _ = u1.a; //~ ERROR [E0133]
+ let _: _ = &u2.a; //~ ERROR [E0133]
+
+ // variation on above with `_` in substructure
+ let (_,): _ = (&p.b,); //~ ERROR reference to packed field
+ let (_,): _ = (u1.a,); //~ ERROR [E0133]
+ let (_,): _ = (&u2.a,); //~ ERROR [E0133]
+}
+
fn match_unsafe_field_to_wild() {
let u1 = U { a: I(0) };
let u2 = U { a: I(1) };
diff --git a/tests/ui/binding/issue-53114-safety-checks.stderr b/tests/ui/binding/issue-53114-safety-checks.stderr
index 5c9d78772..41318d0a3 100644
--- a/tests/ui/binding/issue-53114-safety-checks.stderr
+++ b/tests/ui/binding/issue-53114-safety-checks.stderr
@@ -17,7 +17,25 @@ LL | let (_,) = (&p.b,);
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned
- --> $DIR/issue-53114-safety-checks.rs:37:11
+ --> $DIR/issue-53114-safety-checks.rs:37:16
+ |
+LL | let _: _ = &p.b;
+ | ^^^^
+ |
+ = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/issue-53114-safety-checks.rs:42:20
+ |
+LL | let (_,): _ = (&p.b,);
+ | ^^^^
+ |
+ = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/issue-53114-safety-checks.rs:51:11
|
LL | match &p.b { _ => { } }
| ^^^^
@@ -26,7 +44,7 @@ LL | match &p.b { _ => { } }
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned
- --> $DIR/issue-53114-safety-checks.rs:42:12
+ --> $DIR/issue-53114-safety-checks.rs:56:12
|
LL | match (&p.b,) { (_,) => { } }
| ^^^^
@@ -35,6 +53,14 @@ LL | match (&p.b,) { (_,) => { } }
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/issue-53114-safety-checks.rs:24:13
+ |
+LL | let _ = u1.a;
+ | ^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/issue-53114-safety-checks.rs:25:13
|
LL | let _ = &u2.a;
@@ -59,7 +85,39 @@ LL | let (_,) = (&u2.a,);
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:38:11
+ --> $DIR/issue-53114-safety-checks.rs:38:16
+ |
+LL | let _: _ = u1.a;
+ | ^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/issue-53114-safety-checks.rs:39:16
+ |
+LL | let _: _ = &u2.a;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/issue-53114-safety-checks.rs:43:20
+ |
+LL | let (_,): _ = (u1.a,);
+ | ^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/issue-53114-safety-checks.rs:44:20
+ |
+LL | let (_,): _ = (&u2.a,);
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/issue-53114-safety-checks.rs:52:11
|
LL | match u1.a { _ => { } }
| ^^^^ access to union field
@@ -67,7 +125,7 @@ LL | match u1.a { _ => { } }
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:39:11
+ --> $DIR/issue-53114-safety-checks.rs:53:11
|
LL | match &u2.a { _ => { } }
| ^^^^^ access to union field
@@ -75,7 +133,7 @@ LL | match &u2.a { _ => { } }
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:43:12
+ --> $DIR/issue-53114-safety-checks.rs:57:12
|
LL | match (u1.a,) { (_,) => { } }
| ^^^^ access to union field
@@ -83,14 +141,14 @@ LL | match (u1.a,) { (_,) => { } }
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:44:12
+ --> $DIR/issue-53114-safety-checks.rs:58:12
|
LL | match (&u2.a,) { (_,) => { } }
| ^^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
-error: aborting due to 11 previous errors
+error: aborting due to 18 previous errors
Some errors have detailed explanations: E0133, E0793.
For more information about an error, try `rustc --explain E0133`.
diff --git a/tests/ui/binding/optional_comma_in_match_arm.rs b/tests/ui/binding/optional_comma_in_match_arm.rs
index fc268bf2a..71e2f07bb 100644
--- a/tests/ui/binding/optional_comma_in_match_arm.rs
+++ b/tests/ui/binding/optional_comma_in_match_arm.rs
@@ -1,6 +1,5 @@
// run-pass
#![allow(unused_unsafe)]
-// ignore-pretty issue #37199
#![allow(while_true)]
fn main() {
diff --git a/tests/ui/binop/issue-28837.stderr b/tests/ui/binop/issue-28837.stderr
index cca1da3b6..bb9f3b8af 100644
--- a/tests/ui/binop/issue-28837.stderr
+++ b/tests/ui/binop/issue-28837.stderr
@@ -157,7 +157,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialEq<_>`
help: consider annotating `A` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct A;
|
error[E0369]: binary operation `!=` cannot be applied to type `A`
@@ -175,7 +176,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialEq<_>`
help: consider annotating `A` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct A;
|
error[E0369]: binary operation `<` cannot be applied to type `A`
@@ -193,7 +195,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
-LL | #[derive(PartialEq, PartialOrd)]
+LL + #[derive(PartialEq, PartialOrd)]
+LL | struct A;
|
error[E0369]: binary operation `<=` cannot be applied to type `A`
@@ -211,7 +214,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
-LL | #[derive(PartialEq, PartialOrd)]
+LL + #[derive(PartialEq, PartialOrd)]
+LL | struct A;
|
error[E0369]: binary operation `>` cannot be applied to type `A`
@@ -229,7 +233,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
-LL | #[derive(PartialEq, PartialOrd)]
+LL + #[derive(PartialEq, PartialOrd)]
+LL | struct A;
|
error[E0369]: binary operation `>=` cannot be applied to type `A`
@@ -247,7 +252,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
-LL | #[derive(PartialEq, PartialOrd)]
+LL + #[derive(PartialEq, PartialOrd)]
+LL | struct A;
|
error: aborting due to 15 previous errors
diff --git a/tests/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr b/tests/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
index 5835f0675..0ca14c3f3 100644
--- a/tests/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
+++ b/tests/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
@@ -2,18 +2,16 @@ error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:36:9
|
LL | ref foo @ [.., ref mut bar] => (),
- | -------^^^^^^^^-----------^
- | | |
- | | value is mutably borrowed by `bar` here
+ | ^^^^^^^ ----------- value is mutably borrowed by `bar` here
+ | |
| value is borrowed by `foo` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:120:9
|
LL | ref foo @ Some(box ref mut s) => (),
- | -------^^^^^^^^^^^^---------^
- | | |
- | | value is mutably borrowed by `s` here
+ | ^^^^^^^ --------- value is mutably borrowed by `s` here
+ | |
| value is borrowed by `foo` here
error[E0382]: borrow of moved value: `x`
diff --git a/tests/ui/borrowck/borrowck-pat-enum.rs b/tests/ui/borrowck/borrowck-pat-enum.rs
index 7f9c5544d..6e51a2b2e 100644
--- a/tests/ui/borrowck/borrowck-pat-enum.rs
+++ b/tests/ui/borrowck/borrowck-pat-enum.rs
@@ -1,6 +1,5 @@
// run-pass
#![allow(dead_code)]
-// ignore-pretty issue #37199
fn match_ref(v: Option<isize>) -> isize {
match v {
diff --git a/tests/ui/borrowck/borrowck-vec-pattern-nesting.rs b/tests/ui/borrowck/borrowck-vec-pattern-nesting.rs
index 1bda7a497..127a3f5b2 100644
--- a/tests/ui/borrowck/borrowck-vec-pattern-nesting.rs
+++ b/tests/ui/borrowck/borrowck-vec-pattern-nesting.rs
@@ -8,6 +8,7 @@ fn a() {
//~^ NOTE `vec[_]` is borrowed here
vec[0] = Box::new(4); //~ ERROR cannot assign
//~^ NOTE `vec[_]` is assigned to here
+ //~| NOTE in this expansion of desugaring of drop and replace
_a.use_ref();
//~^ NOTE borrow later used here
}
@@ -22,6 +23,7 @@ fn b() {
//~^ `vec[_]` is borrowed here
vec[0] = Box::new(4); //~ ERROR cannot assign
//~^ NOTE `vec[_]` is assigned to here
+ //~| NOTE in this expansion of desugaring of drop and replace
_b.use_ref();
//~^ NOTE borrow later used here
}
diff --git a/tests/ui/borrowck/borrowck-vec-pattern-nesting.stderr b/tests/ui/borrowck/borrowck-vec-pattern-nesting.stderr
index 70b9e4f44..5e1251b05 100644
--- a/tests/ui/borrowck/borrowck-vec-pattern-nesting.stderr
+++ b/tests/ui/borrowck/borrowck-vec-pattern-nesting.stderr
@@ -6,24 +6,24 @@ LL | [box ref _a, _, _] => {
LL |
LL | vec[0] = Box::new(4);
| ^^^^^^ `vec[_]` is assigned to here but it was already borrowed
-LL |
+...
LL | _a.use_ref();
| ------------ borrow later used here
error[E0506]: cannot assign to `vec[_]` because it is borrowed
- --> $DIR/borrowck-vec-pattern-nesting.rs:23:13
+ --> $DIR/borrowck-vec-pattern-nesting.rs:24:13
|
LL | &mut [ref _b @ ..] => {
| ------ `vec[_]` is borrowed here
LL |
LL | vec[0] = Box::new(4);
| ^^^^^^ `vec[_]` is assigned to here but it was already borrowed
-LL |
+...
LL | _b.use_ref();
| ------------ borrow later used here
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
- --> $DIR/borrowck-vec-pattern-nesting.rs:34:11
+ --> $DIR/borrowck-vec-pattern-nesting.rs:36:11
|
LL | match vec {
| ^^^ cannot move out of here
@@ -41,7 +41,7 @@ LL + [_a,
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
- --> $DIR/borrowck-vec-pattern-nesting.rs:46:13
+ --> $DIR/borrowck-vec-pattern-nesting.rs:48:13
|
LL | let a = vec[0];
| ^^^^^^
@@ -55,7 +55,7 @@ LL | let a = &vec[0];
| +
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
- --> $DIR/borrowck-vec-pattern-nesting.rs:55:11
+ --> $DIR/borrowck-vec-pattern-nesting.rs:57:11
|
LL | match vec {
| ^^^ cannot move out of here
@@ -73,7 +73,7 @@ LL + [
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
- --> $DIR/borrowck-vec-pattern-nesting.rs:65:13
+ --> $DIR/borrowck-vec-pattern-nesting.rs:67:13
|
LL | let a = vec[0];
| ^^^^^^
@@ -87,7 +87,7 @@ LL | let a = &vec[0];
| +
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
- --> $DIR/borrowck-vec-pattern-nesting.rs:74:11
+ --> $DIR/borrowck-vec-pattern-nesting.rs:76:11
|
LL | match vec {
| ^^^ cannot move out of here
@@ -106,7 +106,7 @@ LL + [_a, _b, _c] => {}
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
- --> $DIR/borrowck-vec-pattern-nesting.rs:85:13
+ --> $DIR/borrowck-vec-pattern-nesting.rs:87:13
|
LL | let a = vec[0];
| ^^^^^^
diff --git a/tests/ui/borrowck/drop-in-loop.rs b/tests/ui/borrowck/drop-in-loop.rs
new file mode 100644
index 000000000..866c27ef2
--- /dev/null
+++ b/tests/ui/borrowck/drop-in-loop.rs
@@ -0,0 +1,24 @@
+// A version of `issue-70919-drop-in-loop`, but without
+// the necessary `drop` call.
+//
+// This should fail to compile, since the `Drop` impl
+// for `WrapperWithDrop` could observe the changed
+// `base` value.
+
+struct WrapperWithDrop<'a>(&'a mut bool);
+impl<'a> Drop for WrapperWithDrop<'a> {
+ fn drop(&mut self) {
+ }
+}
+
+fn drop_in_loop() {
+ let mut base = true;
+ let mut wrapper = WrapperWithDrop(&mut base);
+ loop {
+ base = false; //~ ERROR: cannot assign to `base`
+ wrapper = WrapperWithDrop(&mut base);
+ }
+}
+
+fn main() {
+}
diff --git a/tests/ui/borrowck/drop-in-loop.stderr b/tests/ui/borrowck/drop-in-loop.stderr
new file mode 100644
index 000000000..d5734e7ec
--- /dev/null
+++ b/tests/ui/borrowck/drop-in-loop.stderr
@@ -0,0 +1,14 @@
+error[E0506]: cannot assign to `base` because it is borrowed
+ --> $DIR/drop-in-loop.rs:18:9
+ |
+LL | let mut wrapper = WrapperWithDrop(&mut base);
+ | --------- `base` is borrowed here
+LL | loop {
+LL | base = false;
+ | ^^^^^^^^^^^^ `base` is assigned to here but it was already borrowed
+LL | wrapper = WrapperWithDrop(&mut base);
+ | ------- borrow might be used here, when `wrapper` is dropped and runs the `Drop` code for type `WrapperWithDrop`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0506`.
diff --git a/tests/ui/borrowck/issue-45199.rs b/tests/ui/borrowck/issue-45199.rs
index ded46e56e..6a6b25541 100644
--- a/tests/ui/borrowck/issue-45199.rs
+++ b/tests/ui/borrowck/issue-45199.rs
@@ -5,6 +5,7 @@ fn test_drop_replace() {
b = Box::new(1); //~ NOTE first assignment
b = Box::new(2); //~ ERROR cannot assign twice to immutable variable `b`
//~| NOTE cannot assign twice to immutable
+ //~| NOTE in this expansion of desugaring of drop and replace
}
fn test_call() {
@@ -13,12 +14,14 @@ fn test_call() {
//~| SUGGESTION mut b
b = Box::new(2); //~ ERROR cannot assign twice to immutable variable `b`
//~| NOTE cannot assign twice to immutable
+ //~| NOTE in this expansion of desugaring of drop and replace
}
fn test_args(b: Box<i32>) { //~ HELP consider making this binding mutable
//~| SUGGESTION mut b
b = Box::new(2); //~ ERROR cannot assign to immutable argument `b`
//~| NOTE cannot assign to immutable argument
+ //~| NOTE in this expansion of desugaring of drop and replace
}
fn main() {}
diff --git a/tests/ui/borrowck/issue-45199.stderr b/tests/ui/borrowck/issue-45199.stderr
index 47aa30908..163f2370b 100644
--- a/tests/ui/borrowck/issue-45199.stderr
+++ b/tests/ui/borrowck/issue-45199.stderr
@@ -10,7 +10,7 @@ LL | b = Box::new(2);
| ^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `b`
- --> $DIR/issue-45199.rs:14:5
+ --> $DIR/issue-45199.rs:15:5
|
LL | let b = Box::new(1);
| -
@@ -22,7 +22,7 @@ LL | b = Box::new(2);
| ^ cannot assign twice to immutable variable
error[E0384]: cannot assign to immutable argument `b`
- --> $DIR/issue-45199.rs:20:5
+ --> $DIR/issue-45199.rs:22:5
|
LL | fn test_args(b: Box<i32>) {
| - help: consider making this binding mutable: `mut b`
diff --git a/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs b/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs
index efa313a9d..0b2372d12 100644
--- a/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs
+++ b/tests/ui/borrowck/issue-58776-borrowck-scans-children.rs
@@ -5,7 +5,6 @@ fn main() {
greeting = "DEALLOCATED".to_string();
//~^ ERROR cannot assign
drop(greeting);
- //~^ ERROR cannot move
println!("thread result: {:?}", res);
}
diff --git a/tests/ui/borrowck/issue-58776-borrowck-scans-children.stderr b/tests/ui/borrowck/issue-58776-borrowck-scans-children.stderr
index 0870b4237..967451c68 100644
--- a/tests/ui/borrowck/issue-58776-borrowck-scans-children.stderr
+++ b/tests/ui/borrowck/issue-58776-borrowck-scans-children.stderr
@@ -12,21 +12,6 @@ LL | greeting = "DEALLOCATED".to_string();
LL | println!("thread result: {:?}", res);
| --- borrow later used here
-error[E0505]: cannot move out of `greeting` because it is borrowed
- --> $DIR/issue-58776-borrowck-scans-children.rs:7:10
- |
-LL | let res = (|| (|| &greeting)())();
- | -- -------- borrow occurs due to use in closure
- | |
- | borrow of `greeting` occurs here
-...
-LL | drop(greeting);
- | ^^^^^^^^ move out of `greeting` occurs here
-...
-LL | println!("thread result: {:?}", res);
- | --- borrow later used here
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0505, E0506.
-For more information about an error, try `rustc --explain E0505`.
+For more information about this error, try `rustc --explain E0506`.
diff --git a/tests/ui/borrowck/issue-64453.stderr b/tests/ui/borrowck/issue-64453.stderr
index 245c3a40e..f032ea779 100644
--- a/tests/ui/borrowck/issue-64453.stderr
+++ b/tests/ui/borrowck/issue-64453.stderr
@@ -1,4 +1,4 @@
-error: `Arguments::<'a>::new_v1` is not yet stable as a const fn
+error: `Arguments::<'a>::new_const` is not yet stable as a const fn
--> $DIR/issue-64453.rs:4:31
|
LL | static settings_dir: String = format!("");
diff --git a/tests/ui/borrowck/issue-70919-drop-in-loop.rs b/tests/ui/borrowck/issue-70919-drop-in-loop.rs
new file mode 100644
index 000000000..a8d5849a3
--- /dev/null
+++ b/tests/ui/borrowck/issue-70919-drop-in-loop.rs
@@ -0,0 +1,25 @@
+// Regression test for issue #70919
+// Tests that we don't emit a spurious "borrow might be used" error
+// when we have an explicit `drop` in a loop
+
+// check-pass
+
+struct WrapperWithDrop<'a>(&'a mut bool);
+impl<'a> Drop for WrapperWithDrop<'a> {
+ fn drop(&mut self) {
+ }
+}
+
+fn drop_in_loop() {
+ let mut base = true;
+ let mut wrapper = WrapperWithDrop(&mut base);
+ loop {
+ drop(wrapper);
+
+ base = false;
+ wrapper = WrapperWithDrop(&mut base);
+ }
+}
+
+fn main() {
+}
diff --git a/tests/ui/borrowck/let_underscore_temporary.rs b/tests/ui/borrowck/let_underscore_temporary.rs
new file mode 100644
index 000000000..37b5c5d9d
--- /dev/null
+++ b/tests/ui/borrowck/let_underscore_temporary.rs
@@ -0,0 +1,27 @@
+// check-pass
+
+fn let_underscore(string: &Option<&str>, mut num: Option<i32>) {
+ let _ = if let Some(s) = *string { s.len() } else { 0 };
+ let _ = if let Some(s) = &num { s } else { &0 };
+ let _ = if let Some(s) = &mut num {
+ *s += 1;
+ s
+ } else {
+ &mut 0
+ };
+ let _ = if let Some(ref s) = num { s } else { &0 };
+ let _ = if let Some(mut s) = num {
+ s += 1;
+ s
+ } else {
+ 0
+ };
+ let _ = if let Some(ref mut s) = num {
+ *s += 1;
+ s
+ } else {
+ &mut 0
+ };
+}
+
+fn main() {}
diff --git a/tests/ui/expr-block-generic-unique1.rs b/tests/ui/box/unit/expr-block-generic-unique1.rs
index 14603a2c7..14603a2c7 100644
--- a/tests/ui/expr-block-generic-unique1.rs
+++ b/tests/ui/box/unit/expr-block-generic-unique1.rs
diff --git a/tests/ui/expr-block-generic-unique2.rs b/tests/ui/box/unit/expr-block-generic-unique2.rs
index 7879c144b..7879c144b 100644
--- a/tests/ui/expr-block-generic-unique2.rs
+++ b/tests/ui/box/unit/expr-block-generic-unique2.rs
diff --git a/tests/ui/expr-if-unique.rs b/tests/ui/box/unit/expr-if-unique.rs
index 862326835..862326835 100644
--- a/tests/ui/expr-if-unique.rs
+++ b/tests/ui/box/unit/expr-if-unique.rs
diff --git a/tests/ui/unique/unique-assign-copy.rs b/tests/ui/box/unit/unique-assign-copy.rs
index b742973ce..b742973ce 100644
--- a/tests/ui/unique/unique-assign-copy.rs
+++ b/tests/ui/box/unit/unique-assign-copy.rs
diff --git a/tests/ui/unique/unique-assign-drop.rs b/tests/ui/box/unit/unique-assign-drop.rs
index e7685b589..e7685b589 100644
--- a/tests/ui/unique/unique-assign-drop.rs
+++ b/tests/ui/box/unit/unique-assign-drop.rs
diff --git a/tests/ui/unique/unique-assign-generic.rs b/tests/ui/box/unit/unique-assign-generic.rs
index d4932d833..d4932d833 100644
--- a/tests/ui/unique/unique-assign-generic.rs
+++ b/tests/ui/box/unit/unique-assign-generic.rs
diff --git a/tests/ui/unique/unique-assign.rs b/tests/ui/box/unit/unique-assign.rs
index d598744f1..d598744f1 100644
--- a/tests/ui/unique/unique-assign.rs
+++ b/tests/ui/box/unit/unique-assign.rs
diff --git a/tests/ui/unique/unique-autoderef-field.rs b/tests/ui/box/unit/unique-autoderef-field.rs
index 64147e11f..64147e11f 100644
--- a/tests/ui/unique/unique-autoderef-field.rs
+++ b/tests/ui/box/unit/unique-autoderef-field.rs
diff --git a/tests/ui/unique/unique-autoderef-index.rs b/tests/ui/box/unit/unique-autoderef-index.rs
index ea6598a7f..ea6598a7f 100644
--- a/tests/ui/unique/unique-autoderef-index.rs
+++ b/tests/ui/box/unit/unique-autoderef-index.rs
diff --git a/tests/ui/unique/unique-cmp.rs b/tests/ui/box/unit/unique-cmp.rs
index ee05dd5a3..ee05dd5a3 100644
--- a/tests/ui/unique/unique-cmp.rs
+++ b/tests/ui/box/unit/unique-cmp.rs
diff --git a/tests/ui/unique/unique-containing-tag.rs b/tests/ui/box/unit/unique-containing-tag.rs
index 6c31ae99b..6c31ae99b 100644
--- a/tests/ui/unique/unique-containing-tag.rs
+++ b/tests/ui/box/unit/unique-containing-tag.rs
diff --git a/tests/ui/unique/unique-create.rs b/tests/ui/box/unit/unique-create.rs
index c566e7962..c566e7962 100644
--- a/tests/ui/unique/unique-create.rs
+++ b/tests/ui/box/unit/unique-create.rs
diff --git a/tests/ui/unique/unique-decl-init-copy.rs b/tests/ui/box/unit/unique-decl-init-copy.rs
index 5b9576fcc..5b9576fcc 100644
--- a/tests/ui/unique/unique-decl-init-copy.rs
+++ b/tests/ui/box/unit/unique-decl-init-copy.rs
diff --git a/tests/ui/unique/unique-decl-init.rs b/tests/ui/box/unit/unique-decl-init.rs
index 1d70860c7..1d70860c7 100644
--- a/tests/ui/unique/unique-decl-init.rs
+++ b/tests/ui/box/unit/unique-decl-init.rs
diff --git a/tests/ui/unique/unique-decl-move.rs b/tests/ui/box/unit/unique-decl-move.rs
index 21187510f..21187510f 100644
--- a/tests/ui/unique/unique-decl-move.rs
+++ b/tests/ui/box/unit/unique-decl-move.rs
diff --git a/tests/ui/unique/unique-decl.rs b/tests/ui/box/unit/unique-decl.rs
index 84a1b2a5b..84a1b2a5b 100644
--- a/tests/ui/unique/unique-decl.rs
+++ b/tests/ui/box/unit/unique-decl.rs
diff --git a/tests/ui/unique/unique-deref.rs b/tests/ui/box/unit/unique-deref.rs
index 33a1e9932..33a1e9932 100644
--- a/tests/ui/unique/unique-deref.rs
+++ b/tests/ui/box/unit/unique-deref.rs
diff --git a/tests/ui/unique/unique-destructure.rs b/tests/ui/box/unit/unique-destructure.rs
index 7207ac962..7207ac962 100644
--- a/tests/ui/unique/unique-destructure.rs
+++ b/tests/ui/box/unit/unique-destructure.rs
diff --git a/tests/ui/unique/unique-drop-complex.rs b/tests/ui/box/unit/unique-drop-complex.rs
index 2324f1e1a..2324f1e1a 100644
--- a/tests/ui/unique/unique-drop-complex.rs
+++ b/tests/ui/box/unit/unique-drop-complex.rs
diff --git a/tests/ui/unique/unique-ffi-symbols.rs b/tests/ui/box/unit/unique-ffi-symbols.rs
index 77b5ead26..77b5ead26 100644
--- a/tests/ui/unique/unique-ffi-symbols.rs
+++ b/tests/ui/box/unit/unique-ffi-symbols.rs
diff --git a/tests/ui/unique/unique-fn-arg-move.rs b/tests/ui/box/unit/unique-fn-arg-move.rs
index 6d42df218..6d42df218 100644
--- a/tests/ui/unique/unique-fn-arg-move.rs
+++ b/tests/ui/box/unit/unique-fn-arg-move.rs
diff --git a/tests/ui/unique/unique-fn-arg-mut.rs b/tests/ui/box/unit/unique-fn-arg-mut.rs
index 01510200b..01510200b 100644
--- a/tests/ui/unique/unique-fn-arg-mut.rs
+++ b/tests/ui/box/unit/unique-fn-arg-mut.rs
diff --git a/tests/ui/unique/unique-fn-arg.rs b/tests/ui/box/unit/unique-fn-arg.rs
index b4f3bc4b2..b4f3bc4b2 100644
--- a/tests/ui/unique/unique-fn-arg.rs
+++ b/tests/ui/box/unit/unique-fn-arg.rs
diff --git a/tests/ui/unique/unique-fn-ret.rs b/tests/ui/box/unit/unique-fn-ret.rs
index 773a9bce1..773a9bce1 100644
--- a/tests/ui/unique/unique-fn-ret.rs
+++ b/tests/ui/box/unit/unique-fn-ret.rs
diff --git a/tests/ui/unique/unique-generic-assign.rs b/tests/ui/box/unit/unique-generic-assign.rs
index 9c4405aa8..9c4405aa8 100644
--- a/tests/ui/unique/unique-generic-assign.rs
+++ b/tests/ui/box/unit/unique-generic-assign.rs
diff --git a/tests/ui/unique/unique-in-tag.rs b/tests/ui/box/unit/unique-in-tag.rs
index 6daa06fb1..6daa06fb1 100644
--- a/tests/ui/unique/unique-in-tag.rs
+++ b/tests/ui/box/unit/unique-in-tag.rs
diff --git a/tests/ui/unique/unique-in-vec-copy.rs b/tests/ui/box/unit/unique-in-vec-copy.rs
index ce52d15ef..ce52d15ef 100644
--- a/tests/ui/unique/unique-in-vec-copy.rs
+++ b/tests/ui/box/unit/unique-in-vec-copy.rs
diff --git a/tests/ui/unique/unique-in-vec.rs b/tests/ui/box/unit/unique-in-vec.rs
index 1e8d05e3d..1e8d05e3d 100644
--- a/tests/ui/unique/unique-in-vec.rs
+++ b/tests/ui/box/unit/unique-in-vec.rs
diff --git a/tests/ui/unique/unique-init.rs b/tests/ui/box/unit/unique-init.rs
index d19605046..d19605046 100644
--- a/tests/ui/unique/unique-init.rs
+++ b/tests/ui/box/unit/unique-init.rs
diff --git a/tests/ui/unique/unique-kinds.rs b/tests/ui/box/unit/unique-kinds.rs
index f02d0b507..f02d0b507 100644
--- a/tests/ui/unique/unique-kinds.rs
+++ b/tests/ui/box/unit/unique-kinds.rs
diff --git a/tests/ui/unique/unique-log.rs b/tests/ui/box/unit/unique-log.rs
index 0715d1662..0715d1662 100644
--- a/tests/ui/unique/unique-log.rs
+++ b/tests/ui/box/unit/unique-log.rs
diff --git a/tests/ui/unique/unique-match-discrim.rs b/tests/ui/box/unit/unique-match-discrim.rs
index 6e6d74322..6e6d74322 100644
--- a/tests/ui/unique/unique-match-discrim.rs
+++ b/tests/ui/box/unit/unique-match-discrim.rs
diff --git a/tests/ui/unique/unique-move-drop.rs b/tests/ui/box/unit/unique-move-drop.rs
index c0f5d8f90..c0f5d8f90 100644
--- a/tests/ui/unique/unique-move-drop.rs
+++ b/tests/ui/box/unit/unique-move-drop.rs
diff --git a/tests/ui/unique/unique-move-temp.rs b/tests/ui/box/unit/unique-move-temp.rs
index 103af8e1f..103af8e1f 100644
--- a/tests/ui/unique/unique-move-temp.rs
+++ b/tests/ui/box/unit/unique-move-temp.rs
diff --git a/tests/ui/unique/unique-move.rs b/tests/ui/box/unit/unique-move.rs
index 40a2718e4..40a2718e4 100644
--- a/tests/ui/unique/unique-move.rs
+++ b/tests/ui/box/unit/unique-move.rs
diff --git a/tests/ui/unique/unique-mutable.rs b/tests/ui/box/unit/unique-mutable.rs
index 0367c0809..0367c0809 100644
--- a/tests/ui/unique/unique-mutable.rs
+++ b/tests/ui/box/unit/unique-mutable.rs
diff --git a/tests/ui/unique/unique-object-move.rs b/tests/ui/box/unit/unique-object-move.rs
index bb35a9b2d..bb35a9b2d 100644
--- a/tests/ui/unique/unique-object-move.rs
+++ b/tests/ui/box/unit/unique-object-move.rs
diff --git a/tests/ui/unique-object-noncopyable.rs b/tests/ui/box/unit/unique-object-noncopyable.rs
index 2c40dfc7a..2c40dfc7a 100644
--- a/tests/ui/unique-object-noncopyable.rs
+++ b/tests/ui/box/unit/unique-object-noncopyable.rs
diff --git a/tests/ui/unique-object-noncopyable.stderr b/tests/ui/box/unit/unique-object-noncopyable.stderr
index db42ed9ba..db42ed9ba 100644
--- a/tests/ui/unique-object-noncopyable.stderr
+++ b/tests/ui/box/unit/unique-object-noncopyable.stderr
diff --git a/tests/ui/unique/unique-pat-2.rs b/tests/ui/box/unit/unique-pat-2.rs
index 9c73fd220..9c73fd220 100644
--- a/tests/ui/unique/unique-pat-2.rs
+++ b/tests/ui/box/unit/unique-pat-2.rs
diff --git a/tests/ui/unique/unique-pat-3.rs b/tests/ui/box/unit/unique-pat-3.rs
index 2e81f898d..2e81f898d 100644
--- a/tests/ui/unique/unique-pat-3.rs
+++ b/tests/ui/box/unit/unique-pat-3.rs
diff --git a/tests/ui/unique/unique-pat.rs b/tests/ui/box/unit/unique-pat.rs
index c2474d0e7..c2474d0e7 100644
--- a/tests/ui/unique/unique-pat.rs
+++ b/tests/ui/box/unit/unique-pat.rs
diff --git a/tests/ui/unique-pinned-nocopy.rs b/tests/ui/box/unit/unique-pinned-nocopy.rs
index 8edaeef51..8edaeef51 100644
--- a/tests/ui/unique-pinned-nocopy.rs
+++ b/tests/ui/box/unit/unique-pinned-nocopy.rs
diff --git a/tests/ui/unique-pinned-nocopy.stderr b/tests/ui/box/unit/unique-pinned-nocopy.stderr
index de6611324..2fd5b0d82 100644
--- a/tests/ui/unique-pinned-nocopy.stderr
+++ b/tests/ui/box/unit/unique-pinned-nocopy.stderr
@@ -19,7 +19,8 @@ LL | let _j = i.clone();
candidate #1: `Clone`
help: consider annotating `R` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct R {
|
error: aborting due to previous error
diff --git a/tests/ui/unique/unique-rec.rs b/tests/ui/box/unit/unique-rec.rs
index 9f8ad9bb0..9f8ad9bb0 100644
--- a/tests/ui/unique/unique-rec.rs
+++ b/tests/ui/box/unit/unique-rec.rs
diff --git a/tests/ui/unique/unique-send-2.rs b/tests/ui/box/unit/unique-send-2.rs
index 23ddd2cdc..23ddd2cdc 100644
--- a/tests/ui/unique/unique-send-2.rs
+++ b/tests/ui/box/unit/unique-send-2.rs
diff --git a/tests/ui/unique/unique-send.rs b/tests/ui/box/unit/unique-send.rs
index 431cc2be5..431cc2be5 100644
--- a/tests/ui/unique/unique-send.rs
+++ b/tests/ui/box/unit/unique-send.rs
diff --git a/tests/ui/unique/unique-swap.rs b/tests/ui/box/unit/unique-swap.rs
index 4f33ff9a8..4f33ff9a8 100644
--- a/tests/ui/unique/unique-swap.rs
+++ b/tests/ui/box/unit/unique-swap.rs
diff --git a/tests/ui/unwind-unique.rs b/tests/ui/box/unit/unwind-unique.rs
index 50ecf751a..50ecf751a 100644
--- a/tests/ui/unwind-unique.rs
+++ b/tests/ui/box/unit/unwind-unique.rs
diff --git a/tests/ui/cfg/auxiliary/cfg_false_lib.rs b/tests/ui/cfg/auxiliary/cfg_false_lib.rs
new file mode 100644
index 000000000..3c011d72b
--- /dev/null
+++ b/tests/ui/cfg/auxiliary/cfg_false_lib.rs
@@ -0,0 +1,6 @@
+// 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.
+
+#![cfg(FALSE)]
diff --git a/tests/ui/cfg/cfg-false-feature.rs b/tests/ui/cfg/cfg-false-feature.rs
new file mode 100644
index 000000000..21ea3ec79
--- /dev/null
+++ b/tests/ui/cfg/cfg-false-feature.rs
@@ -0,0 +1,20 @@
+// 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.
+
+// check-pass
+// compile-flags: --crate-type lib
+
+#![feature(decl_macro)]
+#![cfg(FALSE)]
+#![feature(box_syntax)]
+
+macro mac() {} //~ WARN `macro` is experimental
+ //~| WARN unstable syntax can change at any point in the future
+
+trait A = Clone; //~ WARN trait aliases are experimental
+ //~| WARN unstable syntax can change at any point in the future
+
+fn main() {
+ let box _ = Box::new(0); //~ WARN box pattern syntax is 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
new file mode 100644
index 000000000..14673fbdb
--- /dev/null
+++ b/tests/ui/cfg/cfg-false-feature.stderr
@@ -0,0 +1,35 @@
+warning: trait aliases are experimental
+ --> $DIR/cfg-false-feature.rs:14:1
+ |
+LL | trait A = Clone;
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #41517 <https://github.com/rust-lang/rust/issues/41517> for more information
+ = help: add `#![feature(trait_alias)]` 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: `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
+ |
+LL | let box _ = Box::new(0);
+ | ^^^^^
+ |
+ = note: see issue #29641 <https://github.com/rust-lang/rust/issues/29641> for more information
+ = help: add `#![feature(box_patterns)]` 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: 3 warnings emitted
+
diff --git a/tests/ui/cfg/cfg_false_no_std.rs b/tests/ui/cfg/cfg_false_no_std.rs
new file mode 100644
index 000000000..319ea0781
--- /dev/null
+++ b/tests/ui/cfg/cfg_false_no_std.rs
@@ -0,0 +1,11 @@
+// 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).
+
+// check-pass
+// aux-build: cfg_false_lib.rs
+
+#![no_std]
+
+extern crate cfg_false_lib as _;
+
+fn main() {}
diff --git a/tests/ui/chalkify/bugs/async.rs b/tests/ui/chalkify/bugs/async.rs
index 3169e4781..a1ef4732b 100644
--- a/tests/ui/chalkify/bugs/async.rs
+++ b/tests/ui/chalkify/bugs/async.rs
@@ -4,7 +4,7 @@
// compile-flags:-Z trait-solver=chalk
// error-pattern:internal compiler error
// failure-status:101
-// normalize-stderr-test "DefId([^)]*)" -> "..."
+// normalize-stderr-test "DefId\([^)]*\)" -> "..."
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
diff --git a/tests/ui/chalkify/bugs/async.stderr b/tests/ui/chalkify/bugs/async.stderr
index 8043f1e5a..36606fd49 100644
--- a/tests/ui/chalkify/bugs/async.stderr
+++ b/tests/ui/chalkify/bugs/async.stderr
@@ -1,34 +1,4 @@
error[E0277]: `[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
- --> $DIR/async.rs:23:29
- |
-LL | async fn foo(x: u32) -> u32 {
- | _____________________________-
-LL | | x
-LL | | }
- | | ^
- | | |
- | |_`[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
- | required by a bound introduced by this call
- |
- = 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
-note: required by a bound in `identity_future`
- --> $SRC_DIR/core/src/future/mod.rs:LL:COL
-
-error[E0277]: the size for values of type `<[async fn body@$DIR/async.rs:23:29: 25:2] as Future>::Output` cannot be known at compilation time
- --> $DIR/async.rs:23:29
- |
-LL | async fn foo(x: u32) -> u32 {
- | _____________________________^
-LL | | x
-LL | | }
- | |_^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `<[async fn body@$DIR/async.rs:23:29: 25:2] as Future>::Output`
-note: required by a bound in `identity_future`
- --> $SRC_DIR/core/src/future/mod.rs:LL:COL
-
-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 {
@@ -37,22 +7,23 @@ LL | async fn foo(x: u32) -> u32 {
= 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)`
+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 [mir_built] building MIR for `foo`
-#3 [unsafety_check_result] unsafety-checking `foo`
-#4 [mir_const] preparing `foo` for borrow checking
-#5 [mir_promoted] processing MIR for `foo`
-#6 [mir_borrowck] borrow-checking `foo`
-#7 [type_of] computing type of `foo::{opaque#0}`
-#8 [check_mod_item_types] checking item types in top-level module
-#9 [analysis] running analysis passes on this crate
+#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] processing 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 4 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/check-cfg/compact-values.stderr b/tests/ui/check-cfg/compact-values.stderr
index 9864aa385..5ca4d3b3d 100644
--- a/tests/ui/check-cfg/compact-values.stderr
+++ b/tests/ui/check-cfg/compact-values.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition value
LL | #[cfg(target(os = "linux", arch = "X"))]
| ^^^^^^^^^^
|
- = note: expected values for `target_arch` are: aarch64, arm, avr, bpf, hexagon, m68k, mips, mips64, msp430, nvptx64, powerpc, powerpc64, riscv32, riscv64, s390x, sparc, sparc64, wasm32, wasm64, x86, x86_64
+ = note: expected values for `target_arch` are: aarch64, arm, avr, bpf, hexagon, loongarch64, m68k, mips, mips64, msp430, nvptx64, powerpc, powerpc64, riscv32, riscv64, s390x, sparc, sparc64, wasm32, wasm64, x86, x86_64
= note: `#[warn(unexpected_cfgs)]` on by default
warning: 1 warning emitted
diff --git a/tests/ui/check-cfg/my-awesome-platform.json b/tests/ui/check-cfg/my-awesome-platform.json
new file mode 100644
index 000000000..5e9ab8f1a
--- /dev/null
+++ b/tests/ui/check-cfg/my-awesome-platform.json
@@ -0,0 +1,12 @@
+{
+ "llvm-target": "x86_64-unknown-none-gnu",
+ "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
+ "arch": "x86_64",
+ "target-endian": "little",
+ "target-pointer-width": "64",
+ "target-c-int-width": "32",
+ "os": "ericos",
+ "linker-flavor": "ld.lld",
+ "linker": "rust-lld",
+ "executables": true
+}
diff --git a/tests/ui/check-cfg/values-target-json.rs b/tests/ui/check-cfg/values-target-json.rs
new file mode 100644
index 000000000..2ef5a4459
--- /dev/null
+++ b/tests/ui/check-cfg/values-target-json.rs
@@ -0,0 +1,21 @@
+// This test checks that we don't lint values defined by a custom target (target json)
+//
+// check-pass
+// needs-llvm-components: x86
+// compile-flags: --crate-type=lib --check-cfg=values() --target={{src-base}}/check-cfg/my-awesome-platform.json -Z unstable-options
+
+#![feature(lang_items, no_core, auto_traits)]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+
+#[cfg(target_os = "linuz")]
+//~^ WARNING unexpected `cfg` condition value
+fn target_os_linux_misspell() {}
+
+#[cfg(target_os = "linux")]
+fn target_os_linux() {}
+
+#[cfg(target_os = "ericos")]
+fn target_os_ericos() {}
diff --git a/tests/ui/check-cfg/values-target-json.stderr b/tests/ui/check-cfg/values-target-json.stderr
new file mode 100644
index 000000000..b58d29707
--- /dev/null
+++ b/tests/ui/check-cfg/values-target-json.stderr
@@ -0,0 +1,13 @@
+warning: unexpected `cfg` condition value
+ --> $DIR/values-target-json.rs:13:7
+ |
+LL | #[cfg(target_os = "linuz")]
+ | ^^^^^^^^^^^^-------
+ | |
+ | help: did you mean: `"linux"`
+ |
+ = note: expected values for `target_os` are: aix, android, cuda, dragonfly, emscripten, ericos, espidf, freebsd, fuchsia, haiku, hermit, horizon, illumos, ios, l4re, linux, macos, netbsd, none, nto, openbsd, psp, redox, solaris, solid_asp3, tvos, uefi, unknown, vita, vxworks, wasi, watchos, windows, xous
+ = note: `#[warn(unexpected_cfgs)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/check-static-values-constraints.rs b/tests/ui/check-static-values-constraints.rs
index f6a577d0d..005a77988 100644
--- a/tests/ui/check-static-values-constraints.rs
+++ b/tests/ui/check-static-values-constraints.rs
@@ -1,7 +1,6 @@
// Verifies all possible restrictions for statics values.
#![allow(warnings)]
-#![feature(box_syntax)]
use std::marker;
@@ -19,7 +18,7 @@ enum SafeEnum {
Variant1,
Variant2(isize),
Variant3(WithDtor),
- Variant4(String)
+ Variant4(String),
}
// These should be ok
@@ -29,42 +28,45 @@ static STATIC3: SafeEnum = SafeEnum::Variant3(WithDtor);
enum UnsafeEnum {
Variant5,
- Variant6(isize)
+ Variant6(isize),
}
impl Drop for UnsafeEnum {
fn drop(&mut self) {}
}
-
static STATIC4: UnsafeEnum = UnsafeEnum::Variant5;
static STATIC5: UnsafeEnum = UnsafeEnum::Variant6(0);
-
struct SafeStruct {
field1: SafeEnum,
field2: SafeEnum,
}
-
// Struct fields are safe, hence this static should be safe
-static STATIC6: SafeStruct = SafeStruct{field1: SafeEnum::Variant1, field2: SafeEnum::Variant2(0)};
+static STATIC6: SafeStruct =
+ SafeStruct { field1: SafeEnum::Variant1, field2: SafeEnum::Variant2(0) };
-static STATIC7: SafeStruct = SafeStruct{field1: SafeEnum::Variant1,
- field2: SafeEnum::Variant3(WithDtor)};
+static STATIC7: SafeStruct =
+ SafeStruct { field1: SafeEnum::Variant1, field2: SafeEnum::Variant3(WithDtor) };
// Test variadic constructor for structs. The base struct should be examined
// as well as every field present in the constructor.
// This example shouldn't fail because all the fields are safe.
-static STATIC8: SafeStruct = SafeStruct{field1: SafeEnum::Variant1,
- ..SafeStruct{field1: SafeEnum::Variant1,
- field2: SafeEnum::Variant1}};
+static STATIC8: SafeStruct = SafeStruct {
+ field1: SafeEnum::Variant1,
+ ..SafeStruct { field1: SafeEnum::Variant1, field2: SafeEnum::Variant1 }
+};
// This example should fail because field1 in the base struct is not safe
-static STATIC9: SafeStruct = SafeStruct{field1: SafeEnum::Variant1,
- ..SafeStruct{field1: SafeEnum::Variant3(WithDtor),
-//~^ ERROR destructor of
- field2: SafeEnum::Variant1}};
+static STATIC9: SafeStruct = SafeStruct {
+ field1: SafeEnum::Variant1,
+ ..SafeStruct {
+ //~^ ERROR destructor of
+ field1: SafeEnum::Variant3(WithDtor),
+ field2: SafeEnum::Variant1,
+ }
+};
struct UnsafeStruct;
@@ -76,38 +78,45 @@ static STATIC10: UnsafeStruct = UnsafeStruct;
struct MyOwned;
-static STATIC11: Box<MyOwned> = box MyOwned;
+static STATIC11: Vec<MyOwned> = vec![MyOwned];
//~^ ERROR allocations are not allowed in statics
+//~^^ ERROR cannot call non-const
static mut STATIC12: UnsafeStruct = UnsafeStruct;
-static mut STATIC13: SafeStruct = SafeStruct{field1: SafeEnum::Variant1,
- field2: SafeEnum::Variant3(WithDtor)};
+static mut STATIC13: SafeStruct =
+ SafeStruct { field1: SafeEnum::Variant1, field2: SafeEnum::Variant3(WithDtor) };
static mut STATIC14: SafeStruct = SafeStruct {
field1: SafeEnum::Variant1,
- field2: SafeEnum::Variant4("str".to_string())
-//~^ ERROR cannot call non-const fn
+ field2: SafeEnum::Variant4("str".to_string()), //~ ERROR cannot call non-const fn
};
-static STATIC15: &'static [Box<MyOwned>] = &[
- box MyOwned, //~ ERROR allocations are not allowed in statics
- box MyOwned, //~ ERROR allocations are not allowed in statics
+static STATIC15: &'static [Vec<MyOwned>] = &[
+ vec![MyOwned], //~ ERROR allocations are not allowed in statics
+ //~^ ERROR cannot call non-const
+ vec![MyOwned], //~ ERROR allocations are not allowed in statics
+ //~^ ERROR cannot call non-const
];
-static STATIC16: (&'static Box<MyOwned>, &'static Box<MyOwned>) = (
- &box MyOwned, //~ ERROR allocations are not allowed in statics
- &box MyOwned, //~ ERROR allocations are not allowed in statics
+static STATIC16: (&'static Vec<MyOwned>, &'static Vec<MyOwned>) = (
+ &vec![MyOwned], //~ ERROR allocations are not allowed in statics
+ //~^ ERROR cannot call non-const
+ &vec![MyOwned], //~ ERROR allocations are not allowed in statics
+ //~^ ERROR cannot call non-const
);
static mut STATIC17: SafeEnum = SafeEnum::Variant1;
-static STATIC19: Box<isize> =
- box 3;
+static STATIC19: Vec<isize> = vec![3];
//~^ ERROR allocations are not allowed in statics
+//~^^ ERROR cannot call non-const
pub fn main() {
- let y = { static x: Box<isize> = box 3; x };
- //~^ ERROR allocations are not allowed in statics
- //~| ERROR cannot move out of static item
+ let y = {
+ static x: Vec<isize> = vec![3]; //~ ERROR allocations are not allowed in statics
+ //~^ ERROR cannot call non-const
+ x
+ //~^ ERROR cannot move out of static
+ };
}
diff --git a/tests/ui/check-static-values-constraints.stderr b/tests/ui/check-static-values-constraints.stderr
index 490566784..064eb4b8a 100644
--- a/tests/ui/check-static-values-constraints.stderr
+++ b/tests/ui/check-static-values-constraints.stderr
@@ -1,24 +1,38 @@
error[E0493]: destructor of `SafeStruct` cannot be evaluated at compile-time
- --> $DIR/check-static-values-constraints.rs:65:43
+ --> $DIR/check-static-values-constraints.rs:64:7
|
-LL | ..SafeStruct{field1: SafeEnum::Variant3(WithDtor),
- | ___________________________________________^
+LL | ..SafeStruct {
+ | _______^
LL | |
-LL | | field2: SafeEnum::Variant1}};
- | | ^- value is dropped here
- | |________________________________________________________________________________|
- | the destructor for this type cannot be evaluated in statics
+LL | | field1: SafeEnum::Variant3(WithDtor),
+LL | | field2: SafeEnum::Variant1,
+LL | | }
+ | |_____^ the destructor for this type cannot be evaluated in statics
+LL | };
+ | - value is dropped here
error[E0010]: allocations are not allowed in statics
- --> $DIR/check-static-values-constraints.rs:79:33
+ --> $DIR/check-static-values-constraints.rs:81:33
|
-LL | static STATIC11: Box<MyOwned> = box MyOwned;
- | ^^^^^^^^^^^ allocation not allowed in statics
+LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
+ | ^^^^^^^^^^^^^ allocation not allowed in statics
+ |
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+ --> $DIR/check-static-values-constraints.rs:81:33
+ |
+LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
+ | ^^^^^^^^^^^^^
+ |
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+ = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0015]: cannot call non-const fn `<str as ToString>::to_string` in statics
- --> $DIR/check-static-values-constraints.rs:89:38
+ --> $DIR/check-static-values-constraints.rs:92:38
|
-LL | field2: SafeEnum::Variant4("str".to_string())
+LL | field2: SafeEnum::Variant4("str".to_string()),
| ^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
@@ -26,53 +40,125 @@ LL | field2: SafeEnum::Variant4("str".to_string())
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
error[E0010]: allocations are not allowed in statics
- --> $DIR/check-static-values-constraints.rs:94:5
+ --> $DIR/check-static-values-constraints.rs:96:5
|
-LL | box MyOwned,
- | ^^^^^^^^^^^ allocation not allowed in statics
+LL | vec![MyOwned],
+ | ^^^^^^^^^^^^^ allocation not allowed in statics
+ |
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+ --> $DIR/check-static-values-constraints.rs:96:5
+ |
+LL | vec![MyOwned],
+ | ^^^^^^^^^^^^^
+ |
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+ = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0010]: allocations are not allowed in statics
- --> $DIR/check-static-values-constraints.rs:95:5
+ --> $DIR/check-static-values-constraints.rs:98:5
+ |
+LL | vec![MyOwned],
+ | ^^^^^^^^^^^^^ allocation not allowed in statics
+ |
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+ --> $DIR/check-static-values-constraints.rs:98:5
+ |
+LL | vec![MyOwned],
+ | ^^^^^^^^^^^^^
|
-LL | box MyOwned,
- | ^^^^^^^^^^^ allocation not allowed in statics
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+ = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0010]: allocations are not allowed in statics
- --> $DIR/check-static-values-constraints.rs:99:6
+ --> $DIR/check-static-values-constraints.rs:103:6
+ |
+LL | &vec![MyOwned],
+ | ^^^^^^^^^^^^^ allocation not allowed in statics
+ |
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+ --> $DIR/check-static-values-constraints.rs:103:6
|
-LL | &box MyOwned,
- | ^^^^^^^^^^^ allocation not allowed in statics
+LL | &vec![MyOwned],
+ | ^^^^^^^^^^^^^
+ |
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+ = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0010]: allocations are not allowed in statics
- --> $DIR/check-static-values-constraints.rs:100:6
+ --> $DIR/check-static-values-constraints.rs:105:6
|
-LL | &box MyOwned,
- | ^^^^^^^^^^^ allocation not allowed in statics
+LL | &vec![MyOwned],
+ | ^^^^^^^^^^^^^ allocation not allowed in statics
+ |
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
+ --> $DIR/check-static-values-constraints.rs:105:6
+ |
+LL | &vec![MyOwned],
+ | ^^^^^^^^^^^^^
+ |
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+ = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0010]: allocations are not allowed in statics
- --> $DIR/check-static-values-constraints.rs:106:5
+ --> $DIR/check-static-values-constraints.rs:111:31
|
-LL | box 3;
- | ^^^^^ allocation not allowed in statics
+LL | static STATIC19: Vec<isize> = vec![3];
+ | ^^^^^^^ allocation not allowed in statics
+ |
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
+ --> $DIR/check-static-values-constraints.rs:111:31
+ |
+LL | static STATIC19: Vec<isize> = vec![3];
+ | ^^^^^^^
+ |
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+ = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0507]: cannot move out of static item `x`
- --> $DIR/check-static-values-constraints.rs:110:45
+ --> $DIR/check-static-values-constraints.rs:119:9
|
-LL | let y = { static x: Box<isize> = box 3; x };
- | ^ move occurs because `x` has type `Box<isize>`, which does not implement the `Copy` trait
+LL | x
+ | ^ move occurs because `x` has type `Vec<isize>`, which does not implement the `Copy` trait
|
help: consider borrowing here
|
-LL | let y = { static x: Box<isize> = box 3; &x };
- | +
+LL | &x
+ | +
error[E0010]: allocations are not allowed in statics
- --> $DIR/check-static-values-constraints.rs:110:38
+ --> $DIR/check-static-values-constraints.rs:117:32
+ |
+LL | static x: Vec<isize> = vec![3];
+ | ^^^^^^^ allocation not allowed in statics
|
-LL | let y = { static x: Box<isize> = box 3; x };
- | ^^^^^ allocation not allowed in statics
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
+ --> $DIR/check-static-values-constraints.rs:117:32
+ |
+LL | static x: Vec<isize> = vec![3];
+ | ^^^^^^^
+ |
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+ = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 10 previous errors
+error: aborting due to 17 previous errors
Some errors have detailed explanations: E0010, E0015, E0493, E0507.
For more information about an error, try `rustc --explain E0010`.
diff --git a/tests/ui/closures/2229_closure_analysis/array_subslice.rs b/tests/ui/closures/2229_closure_analysis/array_subslice.rs
new file mode 100644
index 000000000..5f244ea89
--- /dev/null
+++ b/tests/ui/closures/2229_closure_analysis/array_subslice.rs
@@ -0,0 +1,13 @@
+// regression test for #109298
+// edition: 2021
+
+pub fn subslice_array(x: [u8; 3]) {
+ let f = || {
+ let [_x @ ..] = x;
+ let [ref y, ref mut z @ ..] = x; //~ ERROR cannot borrow `x[..]` as mutable
+ };
+
+ f(); //~ ERROR cannot borrow `f` as mutable
+}
+
+fn main() {}
diff --git a/tests/ui/closures/2229_closure_analysis/array_subslice.stderr b/tests/ui/closures/2229_closure_analysis/array_subslice.stderr
new file mode 100644
index 000000000..888c60d5e
--- /dev/null
+++ b/tests/ui/closures/2229_closure_analysis/array_subslice.stderr
@@ -0,0 +1,26 @@
+error[E0596]: cannot borrow `x[..]` as mutable, as `x` is not declared as mutable
+ --> $DIR/array_subslice.rs:7:21
+ |
+LL | pub fn subslice_array(x: [u8; 3]) {
+ | - help: consider changing this to be mutable: `mut x`
+...
+LL | let [ref y, ref mut z @ ..] = x;
+ | ^^^^^^^^^ cannot borrow as mutable
+
+error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
+ --> $DIR/array_subslice.rs:10:5
+ |
+LL | let [ref y, ref mut z @ ..] = x;
+ | - calling `f` requires mutable binding due to mutable borrow of `x`
+...
+LL | f();
+ | ^ cannot borrow as mutable
+ |
+help: consider changing this to be mutable
+ |
+LL | let mut f = || {
+ | +++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0596`.
diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs
new file mode 100644
index 000000000..f21ef43fb
--- /dev/null
+++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs
@@ -0,0 +1,18 @@
+// edition:2021
+
+// regression test for #112056
+
+fn extend_lifetime<'a, 'b>(x: &mut (&'a str,), y: &'b str) {
+ let mut closure = |input| x.0 = input;
+ //~^ ERROR: lifetime may not live long enough
+ closure(y);
+}
+
+fn main() {
+ let mut tuple = ("static",);
+ {
+ let x = String::from("temporary");
+ extend_lifetime(&mut tuple, &x);
+ }
+ println!("{}", tuple.0);
+}
diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.stderr b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.stderr
new file mode 100644
index 000000000..730823281
--- /dev/null
+++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.stderr
@@ -0,0 +1,14 @@
+error: lifetime may not live long enough
+ --> $DIR/unique-borrows-are-invariant-1.rs:6:31
+ |
+LL | fn extend_lifetime<'a, 'b>(x: &mut (&'a str,), y: &'b str) {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | let mut closure = |input| x.0 = input;
+ | ^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
+ |
+ = help: consider adding the following bound: `'b: 'a`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs
new file mode 100644
index 000000000..dd9d986c2
--- /dev/null
+++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs
@@ -0,0 +1,31 @@
+// edition:2021
+
+// regression test for #112056
+
+struct Spooky<'b> {
+ owned: Option<&'static u32>,
+ borrowed: &'b &'static u32,
+}
+
+impl<'b> Spooky<'b> {
+ fn create_self_reference<'a>(&'a mut self) {
+ let mut closure = || {
+ if let Some(owned) = &self.owned {
+ let borrow: &'a &'static u32 = owned;
+ self.borrowed = borrow;
+ //~^ ERROR: lifetime may not live long enough
+ }
+ };
+ closure();
+ }
+}
+
+fn main() {
+ let mut spooky: Spooky<'static> = Spooky {
+ owned: Some(&1),
+ borrowed: &&1,
+ };
+ spooky.create_self_reference();
+ spooky.owned = None;
+ println!("{}", **spooky.borrowed);
+}
diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.stderr b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.stderr
new file mode 100644
index 000000000..66ba0fe35
--- /dev/null
+++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.stderr
@@ -0,0 +1,15 @@
+error: lifetime may not live long enough
+ --> $DIR/unique-borrows-are-invariant-2.rs:15:17
+ |
+LL | impl<'b> Spooky<'b> {
+ | -- lifetime `'b` defined here
+LL | fn create_self_reference<'a>(&'a mut self) {
+ | -- lifetime `'a` defined here
+...
+LL | self.borrowed = borrow;
+ | ^^^^^^^^^^^^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`
+ |
+ = help: consider adding the following bound: `'a: 'b`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/closures/issue-109188.rs b/tests/ui/closures/issue-109188.rs
new file mode 100644
index 000000000..cae1ced99
--- /dev/null
+++ b/tests/ui/closures/issue-109188.rs
@@ -0,0 +1,22 @@
+enum Either {
+ One(X),
+ Two(X),
+}
+
+struct X(Y);
+
+struct Y;
+
+fn consume_fnmut(f: &dyn FnMut()) {
+ f();
+}
+
+fn move_into_fnmut() {
+ let x = move_into_fnmut();
+ consume_fnmut(&|| {
+ let Either::One(_t) = x; //~ ERROR mismatched types
+ let Either::Two(_t) = x; //~ ERROR mismatched types
+ });
+}
+
+fn main() { }
diff --git a/tests/ui/closures/issue-109188.stderr b/tests/ui/closures/issue-109188.stderr
new file mode 100644
index 000000000..d52b51629
--- /dev/null
+++ b/tests/ui/closures/issue-109188.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-109188.rs:17:13
+ |
+LL | let Either::One(_t) = x;
+ | ^^^^^^^^^^^^^^^ - this expression has type `()`
+ | |
+ | expected `()`, found `Either`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109188.rs:18:13
+ |
+LL | let Either::Two(_t) = x;
+ | ^^^^^^^^^^^^^^^ - this expression has type `()`
+ | |
+ | expected `()`, found `Either`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/closures/self-supertrait-bounds.rs b/tests/ui/closures/self-supertrait-bounds.rs
new file mode 100644
index 000000000..f4f1cea6b
--- /dev/null
+++ b/tests/ui/closures/self-supertrait-bounds.rs
@@ -0,0 +1,14 @@
+// check-pass
+
+// Makes sure that we only consider `Self` supertrait predicates while
+// elaborating during closure signature deduction.
+
+#![feature(trait_alias)]
+
+trait Confusing<F> = Fn(i32) where F: Fn(u32);
+
+fn alias<T: Confusing<F>, F>(_: T, _: F) {}
+
+fn main() {
+ alias(|_| {}, |_| {});
+}
diff --git a/tests/ui/codegen/mono-impossible-2.rs b/tests/ui/codegen/mono-impossible-2.rs
new file mode 100644
index 000000000..21eb2c9b2
--- /dev/null
+++ b/tests/ui/codegen/mono-impossible-2.rs
@@ -0,0 +1,19 @@
+//compile-flags: --crate-type=lib -Clink-dead-code=on
+// build-pass
+
+// Make sure that we don't monomorphize the impossible method `<() as Visit>::visit`,
+// which does not hold under a reveal-all param env.
+
+pub trait Visit {
+ fn visit() {}
+}
+
+pub trait Array {
+ type Element;
+}
+
+impl<'a> Visit for () where (): Array<Element = &'a ()> {}
+
+impl Array for () {
+ type Element = ();
+}
diff --git a/tests/ui/codegen/mono-impossible.rs b/tests/ui/codegen/mono-impossible.rs
new file mode 100644
index 000000000..1ea32ed2c
--- /dev/null
+++ b/tests/ui/codegen/mono-impossible.rs
@@ -0,0 +1,13 @@
+// compile-flags: -Clink-dead-code=on --crate-type=lib
+// build-pass
+
+// Make sure that we don't monomorphize the impossible method `<() as Visit>::visit`,
+// which does not hold under a reveal-all param env.
+
+pub trait Visit {
+ fn visit() {}
+}
+
+pub trait Array<'a> {}
+
+impl Visit for () where (): for<'a> Array<'a> {}
diff --git a/tests/ui/coercion/coerce-expect-unsized-ascribed.rs b/tests/ui/coercion/coerce-expect-unsized-ascribed.rs
index d7b11317a..43b0b375a 100644
--- a/tests/ui/coercion/coerce-expect-unsized-ascribed.rs
+++ b/tests/ui/coercion/coerce-expect-unsized-ascribed.rs
@@ -1,18 +1,19 @@
// A version of coerce-expect-unsized that uses type ascription.
// Doesn't work so far, but supposed to work eventually
-#![feature(box_syntax, type_ascription)]
+#![feature(type_ascription)]
use std::fmt::Debug;
pub fn main() {
- let _ = type_ascribe!(box { [1, 2, 3] }, Box<[i32]>); //~ ERROR mismatched types
- let _ = type_ascribe!(box if true { [1, 2, 3] } else { [1, 3, 4] }, Box<[i32]>); //~ ERROR mismatched types
- let _ = type_ascribe!(box match true { true => [1, 2, 3], false => [1, 3, 4] }, Box<[i32]>);
+ let _ = type_ascribe!(Box::new({ [1, 2, 3] }), Box<[i32]>); //~ ERROR mismatched types
+ let _ = type_ascribe!(Box::new( if true { [1, 2, 3] } else { [1, 3, 4] }), Box<[i32]>); //~ ERROR mismatched types
+ let _ = type_ascribe!(
+ Box::new( match true { true => [1, 2, 3], false => [1, 3, 4] }), Box<[i32]>);
//~^ ERROR mismatched types
- let _ = type_ascribe!(box { |x| (x as u8) }, Box<dyn Fn(i32) -> _>); //~ ERROR mismatched types
- let _ = type_ascribe!(box if true { false } else { true }, Box<dyn Debug>); //~ ERROR mismatched types
- let _ = type_ascribe!(box match true { true => 'a', false => 'b' }, Box<dyn Debug>); //~ ERROR mismatched types
+ let _ = type_ascribe!(Box::new( { |x| (x as u8) }), Box<dyn Fn(i32) -> _>); //~ ERROR mismatched types
+ let _ = type_ascribe!(Box::new( if true { false } else { true }), Box<dyn Debug>); //~ ERROR mismatched types
+ let _ = type_ascribe!(Box::new( match true { true => 'a', false => 'b' }), Box<dyn Debug>); //~ ERROR mismatched types
let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]); //~ ERROR mismatched types
let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]); //~ ERROR mismatched types
@@ -27,6 +28,6 @@ pub fn main() {
let _ = type_ascribe!(vec![
Box::new(|x| (x as u8)),
- box |x| (x as i16 as u8),
+ Box::new(|x| (x as i16 as u8)),
], Vec<Box<dyn Fn(i32) -> _>>);
}
diff --git a/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr b/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr
index f94422a92..aa5ec6b5a 100644
--- a/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr
+++ b/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr
@@ -1,8 +1,8 @@
error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:9:27
|
-LL | let _ = type_ascribe!(box { [1, 2, 3] }, Box<[i32]>);
- | ^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
+LL | let _ = type_ascribe!(Box::new({ [1, 2, 3] }), Box<[i32]>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
@@ -10,50 +10,50 @@ LL | let _ = type_ascribe!(box { [1, 2, 3] }, Box<[i32]>);
error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:10:27
|
-LL | let _ = type_ascribe!(box if true { [1, 2, 3] } else { [1, 3, 4] }, Box<[i32]>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
+LL | let _ = type_ascribe!(Box::new( if true { [1, 2, 3] } else { [1, 3, 4] }), Box<[i32]>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:11:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:12:9
|
-LL | let _ = type_ascribe!(box match true { true => [1, 2, 3], false => [1, 3, 4] }, Box<[i32]>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
+LL | Box::new( match true { true => [1, 2, 3], false => [1, 3, 4] }), Box<[i32]>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:13:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:14:27
|
-LL | let _ = type_ascribe!(box { |x| (x as u8) }, Box<dyn Fn(i32) -> _>);
- | ^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:13:33]>`
+LL | let _ = type_ascribe!(Box::new( { |x| (x as u8) }), Box<dyn Fn(i32) -> _>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:14:39]>`
|
= note: expected struct `Box<dyn Fn(i32) -> u8>`
- found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:33: 13:36]>`
+ found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:14:39: 14:42]>`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:14:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:15:27
|
-LL | let _ = type_ascribe!(box if true { false } else { true }, Box<dyn Debug>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<bool>`
+LL | let _ = type_ascribe!(Box::new( if true { false } else { true }), Box<dyn Debug>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<bool>`
|
= note: expected struct `Box<dyn Debug>`
found struct `Box<bool>`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:15:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:16:27
|
-LL | let _ = type_ascribe!(box match true { true => 'a', false => 'b' }, Box<dyn Debug>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<char>`
+LL | let _ = type_ascribe!(Box::new( match true { true => 'a', false => 'b' }), Box<dyn Debug>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<char>`
|
= note: expected struct `Box<dyn Debug>`
found struct `Box<char>`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:17:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:18:27
|
LL | let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]);
| ^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
@@ -62,7 +62,7 @@ LL | let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]);
found reference `&[i32; 3]`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:18:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:19:27
|
LL | let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
@@ -71,7 +71,7 @@ LL | let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]
found reference `&[i32; 3]`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:19:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:20:27
|
LL | let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3, 4] }, &[i32]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
@@ -80,16 +80,16 @@ LL | let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3,
found reference `&[i32; 3]`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:21:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:22:27
|
LL | let _ = type_ascribe!(&{ |x| (x as u8) }, &dyn Fn(i32) -> _);
- | ^^^^^^^^^^^^^^^^^^ expected `&dyn Fn(i32) -> u8`, found `&[closure@coerce-expect-unsized-ascribed.rs:21:30]`
+ | ^^^^^^^^^^^^^^^^^^ expected `&dyn Fn(i32) -> u8`, found `&[closure@coerce-expect-unsized-ascribed.rs:22:30]`
|
= note: expected reference `&dyn Fn(i32) -> u8`
- found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:30: 21:33]`
+ found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:22:30: 22:33]`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:22:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:23:27
|
LL | let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&bool`
@@ -98,7 +98,7 @@ LL | let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug);
found reference `&bool`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:23:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:24:27
|
LL | let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn Debug);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&char`
@@ -107,7 +107,7 @@ LL | let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn D
found reference `&char`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:25:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:26:27
|
LL | let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>);
| ^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
@@ -116,13 +116,13 @@ LL | let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>);
found struct `Box<[i32; 3]>`
error[E0308]: mismatched types
- --> $DIR/coerce-expect-unsized-ascribed.rs:26:27
+ --> $DIR/coerce-expect-unsized-ascribed.rs:27:27
|
LL | let _ = type_ascribe!(Box::new(|x| (x as u8)), Box<dyn Fn(i32) -> _>);
- | ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:26:36]>`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:27:36]>`
|
= note: expected struct `Box<dyn Fn(i32) -> u8>`
- found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:36: 26:39]>`
+ found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:27:36: 27:39]>`
error: aborting due to 14 previous errors
diff --git a/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs b/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs
index 24b878927..76a57936e 100644
--- a/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs
+++ b/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs
@@ -13,5 +13,7 @@ impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR found both positive and nega
unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
impl !Send for TestType<i32> {}
+//~^ WARNING
+//~| WARNING this will change its meaning
fn main() {}
diff --git a/tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr b/tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
index 2463f38a9..020199da9 100644
--- a/tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
+++ b/tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
@@ -16,7 +16,23 @@ LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
LL | unsafe impl<T: 'static> Send for TestType<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
-error: aborting due to 2 previous errors
+warning: cross-crate traits with a default impl, like `Send`, should not be specialized
+ --> $DIR/coherence-conflicting-negative-trait-impl.rs:15:1
+ |
+LL | impl !Send for TestType<i32> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this will change its meaning in a future release!
+ = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
+ = note: `i32` is not a generic parameter
+note: try using the same sequence of generic parameters as the struct definition
+ --> $DIR/coherence-conflicting-negative-trait-impl.rs:7:1
+ |
+LL | struct TestType<T>(::std::marker::PhantomData<T>);
+ | ^^^^^^^^^^^^^^^^^^
+ = note: `#[warn(suspicious_auto_trait_impls)]` on by default
+
+error: aborting due to 2 previous errors; 1 warning emitted
Some errors have detailed explanations: E0119, E0751.
For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/coherence/coherence-impls-copy.stderr b/tests/ui/coherence/coherence-impls-copy.stderr
index d40ffc48a..21dbc6063 100644
--- a/tests/ui/coherence/coherence-impls-copy.stderr
+++ b/tests/ui/coherence/coherence-impls-copy.stderr
@@ -52,19 +52,19 @@ LL | impl Copy for [MyType] {}
|
= note: define and implement a trait or new type instead
-error[E0206]: the trait `Copy` may not be implemented for this type
+error[E0206]: the trait `Copy` cannot be implemented for this type
--> $DIR/coherence-impls-copy.rs:21:15
|
LL | impl Copy for &'static mut MyType {}
| ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
-error[E0206]: the trait `Copy` may not be implemented for this type
+error[E0206]: the trait `Copy` cannot be implemented for this type
--> $DIR/coherence-impls-copy.rs:25:15
|
LL | impl Copy for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
-error[E0206]: the trait `Copy` may not be implemented for this type
+error[E0206]: the trait `Copy` cannot be implemented for this type
--> $DIR/coherence-impls-copy.rs:30:15
|
LL | impl Copy for [MyType] {}
diff --git a/tests/ui/coherence/coherence-orphan.rs b/tests/ui/coherence/coherence-orphan.rs
index 3beac04c7..bed782203 100644
--- a/tests/ui/coherence/coherence-orphan.rs
+++ b/tests/ui/coherence/coherence-orphan.rs
@@ -14,7 +14,8 @@ impl TheTrait<TheType> for isize { }
impl TheTrait<isize> for TheType { }
-impl !Send for Vec<isize> { }
-//~^ ERROR E0117
+impl !Send for Vec<isize> { } //~ ERROR E0117
+//~^ WARNING
+//~| WARNING this will change its meaning
fn main() { }
diff --git a/tests/ui/coherence/coherence-orphan.stderr b/tests/ui/coherence/coherence-orphan.stderr
index 01f166a21..9ec1d0dc3 100644
--- a/tests/ui/coherence/coherence-orphan.stderr
+++ b/tests/ui/coherence/coherence-orphan.stderr
@@ -21,6 +21,19 @@ LL | impl !Send for Vec<isize> { }
|
= note: define and implement a trait or new type instead
-error: aborting due to 2 previous errors
+warning: cross-crate traits with a default impl, like `Send`, should not be specialized
+ --> $DIR/coherence-orphan.rs:17:1
+ |
+LL | impl !Send for Vec<isize> { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this will change its meaning in a future release!
+ = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
+ = note: `isize` is not a generic parameter
+note: try using the same sequence of generic parameters as the struct definition
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ = note: `#[warn(suspicious_auto_trait_impls)]` on by default
+
+error: aborting due to 2 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0117`.
diff --git a/tests/ui/coherence/coherence_inherent.stderr b/tests/ui/coherence/coherence_inherent.stderr
index 46b128c08..b381b0680 100644
--- a/tests/ui/coherence/coherence_inherent.stderr
+++ b/tests/ui/coherence/coherence_inherent.stderr
@@ -7,7 +7,7 @@ LL | s.the_fn();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use Lib::TheTrait;
+LL + use Lib::TheTrait;
|
error: aborting due to previous error
diff --git a/tests/ui/coherence/coherence_inherent_cc.stderr b/tests/ui/coherence/coherence_inherent_cc.stderr
index af0ef3b69..7b6cb7d43 100644
--- a/tests/ui/coherence/coherence_inherent_cc.stderr
+++ b/tests/ui/coherence/coherence_inherent_cc.stderr
@@ -7,7 +7,7 @@ LL | s.the_fn();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use coherence_inherent_cc_lib::TheTrait;
+LL + use coherence_inherent_cc_lib::TheTrait;
|
error: aborting due to previous error
diff --git a/tests/ui/coherence/deep-bad-copy-reason.rs b/tests/ui/coherence/deep-bad-copy-reason.rs
index 80bbe387a..97fd3f719 100644
--- a/tests/ui/coherence/deep-bad-copy-reason.rs
+++ b/tests/ui/coherence/deep-bad-copy-reason.rs
@@ -31,7 +31,7 @@ impl<'tcx, T> Clone for List<'tcx, T> {
}
impl<'tcx, T> Copy for List<'tcx, T> {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
fn assert_is_copy<T: Copy>() {}
diff --git a/tests/ui/coherence/deep-bad-copy-reason.stderr b/tests/ui/coherence/deep-bad-copy-reason.stderr
index 168ee5726..7b6dd4b38 100644
--- a/tests/ui/coherence/deep-bad-copy-reason.stderr
+++ b/tests/ui/coherence/deep-bad-copy-reason.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/deep-bad-copy-reason.rs:33:24
|
LL | pub struct List<'tcx, T>(Interned<'tcx, ListS<T>>);
diff --git a/tests/ui/coherence/illegal-copy-bad-projection.rs b/tests/ui/coherence/illegal-copy-bad-projection.rs
new file mode 100644
index 000000000..797443a0a
--- /dev/null
+++ b/tests/ui/coherence/illegal-copy-bad-projection.rs
@@ -0,0 +1,16 @@
+trait AsPtr {
+ type Ptr;
+}
+
+impl AsPtr for () {
+ type Ptr = *const void;
+ //~^ ERROR cannot find type `void` in this scope
+}
+
+#[derive(Copy, Clone)]
+struct Foo {
+ p: <() as AsPtr>::Ptr,
+ // Do not report a "`Copy` cannot be implemented" here.
+}
+
+fn main() {}
diff --git a/tests/ui/coherence/illegal-copy-bad-projection.stderr b/tests/ui/coherence/illegal-copy-bad-projection.stderr
new file mode 100644
index 000000000..8fed9ba23
--- /dev/null
+++ b/tests/ui/coherence/illegal-copy-bad-projection.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `void` in this scope
+ --> $DIR/illegal-copy-bad-projection.rs:6:23
+ |
+LL | type Ptr = *const void;
+ | ^^^^ 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/command/command-exec.rs b/tests/ui/command/command-exec.rs
index 032dad184..edc33446d 100644
--- a/tests/ui/command/command-exec.rs
+++ b/tests/ui/command/command-exec.rs
@@ -2,7 +2,6 @@
#![allow(stable_features)]
// ignore-windows - this is a unix-specific test
-// ignore-pretty issue #37199
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-fuchsia no execvp syscall provided
diff --git a/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr b/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr
index fbfcd4565..123ce7172 100644
--- a/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr
+++ b/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr
@@ -35,6 +35,10 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = MustUseDeprecated::new();
+ | +++++++
warning: 5 warnings emitted
diff --git a/tests/ui/const-generics/bad-generic-in-copy-impl.rs b/tests/ui/const-generics/bad-generic-in-copy-impl.rs
new file mode 100644
index 000000000..b5663464c
--- /dev/null
+++ b/tests/ui/const-generics/bad-generic-in-copy-impl.rs
@@ -0,0 +1,9 @@
+#[derive(Copy, Clone)]
+pub struct Foo {
+ x: [u8; SIZE],
+ //~^ ERROR mismatched types
+}
+
+const SIZE: u32 = 1;
+
+fn main() {}
diff --git a/tests/ui/const-generics/bad-generic-in-copy-impl.stderr b/tests/ui/const-generics/bad-generic-in-copy-impl.stderr
new file mode 100644
index 000000000..25701ce68
--- /dev/null
+++ b/tests/ui/const-generics/bad-generic-in-copy-impl.stderr
@@ -0,0 +1,9 @@
+error[E0308]: mismatched types
+ --> $DIR/bad-generic-in-copy-impl.rs:3:13
+ |
+LL | x: [u8; SIZE],
+ | ^^^^ expected `usize`, found `u32`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/const-generics/bad-subst-const-kind.rs b/tests/ui/const-generics/bad-subst-const-kind.rs
new file mode 100644
index 000000000..e13dfbacd
--- /dev/null
+++ b/tests/ui/const-generics/bad-subst-const-kind.rs
@@ -0,0 +1,13 @@
+// incremental
+#![crate_type = "lib"]
+
+trait Q {
+ const ASSOC: usize;
+}
+
+impl<const N: u64> Q for [u8; N] {
+ //~^ ERROR mismatched types
+ const ASSOC: usize = 1;
+}
+
+pub fn test() -> [u8; <[u8; 13] as Q>::ASSOC] { todo!() }
diff --git a/tests/ui/const-generics/bad-subst-const-kind.stderr b/tests/ui/const-generics/bad-subst-const-kind.stderr
new file mode 100644
index 000000000..bd24f9140
--- /dev/null
+++ b/tests/ui/const-generics/bad-subst-const-kind.stderr
@@ -0,0 +1,9 @@
+error[E0308]: mismatched types
+ --> $DIR/bad-subst-const-kind.rs:8:31
+ |
+LL | impl<const N: u64> Q for [u8; N] {
+ | ^ expected `usize`, found `u64`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/const-generics/const-arg-in-const-arg.full.stderr b/tests/ui/const-generics/const-arg-in-const-arg.full.stderr
index 8672e79b3..463a37d7e 100644
--- a/tests/ui/const-generics/const-arg-in-const-arg.full.stderr
+++ b/tests/ui/const-generics/const-arg-in-const-arg.full.stderr
@@ -1,4 +1,4 @@
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:18:23
|
LL | let _: [u8; faz::<'a>(&())];
@@ -10,7 +10,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:21:23
|
LL | let _: [u8; faz::<'b>(&())];
@@ -22,7 +22,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:41:24
|
LL | let _: Foo<{ faz::<'a>(&()) }>;
@@ -34,7 +34,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:44:24
|
LL | let _: Foo<{ faz::<'b>(&()) }>;
@@ -94,7 +94,7 @@ LL | let _ = [0; bar::<N>()];
|
= help: try adding a `where` bound using this expression: `where [(); bar::<N>()]:`
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:30:23
|
LL | let _ = [0; faz::<'a>(&())];
@@ -106,7 +106,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:33:23
|
LL | let _ = [0; faz::<'b>(&())];
@@ -134,7 +134,7 @@ LL | let _ = Foo::<{ bar::<N>() }>;
|
= help: try adding a `where` bound using this expression: `where [(); { bar::<N>() }]:`
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:52:27
|
LL | let _ = Foo::<{ faz::<'a>(&()) }>;
@@ -146,7 +146,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:55:27
|
LL | let _ = Foo::<{ faz::<'b>(&()) }>;
@@ -160,3 +160,4 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
error: aborting due to 16 previous errors
+For more information about this error, try `rustc --explain E0794`.
diff --git a/tests/ui/const-generics/const-arg-in-const-arg.min.stderr b/tests/ui/const-generics/const-arg-in-const-arg.min.stderr
index f1353aa99..a7bd9c62b 100644
--- a/tests/ui/const-generics/const-arg-in-const-arg.min.stderr
+++ b/tests/ui/const-generics/const-arg-in-const-arg.min.stderr
@@ -216,7 +216,7 @@ help: if this generic argument was intended as a const parameter, surround it wi
LL | let _: [u8; bar::<{ N }>()];
| + +
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:18:23
|
LL | let _: [u8; faz::<'a>(&())];
@@ -228,7 +228,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:21:23
|
LL | let _: [u8; faz::<'b>(&())];
@@ -251,7 +251,7 @@ help: if this generic argument was intended as a const parameter, surround it wi
LL | let _: Foo<{ bar::<{ N }>() }>;
| + +
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:41:24
|
LL | let _: Foo<{ faz::<'a>(&()) }>;
@@ -263,7 +263,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:44:24
|
LL | let _: Foo<{ faz::<'b>(&()) }>;
@@ -294,7 +294,7 @@ help: if this generic argument was intended as a const parameter, surround it wi
LL | let _ = [0; bar::<{ N }>()];
| + +
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:30:23
|
LL | let _ = [0; faz::<'a>(&())];
@@ -306,7 +306,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:33:23
|
LL | let _ = [0; faz::<'b>(&())];
@@ -329,7 +329,7 @@ help: if this generic argument was intended as a const parameter, surround it wi
LL | let _ = Foo::<{ bar::<{ N }>() }>;
| + +
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:52:27
|
LL | let _ = Foo::<{ faz::<'a>(&()) }>;
@@ -341,7 +341,7 @@ note: the late bound lifetime parameter is introduced here
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/const-arg-in-const-arg.rs:55:27
|
LL | let _ = Foo::<{ faz::<'b>(&()) }>;
@@ -355,5 +355,5 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
error: aborting due to 36 previous errors
-Some errors have detailed explanations: E0658, E0747.
+Some errors have detailed explanations: E0658, E0747, E0794.
For more information about an error, try `rustc --explain E0658`.
diff --git a/tests/ui/const-generics/defaults/doesnt_infer.stderr b/tests/ui/const-generics/defaults/doesnt_infer.stderr
index 227b2f402..a61411d6e 100644
--- a/tests/ui/const-generics/defaults/doesnt_infer.stderr
+++ b/tests/ui/const-generics/defaults/doesnt_infer.stderr
@@ -4,7 +4,7 @@ error[E0282]: type annotations needed for `Foo<N>`
LL | let foo = Foo::foo();
| ^^^
|
-help: consider giving `foo` an explicit type, where the the value of const parameter `N` is specified
+help: consider giving `foo` an explicit type, where the value of const parameter `N` is specified
|
LL | let foo: Foo<N> = Foo::foo();
| ++++++++
diff --git a/tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr b/tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr
index 7b4d46b82..6b3396a25 100644
--- a/tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr
@@ -1,8 +1,8 @@
error: unconstrained generic constant
- --> $DIR/cross_crate_predicate.rs:7:13
+ --> $DIR/cross_crate_predicate.rs:7:44
|
LL | let _ = const_evaluatable_lib::test1::<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^
|
= help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
note: required by a bound in `test1`
@@ -12,10 +12,10 @@ LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1`
error: unconstrained generic constant
- --> $DIR/cross_crate_predicate.rs:7:13
+ --> $DIR/cross_crate_predicate.rs:7:44
|
LL | let _ = const_evaluatable_lib::test1::<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^
|
= help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
note: required by a bound in `test1`
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-94287.stderr b/tests/ui/const-generics/generic_const_exprs/issue-94287.stderr
index 7390a0077..dc7d0c54f 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-94287.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-94287.stderr
@@ -8,7 +8,7 @@ LL | If<{ FRAC <= 32 }>: True,
help: consider enabling this feature
--> $DIR/issue-94287.rs:1:1
|
-LL | #![feature(generic_const_exprs)]
+LL + #![feature(generic_const_exprs)]
|
error: aborting due to previous error
diff --git a/tests/ui/const-generics/generic_const_exprs/mismatched-gat-subst-kind.rs b/tests/ui/const-generics/generic_const_exprs/mismatched-gat-subst-kind.rs
new file mode 100644
index 000000000..734a37862
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/mismatched-gat-subst-kind.rs
@@ -0,0 +1,11 @@
+#![feature(generic_const_exprs)]
+//~^ WARN the feature `generic_const_exprs` is incomplete
+
+trait B {
+ type U<T>;
+}
+
+fn f<T: B<U<1i32> = ()>>() {}
+//~^ ERROR constant provided when a type was expected
+
+fn main() {}
diff --git a/tests/ui/const-generics/generic_const_exprs/mismatched-gat-subst-kind.stderr b/tests/ui/const-generics/generic_const_exprs/mismatched-gat-subst-kind.stderr
new file mode 100644
index 000000000..8b6eb5b75
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/mismatched-gat-subst-kind.stderr
@@ -0,0 +1,18 @@
+warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/mismatched-gat-subst-kind.rs:1:12
+ |
+LL | #![feature(generic_const_exprs)]
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0747]: constant provided when a type was expected
+ --> $DIR/mismatched-gat-subst-kind.rs:8:13
+ |
+LL | fn f<T: B<U<1i32> = ()>>() {}
+ | ^^^^
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0747`.
diff --git a/tests/ui/const-generics/generic_const_exprs/typeid-equality-by-subtyping.rs b/tests/ui/const-generics/generic_const_exprs/typeid-equality-by-subtyping.rs
new file mode 100644
index 000000000..85345d65c
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/typeid-equality-by-subtyping.rs
@@ -0,0 +1,52 @@
+// check-pass
+// known-bug: #97156
+
+#![feature(const_type_id, generic_const_exprs)]
+#![allow(incomplete_features)]
+
+use std::any::TypeId;
+// `One` and `Two` are currently considered equal types, as both
+// `One <: Two` and `One :> Two` holds.
+type One = for<'a> fn(&'a (), &'a ());
+type Two = for<'a, 'b> fn(&'a (), &'b ());
+trait AssocCt {
+ const ASSOC: usize;
+}
+const fn to_usize<T: 'static>() -> usize {
+ const WHAT_A_TYPE: TypeId = TypeId::of::<One>();
+ match TypeId::of::<T>() {
+ WHAT_A_TYPE => 0,
+ _ => 1000,
+ }
+}
+impl<T: 'static> AssocCt for T {
+ const ASSOC: usize = to_usize::<T>();
+}
+
+trait WithAssoc<U> {
+ type Assoc;
+}
+impl<T: 'static> WithAssoc<()> for T where [(); <T as AssocCt>::ASSOC]: {
+ type Assoc = [u8; <T as AssocCt>::ASSOC];
+}
+
+fn generic<T: 'static, U>(x: <T as WithAssoc<U>>::Assoc) -> <T as WithAssoc<U>>::Assoc
+where
+ [(); <T as AssocCt>::ASSOC]:,
+ T: WithAssoc<U>,
+{
+ x
+}
+
+
+fn unsound<T>(x: <One as WithAssoc<T>>::Assoc) -> <Two as WithAssoc<T>>::Assoc
+where
+ One: WithAssoc<T>,
+{
+ let x: <Two as WithAssoc<T>>::Assoc = generic::<One, T>(x);
+ x
+}
+
+fn main() {
+ println!("{:?}", unsound::<()>([]));
+}
diff --git a/tests/ui/const-generics/issue-93647.rs b/tests/ui/const-generics/issue-93647.rs
index 806540e17..a0083a0c6 100644
--- a/tests/ui/const-generics/issue-93647.rs
+++ b/tests/ui/const-generics/issue-93647.rs
@@ -1,6 +1,7 @@
struct X<const N: usize = {
(||1usize)()
//~^ ERROR cannot call non-const closure
+ //~| ERROR the trait bound
}>;
fn main() {}
diff --git a/tests/ui/const-generics/issue-93647.stderr b/tests/ui/const-generics/issue-93647.stderr
index 18370eea5..20a6af5c5 100644
--- a/tests/ui/const-generics/issue-93647.stderr
+++ b/tests/ui/const-generics/issue-93647.stderr
@@ -1,3 +1,17 @@
+error[E0277]: the trait bound `[closure@$DIR/issue-93647.rs:2:6: 2:8]: Fn<()>` is not satisfied
+ --> $DIR/issue-93647.rs:2:5
+ |
+LL | (||1usize)()
+ | ^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-93647.rs:2:6: 2:8]`
+ |
+ = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-93647.rs:2:6: 2:8]`
+note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-93647.rs:2:6: 2:8]`, but that implementation is not `const`
+ --> $DIR/issue-93647.rs:2:5
+ |
+LL | (||1usize)()
+ | ^^^^^^^^^^^^
+ = note: wrap the `[closure@$DIR/issue-93647.rs:2:6: 2:8]` in a closure with no arguments: `|| { /* code */ }`
+
error[E0015]: cannot call non-const closure in constants
--> $DIR/issue-93647.rs:2:5
|
@@ -8,6 +22,7 @@ LL | (||1usize)()
= note: calls in constants 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
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/const-generics/issues/issue-82956.stderr b/tests/ui/const-generics/issues/issue-82956.stderr
index d2320293e..d70c8d0bf 100644
--- a/tests/ui/const-generics/issues/issue-82956.stderr
+++ b/tests/ui/const-generics/issues/issue-82956.stderr
@@ -6,13 +6,13 @@ LL | let mut iter = IntoIter::new(self);
|
help: consider importing one of these items
|
-LL | use std::array::IntoIter;
+LL + use std::array::IntoIter;
|
-LL | use std::collections::binary_heap::IntoIter;
+LL + use std::collections::binary_heap::IntoIter;
|
-LL | use std::collections::btree_map::IntoIter;
+LL + use std::collections::btree_map::IntoIter;
|
-LL | use std::collections::btree_set::IntoIter;
+LL + use std::collections::btree_set::IntoIter;
|
and 8 other candidates
diff --git a/tests/ui/const-generics/transmute-fail.rs b/tests/ui/const-generics/transmute-fail.rs
new file mode 100644
index 000000000..d7bf1b47f
--- /dev/null
+++ b/tests/ui/const-generics/transmute-fail.rs
@@ -0,0 +1,35 @@
+#![feature(transmute_generic_consts)]
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+fn foo<const W: usize, const H: usize>(v: [[u32;H+1]; W]) -> [[u32; W+1]; H] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
+ //~^ ERROR mismatched types
+ //~| ERROR mismatched types
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute between types
+ }
+}
+
+fn baz<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [u32; W * H * H] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn overflow(v: [[[u32; 8888888]; 9999999]; 777777777]) -> [[[u32; 9999999]; 777777777]; 8888888] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/const-generics/transmute-fail.stderr b/tests/ui/const-generics/transmute-fail.stderr
new file mode 100644
index 000000000..41b098135
--- /dev/null
+++ b/tests/ui/const-generics/transmute-fail.stderr
@@ -0,0 +1,52 @@
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute-fail.rs:7:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[u32; H+1]; W]` (generic size [const expr])
+ = note: target type: `[[u32; W+1]; H]` (generic size [const expr])
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute-fail.rs:16:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[u32; H]; W]` (this type does not have a fixed size)
+ = note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])
+
+error[E0308]: mismatched types
+ --> $DIR/transmute-fail.rs:12:53
+ |
+LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
+ | ^ expected `usize`, found `bool`
+
+error[E0308]: mismatched types
+ --> $DIR/transmute-fail.rs:12:67
+ |
+LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
+ | ^ expected `usize`, found `bool`
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute-fail.rs:23:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[u32; H]; W]` (generic size [const expr])
+ = note: target type: `[u32; W * H * H]` (generic size [const expr])
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute-fail.rs:30:5
+ |
+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)
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0308, E0512.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/const-generics/transmute.rs b/tests/ui/const-generics/transmute.rs
new file mode 100644
index 000000000..30560a95b
--- /dev/null
+++ b/tests/ui/const-generics/transmute.rs
@@ -0,0 +1,83 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![feature(transmute_generic_consts)]
+#![allow(incomplete_features)]
+
+fn transpose<const W: usize, const H: usize>(v: [[u32;H]; W]) -> [[u32; W]; H] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn ident<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [[u32; H]; W] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn flatten<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [u32; W * H] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn coagulate<const W: usize, const H: usize>(v: [u32; H*W]) -> [[u32; W];H] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn flatten_3d<const W: usize, const H: usize, const D: usize>(
+ v: [[[u32; D]; H]; W]
+) -> [u32; D * W * H] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn flatten_somewhat<const W: usize, const H: usize, const D: usize>(
+ v: [[[u32; D]; H]; W]
+) -> [[u32; D * W]; H] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn known_size<const L: usize>(v: [u16; L]) -> [u8; L * 2] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn condense_bytes<const L: usize>(v: [u8; L * 2]) -> [u16; L] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn singleton_each<const L: usize>(v: [u8; L]) -> [[u8;1]; L] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn transpose_with_const<const W: usize, const H: usize>(
+ v: [[u32; 2 * H]; W + W]
+) -> [[u32; W + W]; 2 * H] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn main() {
+ let _ = transpose([[0; 8]; 16]);
+ let _ = transpose_with_const::<8,4>([[0; 8]; 16]);
+ let _ = ident([[0; 8]; 16]);
+ let _ = flatten([[0; 13]; 5]);
+ let _: [[_; 5]; 13] = coagulate([0; 65]);
+ let _ = flatten_3d([[[0; 3]; 13]; 5]);
+ let _ = flatten_somewhat([[[0; 3]; 13]; 5]);
+ let _ = known_size([16; 13]);
+ let _: [u16; 5] = condense_bytes([16u8; 10]);
+ let _ = singleton_each([16; 10]);
+}
diff --git a/tests/ui/const-generics/transmute_no_gate.rs b/tests/ui/const-generics/transmute_no_gate.rs
new file mode 100644
index 000000000..e1ac44390
--- /dev/null
+++ b/tests/ui/const-generics/transmute_no_gate.rs
@@ -0,0 +1,91 @@
+// gate-test-transmute_generic_consts
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+fn transpose<const W: usize, const H: usize>(v: [[u32;H]; W]) -> [[u32; W]; H] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn ident<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [[u32; H]; W] {
+ unsafe {
+ std::mem::transmute(v)
+ }
+}
+
+fn flatten<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [u32; W * H] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn coagulate<const W: usize, const H: usize>(v: [u32; H*W]) -> [[u32; W];H] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn flatten_3d<const W: usize, const H: usize, const D: usize>(
+ v: [[[u32; D]; H]; W]
+) -> [u32; D * W * H] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn flatten_somewhat<const W: usize, const H: usize, const D: usize>(
+ v: [[[u32; D]; H]; W]
+) -> [[u32; D * W]; H] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn known_size<const L: usize>(v: [u16; L]) -> [u8; L * 2] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn condense_bytes<const L: usize>(v: [u8; L * 2]) -> [u16; L] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn singleton_each<const L: usize>(v: [u8; L]) -> [[u8;1]; L] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn transpose_with_const<const W: usize, const H: usize>(
+ v: [[u32; 2 * H]; W + W]
+) -> [[u32; W + W]; 2 * H] {
+ unsafe {
+ std::mem::transmute(v)
+ //~^ ERROR cannot transmute
+ }
+}
+
+fn main() {
+ let _ = transpose([[0; 8]; 16]);
+ let _ = transpose_with_const::<8,4>([[0; 8]; 16]);
+ let _ = ident([[0; 8]; 16]);
+ let _ = flatten([[0; 13]; 5]);
+ let _: [[_; 5]; 13] = coagulate([0; 65]);
+ let _ = flatten_3d([[[0; 3]; 13]; 5]);
+ let _ = flatten_somewhat([[[0; 3]; 13]; 5]);
+ let _ = known_size([16; 13]);
+ let _: [u16; 5] = condense_bytes([16u8; 10]);
+ let _ = singleton_each([16; 10]);
+}
diff --git a/tests/ui/const-generics/transmute_no_gate.stderr b/tests/ui/const-generics/transmute_no_gate.stderr
new file mode 100644
index 000000000..9c271b348
--- /dev/null
+++ b/tests/ui/const-generics/transmute_no_gate.stderr
@@ -0,0 +1,84 @@
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:7:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[u32; H]; W]` (this type does not have a fixed size)
+ = note: target type: `[[u32; W]; H]` (this type does not have a fixed size)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:20:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[u32; H]; W]` (this type does not have a fixed size)
+ = note: target type: `[u32; W * H]` (this type does not have a fixed size)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:27:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[u32; H*W]` (this type does not have a fixed size)
+ = note: target type: `[[u32; W]; H]` (this type does not have a fixed size)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:36:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[[u32; D]; H]; W]` (this type does not have a fixed size)
+ = note: target type: `[u32; D * W * H]` (this type does not have a fixed size)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:45:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[[u32; D]; H]; W]` (this type does not have a fixed size)
+ = note: target type: `[[u32; D * W]; H]` (this type does not have a fixed size)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:52:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[u16; L]` (this type does not have a fixed size)
+ = note: target type: `[u8; L * 2]` (this type does not have a fixed size)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:59:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[u8; L * 2]` (this type does not have a fixed size)
+ = note: target type: `[u16; L]` (this type does not have a fixed size)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:66:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[u8; L]` (this type does not have a fixed size)
+ = note: target type: `[[u8; 1]; L]` (this type does not have a fixed size)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+ --> $DIR/transmute_no_gate.rs:75:5
+ |
+LL | std::mem::transmute(v)
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: source type: `[[u32; 2 * H]; W + W]` (this type does not have a fixed size)
+ = note: target type: `[[u32; W + W]; 2 * H]` (this type does not have a fixed size)
+
+error: aborting due to 9 previous errors
+
+For more information about this error, try `rustc --explain E0512`.
diff --git a/tests/ui/const-generics/type_mismatch.rs b/tests/ui/const-generics/type_mismatch.rs
index 4a7534e37..daa13277b 100644
--- a/tests/ui/const-generics/type_mismatch.rs
+++ b/tests/ui/const-generics/type_mismatch.rs
@@ -1,5 +1,6 @@
fn foo<const N: usize>() -> [u8; N] {
bar::<N>() //~ ERROR mismatched types
+ //~^ ERROR the constant `N` is not of type `u8`
}
fn bar<const N: u8>() -> [u8; N] {}
diff --git a/tests/ui/const-generics/type_mismatch.stderr b/tests/ui/const-generics/type_mismatch.stderr
index b28ae8f7e..394dd44d4 100644
--- a/tests/ui/const-generics/type_mismatch.stderr
+++ b/tests/ui/const-generics/type_mismatch.stderr
@@ -1,3 +1,15 @@
+error: the constant `N` is not of type `u8`
+ --> $DIR/type_mismatch.rs:2:11
+ |
+LL | bar::<N>()
+ | ^ expected `u8`, found `usize`
+ |
+note: required by a bound in `bar`
+ --> $DIR/type_mismatch.rs:6:8
+ |
+LL | fn bar<const N: u8>() -> [u8; N] {}
+ | ^^^^^^^^^^^ required by this bound in `bar`
+
error[E0308]: mismatched types
--> $DIR/type_mismatch.rs:2:11
|
@@ -5,7 +17,7 @@ LL | bar::<N>()
| ^ expected `u8`, found `usize`
error[E0308]: mismatched types
- --> $DIR/type_mismatch.rs:5:26
+ --> $DIR/type_mismatch.rs:6:26
|
LL | fn bar<const N: u8>() -> [u8; N] {}
| --- ^^^^^^^ expected `[u8; N]`, found `()`
@@ -13,11 +25,11 @@ LL | fn bar<const N: u8>() -> [u8; N] {}
| implicitly returns `()` as its body has no tail or `return` expression
error[E0308]: mismatched types
- --> $DIR/type_mismatch.rs:5:31
+ --> $DIR/type_mismatch.rs:6:31
|
LL | fn bar<const N: u8>() -> [u8; N] {}
| ^ expected `usize`, found `u8`
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/const-generics/type_not_in_scope.rs b/tests/ui/const-generics/type_not_in_scope.rs
index 593370180..917abaed1 100644
--- a/tests/ui/const-generics/type_not_in_scope.rs
+++ b/tests/ui/const-generics/type_not_in_scope.rs
@@ -6,6 +6,5 @@ impl X {
}
fn getn<const N: cfg_attr>() -> [u8; N] {}
//~^ ERROR expected type, found built-in attribute `cfg_attr`
-//~| ERROR mismatched types
fn main() {}
diff --git a/tests/ui/const-generics/type_not_in_scope.stderr b/tests/ui/const-generics/type_not_in_scope.stderr
index 5f45550a6..5eb81ca05 100644
--- a/tests/ui/const-generics/type_not_in_scope.stderr
+++ b/tests/ui/const-generics/type_not_in_scope.stderr
@@ -10,15 +10,7 @@ error[E0573]: expected type, found built-in attribute `cfg_attr`
LL | fn getn<const N: cfg_attr>() -> [u8; N] {}
| ^^^^^^^^ not a type
-error[E0308]: mismatched types
- --> $DIR/type_not_in_scope.rs:7:33
- |
-LL | fn getn<const N: cfg_attr>() -> [u8; N] {}
- | ---- ^^^^^^^ expected `[u8; N]`, found `()`
- | |
- | implicitly returns `()` as its body has no tail or `return` expression
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0308, E0412, E0573.
-For more information about an error, try `rustc --explain E0308`.
+Some errors have detailed explanations: E0412, E0573.
+For more information about an error, try `rustc --explain E0412`.
diff --git a/tests/ui/const-ptr/out_of_bounds_read.stderr b/tests/ui/const-ptr/out_of_bounds_read.stderr
index 3e7b09a59..89536f53f 100644
--- a/tests/ui/const-ptr/out_of_bounds_read.stderr
+++ b/tests/ui/const-ptr/out_of_bounds_read.stderr
@@ -1,7 +1,7 @@
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
- = note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+ = note: dereferencing pointer failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
|
note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@@ -14,7 +14,7 @@ LL | const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
- = note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+ = note: dereferencing pointer failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
|
note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@@ -29,7 +29,7 @@ LL | const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
- = note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+ = note: dereferencing pointer failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
|
note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
diff --git a/tests/ui/const_prop/issue-86351.rs b/tests/ui/const_prop/issue-86351.rs
new file mode 100644
index 000000000..b5f1e7f74
--- /dev/null
+++ b/tests/ui/const_prop/issue-86351.rs
@@ -0,0 +1,22 @@
+// compile-flags: --crate-type=lib -Zmir-opt-level=2
+// build-pass
+// ^-- Must be build-pass, because check-pass will not run const prop.
+
+pub trait TestTrait {
+ type MyType;
+ fn func() -> Option<Self>
+ where
+ Self: Sized;
+}
+
+impl<T> dyn TestTrait<MyType = T>
+where
+ Self: Sized,
+{
+ pub fn other_func() -> Option<Self> {
+ match Self::func() {
+ Some(me) => Some(me),
+ None => None,
+ }
+ }
+}
diff --git a/tests/ui/const_prop/unreachable-bounds.rs b/tests/ui/const_prop/unreachable-bounds.rs
new file mode 100644
index 000000000..8cf98e154
--- /dev/null
+++ b/tests/ui/const_prop/unreachable-bounds.rs
@@ -0,0 +1,6 @@
+// Use `build-pass` to ensure const-prop lint runs.
+// build-pass
+
+fn main() {
+ [()][if false { 1 } else { return }]
+}
diff --git a/tests/ui/const_prop/unreachable-overflow.rs b/tests/ui/const_prop/unreachable-overflow.rs
new file mode 100644
index 000000000..287513542
--- /dev/null
+++ b/tests/ui/const_prop/unreachable-overflow.rs
@@ -0,0 +1,10 @@
+// Use `build-pass` to ensure const-prop lint runs.
+// build-pass
+
+fn main() {
+ let x = 2u32;
+ let y = 3u32;
+ if y <= x {
+ dbg!(x - y);
+ }
+}
diff --git a/tests/ui/consts/const-block-const-bound.stderr b/tests/ui/consts/const-block-const-bound.stderr
index b9c4d8866..fef4914fa 100644
--- a/tests/ui/consts/const-block-const-bound.stderr
+++ b/tests/ui/consts/const-block-const-bound.stderr
@@ -1,44 +1,30 @@
error[E0277]: can't drop `UnconstDrop` in const contexts
- --> $DIR/const-block-const-bound.rs:20:11
+ --> $DIR/const-block-const-bound.rs:20:9
|
LL | f(UnconstDrop);
- | - ^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `UnconstDrop`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `UnconstDrop`
|
= note: the trait bound `UnconstDrop: ~const Destruct` is not satisfied
-note: required by a bound in `f`
- --> $DIR/const-block-const-bound.rs:6:15
- |
-LL | const fn f<T: ~const Destruct>(x: T) {}
- | ^^^^^^^^^^^^^^^ required by this bound in `f`
help: consider borrowing here
|
-LL | f(&UnconstDrop);
- | +
-LL | f(&mut UnconstDrop);
- | ++++
+LL | &f(UnconstDrop);
+ | +
+LL | &mut f(UnconstDrop);
+ | ++++
error[E0277]: can't drop `NonDrop` in const contexts
- --> $DIR/const-block-const-bound.rs:22:11
+ --> $DIR/const-block-const-bound.rs:22:9
|
LL | f(NonDrop);
- | - ^^^^^^^ the trait `~const Destruct` is not implemented for `NonDrop`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonDrop`
|
= note: the trait bound `NonDrop: ~const Destruct` is not satisfied
-note: required by a bound in `f`
- --> $DIR/const-block-const-bound.rs:6:15
- |
-LL | const fn f<T: ~const Destruct>(x: T) {}
- | ^^^^^^^^^^^^^^^ required by this bound in `f`
help: consider borrowing here
|
-LL | f(&NonDrop);
- | +
-LL | f(&mut NonDrop);
- | ++++
+LL | &f(NonDrop);
+ | +
+LL | &mut f(NonDrop);
+ | ++++
error: aborting due to 2 previous errors
diff --git a/tests/ui/consts/const-blocks/fn-call-in-non-const.stderr b/tests/ui/consts/const-blocks/fn-call-in-non-const.stderr
index ee352700c..174103eeb 100644
--- a/tests/ui/consts/const-blocks/fn-call-in-non-const.stderr
+++ b/tests/ui/consts/const-blocks/fn-call-in-non-const.stderr
@@ -10,7 +10,8 @@ LL | let _: [Option<Bar>; 2] = [no_copy(); 2];
= help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
help: consider annotating `Bar` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct Bar;
|
error: aborting due to previous error
diff --git a/tests/ui/consts/const-blocks/migrate-fail.stderr b/tests/ui/consts/const-blocks/migrate-fail.stderr
index 928ffd083..d1896f755 100644
--- a/tests/ui/consts/const-blocks/migrate-fail.stderr
+++ b/tests/ui/consts/const-blocks/migrate-fail.stderr
@@ -8,7 +8,8 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Bar` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct Bar;
|
error[E0277]: the trait bound `Bar: Copy` is not satisfied
@@ -21,7 +22,8 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Bar` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct Bar;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/consts/const-blocks/nll-fail.stderr b/tests/ui/consts/const-blocks/nll-fail.stderr
index fede00845..807c964a5 100644
--- a/tests/ui/consts/const-blocks/nll-fail.stderr
+++ b/tests/ui/consts/const-blocks/nll-fail.stderr
@@ -8,7 +8,8 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Bar` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct Bar;
|
error[E0277]: the trait bound `Bar: Copy` is not satisfied
@@ -21,7 +22,8 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Bar` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct Bar;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/consts/const-err-late.stderr b/tests/ui/consts/const-err-late.stderr
index cb0cab244..149d3b523 100644
--- a/tests/ui/consts/const-err-late.stderr
+++ b/tests/ui/consts/const-err-late.stderr
@@ -10,12 +10,6 @@ note: erroneous constant used
LL | black_box((S::<i32>::FOO, S::<u32>::FOO));
| ^^^^^^^^^^^^^
-note: erroneous constant used
- --> $DIR/const-err-late.rs:19:16
- |
-LL | black_box((S::<i32>::FOO, S::<u32>::FOO));
- | ^^^^^^^^^^^^^
-
error[E0080]: evaluation of `S::<u32>::FOO` failed
--> $DIR/const-err-late.rs:13:21
|
diff --git a/tests/ui/consts/const-eval/const-eval-overflow-2.rs b/tests/ui/consts/const-eval/const-eval-overflow-2.rs
index 535d91359..c19a0c443 100644
--- a/tests/ui/consts/const-eval/const-eval-overflow-2.rs
+++ b/tests/ui/consts/const-eval/const-eval-overflow-2.rs
@@ -14,7 +14,6 @@ fn main() {
match -128i8 {
NEG_NEG_128 => println!("A"),
//~^ ERROR could not evaluate constant pattern
- //~| ERROR could not evaluate constant pattern
_ => println!("B"),
}
}
diff --git a/tests/ui/consts/const-eval/const-eval-overflow-2.stderr b/tests/ui/consts/const-eval/const-eval-overflow-2.stderr
index 7b1fe49d4..fc0baf110 100644
--- a/tests/ui/consts/const-eval/const-eval-overflow-2.stderr
+++ b/tests/ui/consts/const-eval/const-eval-overflow-2.stderr
@@ -10,12 +10,6 @@ error: could not evaluate constant pattern
LL | NEG_NEG_128 => println!("A"),
| ^^^^^^^^^^^
-error: could not evaluate constant pattern
- --> $DIR/const-eval-overflow-2.rs:15:9
- |
-LL | NEG_NEG_128 => println!("A"),
- | ^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/format.rs b/tests/ui/consts/const-eval/format.rs
index 0d8b7c12d..5bdb2bf19 100644
--- a/tests/ui/consts/const-eval/format.rs
+++ b/tests/ui/consts/const-eval/format.rs
@@ -1,12 +1,13 @@
const fn failure() {
panic!("{:?}", 0);
//~^ ERROR cannot call non-const formatting macro in constant functions
+ //~| ERROR cannot call non-const fn `Arguments::<'_>::new_v1` in constant functions
}
const fn print() {
println!("{:?}", 0);
//~^ ERROR cannot call non-const formatting macro in constant functions
- //~| ERROR `Arguments::<'a>::new_v1` is not yet stable as a const fn
+ //~| ERROR cannot call non-const fn `Arguments::<'_>::new_v1` in constant functions
//~| ERROR cannot call non-const fn `_print` in constant functions
}
diff --git a/tests/ui/consts/const-eval/format.stderr b/tests/ui/consts/const-eval/format.stderr
index 4bf39db58..70a1abb0a 100644
--- a/tests/ui/consts/const-eval/format.stderr
+++ b/tests/ui/consts/const-eval/format.stderr
@@ -1,32 +1,41 @@
error[E0015]: cannot call non-const formatting macro in constant functions
- --> $DIR/format.rs:2:20
+ --> $DIR/format.rs:2:13
|
LL | panic!("{:?}", 0);
- | ^
+ | ^^^^
+ |
+ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+ = note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `Arguments::<'_>::new_v1` in constant functions
+ --> $DIR/format.rs:2:5
+ |
+LL | panic!("{:?}", 0);
+ | ^^^^^^^^^^^^^^^^^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= note: this error originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0015]: cannot call non-const formatting macro in constant functions
- --> $DIR/format.rs:7:22
+ --> $DIR/format.rs:8:15
|
LL | println!("{:?}", 0);
- | ^
+ | ^^^^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= 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: `Arguments::<'a>::new_v1` is not yet stable as a const fn
- --> $DIR/format.rs:7:5
+error[E0015]: cannot call non-const fn `Arguments::<'_>::new_v1` in constant functions
+ --> $DIR/format.rs:8:5
|
LL | println!("{:?}", 0);
| ^^^^^^^^^^^^^^^^^^^
|
- = help: add `#![feature(const_fmt_arguments_new)]` to the crate attributes to enable
+ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= 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[E0015]: cannot call non-const fn `_print` in constant functions
- --> $DIR/format.rs:7:5
+ --> $DIR/format.rs:8:5
|
LL | println!("{:?}", 0);
| ^^^^^^^^^^^^^^^^^^^
@@ -63,19 +72,19 @@ LL | panic!("{:?}", 0);
= note: this note originates in the macro `$crate::const_format_args` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
note: erroneous constant used
- --> $DIR/format.rs:7:14
+ --> $DIR/format.rs:8:14
|
LL | println!("{:?}", 0);
| ^^^^^^
note: erroneous constant used
- --> $DIR/format.rs:7:14
+ --> $DIR/format.rs:8:14
|
LL | println!("{:?}", 0);
| ^^^^^^
note: erroneous constant used
- --> $DIR/format.rs:7:22
+ --> $DIR/format.rs:8:22
|
LL | println!("{:?}", 0);
| ^
@@ -83,13 +92,13 @@ LL | println!("{:?}", 0);
= note: this note 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)
note: erroneous constant used
- --> $DIR/format.rs:7:22
+ --> $DIR/format.rs:8:22
|
LL | println!("{:?}", 0);
| ^
|
= note: this note 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 4 previous errors
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/const-eval/issue-44578.stderr b/tests/ui/consts/const-eval/issue-44578.stderr
index 0cbf54480..f3952809e 100644
--- a/tests/ui/consts/const-eval/issue-44578.stderr
+++ b/tests/ui/consts/const-eval/issue-44578.stderr
@@ -26,14 +26,6 @@ LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
|
= note: this note 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)
-note: erroneous constant used
- --> $DIR/issue-44578.rs:25:20
- |
-LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: this note 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 previous error
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/panic-assoc-never-type.rs b/tests/ui/consts/const-eval/panic-assoc-never-type.rs
index 28edf5144..1abe708d1 100644
--- a/tests/ui/consts/const-eval/panic-assoc-never-type.rs
+++ b/tests/ui/consts/const-eval/panic-assoc-never-type.rs
@@ -11,5 +11,5 @@ impl PrintName {
}
fn main() {
- let _ = PrintName::VOID; //~ constant
+ let _ = PrintName::VOID; //~ erroneous constant used
}
diff --git a/tests/ui/consts/const-eval/ref_to_int_match.32bit.stderr b/tests/ui/consts/const-eval/ref_to_int_match.32bit.stderr
index 032ceb246..eaa2d6b27 100644
--- a/tests/ui/consts/const-eval/ref_to_int_match.32bit.stderr
+++ b/tests/ui/consts/const-eval/ref_to_int_match.32bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/ref_to_int_match.rs:25:27
+ --> $DIR/ref_to_int_match.rs:24:27
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
| ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -13,12 +13,6 @@ error: could not evaluate constant pattern
LL | 10..=BAR => {},
| ^^^
-error: could not evaluate constant pattern
- --> $DIR/ref_to_int_match.rs:7:14
- |
-LL | 10..=BAR => {},
- | ^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/ref_to_int_match.64bit.stderr b/tests/ui/consts/const-eval/ref_to_int_match.64bit.stderr
index 032ceb246..eaa2d6b27 100644
--- a/tests/ui/consts/const-eval/ref_to_int_match.64bit.stderr
+++ b/tests/ui/consts/const-eval/ref_to_int_match.64bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/ref_to_int_match.rs:25:27
+ --> $DIR/ref_to_int_match.rs:24:27
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
| ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
@@ -13,12 +13,6 @@ error: could not evaluate constant pattern
LL | 10..=BAR => {},
| ^^^
-error: could not evaluate constant pattern
- --> $DIR/ref_to_int_match.rs:7:14
- |
-LL | 10..=BAR => {},
- | ^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/ref_to_int_match.rs b/tests/ui/consts/const-eval/ref_to_int_match.rs
index 70c6e7d94..a2dabde25 100644
--- a/tests/ui/consts/const-eval/ref_to_int_match.rs
+++ b/tests/ui/consts/const-eval/ref_to_int_match.rs
@@ -5,7 +5,6 @@ fn main() {
match n {
0..=10 => {},
10..=BAR => {}, //~ ERROR could not evaluate constant pattern
- //~| ERROR could not evaluate constant pattern
_ => {},
}
}
diff --git a/tests/ui/consts/const-eval/transmute-size-mismatch.rs b/tests/ui/consts/const-eval/transmute-size-mismatch.rs
new file mode 100644
index 000000000..2410baea2
--- /dev/null
+++ b/tests/ui/consts/const-eval/transmute-size-mismatch.rs
@@ -0,0 +1,24 @@
+#![feature(core_intrinsics)]
+#![feature(custom_mir)]
+
+// These cases are statically rejected by `mem::transmute`, so we need custom
+// MIR to be able to get to constant evaluation.
+use std::intrinsics::mir::*;
+
+#[custom_mir(dialect = "runtime", phase = "initial")]
+const unsafe fn mir_transmute<T, U>(x: T) -> U {
+ mir!{
+ {
+ RET = CastTransmute(x);
+ //~^ ERROR evaluation of constant value failed
+ //~| ERROR evaluation of constant value failed
+ Return()
+ }
+ }
+}
+
+const FROM_BIGGER: u16 = unsafe { mir_transmute(123_i32) };
+
+const FROM_SMALLER: u32 = unsafe { mir_transmute(123_i16) };
+
+fn main() {}
diff --git a/tests/ui/consts/const-eval/transmute-size-mismatch.stderr b/tests/ui/consts/const-eval/transmute-size-mismatch.stderr
new file mode 100644
index 000000000..e051491d3
--- /dev/null
+++ b/tests/ui/consts/const-eval/transmute-size-mismatch.stderr
@@ -0,0 +1,37 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/transmute-size-mismatch.rs:12:13
+ |
+LL | RET = CastTransmute(x);
+ | ^^^^^^^^^^^^^^^^^^^^^^ transmuting from 4-byte type to 2-byte type: `i32` -> `u16`
+ |
+note: inside `mir_transmute::<i32, u16>`
+ --> $DIR/transmute-size-mismatch.rs:12:13
+ |
+LL | RET = CastTransmute(x);
+ | ^^^^^^^^^^^^^^^^^^^^^^
+note: inside `FROM_BIGGER`
+ --> $DIR/transmute-size-mismatch.rs:20:35
+ |
+LL | const FROM_BIGGER: u16 = unsafe { mir_transmute(123_i32) };
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/transmute-size-mismatch.rs:12:13
+ |
+LL | RET = CastTransmute(x);
+ | ^^^^^^^^^^^^^^^^^^^^^^ transmuting from 2-byte type to 4-byte type: `i16` -> `u32`
+ |
+note: inside `mir_transmute::<i16, u32>`
+ --> $DIR/transmute-size-mismatch.rs:12:13
+ |
+LL | RET = CastTransmute(x);
+ | ^^^^^^^^^^^^^^^^^^^^^^
+note: inside `FROM_SMALLER`
+ --> $DIR/transmute-size-mismatch.rs:22:36
+ |
+LL | const FROM_SMALLER: u32 = unsafe { mir_transmute(123_i16) };
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/ub-enum.32bit.stderr b/tests/ui/consts/const-eval/ub-enum.32bit.stderr
index 2d86bd88f..3ad1ac974 100644
--- a/tests/ui/consts/const-eval/ub-enum.32bit.stderr
+++ b/tests/ui/consts/const-eval/ub-enum.32bit.stderr
@@ -108,13 +108,13 @@ 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) };
- | ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
+ | ^^^^^^^^^^^^^^^^^^^^ 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
|
LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
- | ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Ok)>.0.1: encountered a value of the never type `!`
error: aborting due to 13 previous errors
diff --git a/tests/ui/consts/const-eval/ub-enum.64bit.stderr b/tests/ui/consts/const-eval/ub-enum.64bit.stderr
index a89d7ec5f..a66706d1a 100644
--- a/tests/ui/consts/const-eval/ub-enum.64bit.stderr
+++ b/tests/ui/consts/const-eval/ub-enum.64bit.stderr
@@ -108,13 +108,13 @@ 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) };
- | ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
+ | ^^^^^^^^^^^^^^^^^^^^ 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
|
LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
- | ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Ok)>.0.1: encountered a value of the never type `!`
error: aborting due to 13 previous errors
diff --git a/tests/ui/consts/const-eval/ub-ref-ptr.stderr b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
index 6bd367b64..080568b51 100644
--- a/tests/ui/consts/const-eval/ub-ref-ptr.stderr
+++ b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
@@ -148,11 +148,11 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
HEX_DUMP
}
-error: accessing memory with alignment 1, but alignment 4 is required
+error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
- = 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 #68585 <https://github.com/rust-lang/rust/issues/104616>
+ = note: accessing memory with alignment 1, but alignment 4 is required
+ |
note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
note: inside `ptr::const_ptr::<impl *const u32>::read`
@@ -162,25 +162,7 @@ note: inside `UNALIGNED_READ`
|
LL | ptr.read();
| ^^^^^^^^^^
- = note: `#[deny(invalid_alignment)]` on by default
error: aborting due to 15 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: accessing memory with alignment 1, but alignment 4 is required
- --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- |
- = 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 #68585 <https://github.com/rust-lang/rust/issues/104616>
-note: inside `std::ptr::read::<u32>`
- --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
-note: inside `ptr::const_ptr::<impl *const u32>::read`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
-note: inside `UNALIGNED_READ`
- --> $DIR/ub-ref-ptr.rs:67:5
- |
-LL | ptr.read();
- | ^^^^^^^^^^
- = note: `#[deny(invalid_alignment)]` on by default
-
diff --git a/tests/ui/consts/const-eval/ub-slice-get-unchecked.rs b/tests/ui/consts/const-eval/ub-slice-get-unchecked.rs
new file mode 100644
index 000000000..d9a74b4f3
--- /dev/null
+++ b/tests/ui/consts/const-eval/ub-slice-get-unchecked.rs
@@ -0,0 +1,9 @@
+#![feature(const_slice_index)]
+
+const A: [(); 5] = [(), (), (), (), ()];
+
+// Since the indexing is on a ZST, the addresses are all fine,
+// but we should still catch the bad range.
+const B: &[()] = unsafe { A.get_unchecked(3..1) };
+
+fn main() {}
diff --git a/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr b/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr
new file mode 100644
index 000000000..775e475df
--- /dev/null
+++ b/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr
@@ -0,0 +1,18 @@
+error[E0080]: evaluation of constant value failed
+ --> $SRC_DIR/core/src/slice/index.rs:LL:COL
+ |
+ = note: overflow executing `unchecked_sub`
+ |
+note: inside `<std::ops::Range<usize> as SliceIndex<[()]>>::get_unchecked`
+ --> $SRC_DIR/core/src/slice/index.rs:LL:COL
+note: inside `core::slice::<impl [()]>::get_unchecked::<std::ops::Range<usize>>`
+ --> $SRC_DIR/core/src/slice/mod.rs:LL:COL
+note: inside `B`
+ --> $DIR/ub-slice-get-unchecked.rs:7:27
+ |
+LL | const B: &[()] = unsafe { A.get_unchecked(3..1) };
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/ub-uninhabit.rs b/tests/ui/consts/const-eval/ub-uninhabit.rs
index 4c4ef216d..10edae437 100644
--- a/tests/ui/consts/const-eval/ub-uninhabit.rs
+++ b/tests/ui/consts/const-eval/ub-uninhabit.rs
@@ -14,12 +14,12 @@ union MaybeUninit<T: Copy> {
}
const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
//~^ ERROR it is undefined behavior to use this value
const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
fn main() {}
diff --git a/tests/ui/consts/const-eval/ub-uninhabit.stderr b/tests/ui/consts/const-eval/ub-uninhabit.stderr
index 0ae376d03..733975fc0 100644
--- a/tests/ui/consts/const-eval/ub-uninhabit.stderr
+++ b/tests/ui/consts/const-eval/ub-uninhabit.stderr
@@ -1,11 +1,8 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:16:1
+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
- |
- = 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) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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
@@ -18,14 +15,11 @@ LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
HEX_DUMP
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:22:1
+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
- |
- = 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) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/validate_uninhabited_zsts.32bit.stderr b/tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
index 69fb1a59d..74bc6317c 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
@@ -11,7 +11,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/validate_uninhabited_zsts.rs:4:14
|
LL | unsafe { std::mem::transmute(()) }
- | ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of the never type `!`
|
note: inside `foo`
--> $DIR/validate_uninhabited_zsts.rs:4:14
@@ -24,14 +24,11 @@ note: inside `FOO`
LL | const FOO: [empty::Empty; 3] = [foo(); 3];
| ^^^^^
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/validate_uninhabited_zsts.rs:21:1
+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].0: encountered a value of uninhabited type empty::Void
- |
- = 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: 0, align: 1) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type empty::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 69fb1a59d..74bc6317c 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
@@ -11,7 +11,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/validate_uninhabited_zsts.rs:4:14
|
LL | unsafe { std::mem::transmute(()) }
- | ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of the never type `!`
|
note: inside `foo`
--> $DIR/validate_uninhabited_zsts.rs:4:14
@@ -24,14 +24,11 @@ note: inside `FOO`
LL | const FOO: [empty::Empty; 3] = [foo(); 3];
| ^^^^^
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/validate_uninhabited_zsts.rs:21:1
+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].0: encountered a value of uninhabited type empty::Void
- |
- = 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: 0, align: 1) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type empty::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.rs b/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
index c0b326215..b6783175d 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
@@ -19,7 +19,7 @@ pub mod empty {
const FOO: [empty::Empty; 3] = [foo(); 3];
const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
//~| WARN the type `empty::Empty` does not permit zero-initialization
fn main() {
diff --git a/tests/ui/consts/const-fn-error.rs b/tests/ui/consts/const-fn-error.rs
index 50b7ce1f8..dabbd58db 100644
--- a/tests/ui/consts/const-fn-error.rs
+++ b/tests/ui/consts/const-fn-error.rs
@@ -7,6 +7,7 @@ const fn f(x: usize) -> usize {
//~| ERROR `for` is not allowed in a `const fn`
//~| ERROR mutable references are not allowed in constant functions
//~| ERROR cannot call non-const fn
+ //~| ERROR the trait bound
sum += i;
}
sum
diff --git a/tests/ui/consts/const-fn-error.stderr b/tests/ui/consts/const-fn-error.stderr
index f735b3d53..73d235d6a 100644
--- a/tests/ui/consts/const-fn-error.stderr
+++ b/tests/ui/consts/const-fn-error.stderr
@@ -5,7 +5,7 @@ LL | / for i in 0..x {
LL | |
LL | |
LL | |
-LL | |
+... |
LL | | sum += i;
LL | | }
| |_____^
@@ -33,6 +33,19 @@ LL | for i in 0..x {
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+error[E0277]: the trait bound `std::ops::Range<usize>: Iterator` is not satisfied
+ --> $DIR/const-fn-error.rs:5:14
+ |
+LL | for i in 0..x {
+ | ^^^^ `std::ops::Range<usize>` is not an iterator
+ |
+ = help: the trait `~const Iterator` is not implemented for `std::ops::Range<usize>`
+note: the trait `Iterator` is implemented for `std::ops::Range<usize>`, but that implementation is not `const`
+ --> $DIR/const-fn-error.rs:5:14
+ |
+LL | for i in 0..x {
+ | ^^^^
+
error[E0015]: cannot call non-const fn `<std::ops::Range<usize> as Iterator>::next` in constant functions
--> $DIR/const-fn-error.rs:5:14
|
@@ -42,7 +55,7 @@ LL | for i in 0..x {
= 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 4 previous errors
+error: aborting due to 5 previous errors
-Some errors have detailed explanations: E0015, E0658.
+Some errors have detailed explanations: E0015, E0277, E0658.
For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/const-for.rs b/tests/ui/consts/const-for.rs
index 8db248535..ff9c977f7 100644
--- a/tests/ui/consts/const-for.rs
+++ b/tests/ui/consts/const-for.rs
@@ -5,6 +5,7 @@ const _: () = {
for _ in 0..5 {}
//~^ error: cannot call
//~| error: cannot convert
+ //~| error: the trait bound
};
fn main() {}
diff --git a/tests/ui/consts/const-for.stderr b/tests/ui/consts/const-for.stderr
index 3fb9787c0..64f2f603b 100644
--- a/tests/ui/consts/const-for.stderr
+++ b/tests/ui/consts/const-for.stderr
@@ -9,6 +9,19 @@ note: impl defined here, but it is not `const`
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
+error[E0277]: the trait bound `std::ops::Range<i32>: Iterator` is not satisfied
+ --> $DIR/const-for.rs:5:14
+ |
+LL | for _ in 0..5 {}
+ | ^^^^ `std::ops::Range<i32>` is not an iterator
+ |
+ = help: the trait `~const Iterator` is not implemented for `std::ops::Range<i32>`
+note: the trait `Iterator` is implemented for `std::ops::Range<i32>`, but that implementation is not `const`
+ --> $DIR/const-for.rs:5:14
+ |
+LL | for _ in 0..5 {}
+ | ^^^^
+
error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants
--> $DIR/const-for.rs:5:14
|
@@ -18,6 +31,7 @@ LL | for _ in 0..5 {}
= note: calls in constants 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 2 previous errors
+error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/const-match-check.eval1.stderr b/tests/ui/consts/const-match-check.eval1.stderr
index 08fcd1dea..27ff5d4cd 100644
--- a/tests/ui/consts/const-match-check.eval1.stderr
+++ b/tests/ui/consts/const-match-check.eval1.stderr
@@ -9,8 +9,8 @@ LL | A = { let 0 = 0; 0 },
= note: the matched value is of type `i32`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | A = { if let 0 = 0 { todo!() } 0 },
- | ++ ~~~~~~~~~~~
+LL | A = { if let 0 = 0 { todo!() }; 0 },
+ | ++ +++++++++++
help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
|
LL | A = { let _0 = 0; 0 },
diff --git a/tests/ui/consts/const-match-check.eval2.stderr b/tests/ui/consts/const-match-check.eval2.stderr
index 5d86ca4bf..0c74a7b3d 100644
--- a/tests/ui/consts/const-match-check.eval2.stderr
+++ b/tests/ui/consts/const-match-check.eval2.stderr
@@ -9,8 +9,8 @@ LL | let x: [i32; { let 0 = 0; 0 }] = [];
= note: the matched value is of type `i32`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | let x: [i32; { if let 0 = 0 { todo!() } 0 }] = [];
- | ++ ~~~~~~~~~~~
+LL | let x: [i32; { if let 0 = 0 { todo!() }; 0 }] = [];
+ | ++ +++++++++++
help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
|
LL | let x: [i32; { let _0 = 0; 0 }] = [];
diff --git a/tests/ui/consts/const-match-check.matchck.stderr b/tests/ui/consts/const-match-check.matchck.stderr
index c8f66bb0f..bcca4c2a6 100644
--- a/tests/ui/consts/const-match-check.matchck.stderr
+++ b/tests/ui/consts/const-match-check.matchck.stderr
@@ -9,8 +9,8 @@ LL | const X: i32 = { let 0 = 0; 0 };
= note: the matched value is of type `i32`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | const X: i32 = { if let 0 = 0 { todo!() } 0 };
- | ++ ~~~~~~~~~~~
+LL | const X: i32 = { if let 0 = 0 { todo!() }; 0 };
+ | ++ +++++++++++
help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
|
LL | const X: i32 = { let _0 = 0; 0 };
@@ -27,8 +27,8 @@ LL | static Y: i32 = { let 0 = 0; 0 };
= note: the matched value is of type `i32`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | static Y: i32 = { if let 0 = 0 { todo!() } 0 };
- | ++ ~~~~~~~~~~~
+LL | static Y: i32 = { if let 0 = 0 { todo!() }; 0 };
+ | ++ +++++++++++
help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
|
LL | static Y: i32 = { let _0 = 0; 0 };
@@ -45,8 +45,8 @@ LL | const X: i32 = { let 0 = 0; 0 };
= note: the matched value is of type `i32`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | const X: i32 = { if let 0 = 0 { todo!() } 0 };
- | ++ ~~~~~~~~~~~
+LL | const X: i32 = { if let 0 = 0 { todo!() }; 0 };
+ | ++ +++++++++++
help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
|
LL | const X: i32 = { let _0 = 0; 0 };
@@ -63,8 +63,8 @@ LL | const X: i32 = { let 0 = 0; 0 };
= note: the matched value is of type `i32`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | const X: i32 = { if let 0 = 0 { todo!() } 0 };
- | ++ ~~~~~~~~~~~
+LL | const X: i32 = { if let 0 = 0 { todo!() }; 0 };
+ | ++ +++++++++++
help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
|
LL | const X: i32 = { let _0 = 0; 0 };
diff --git a/tests/ui/consts/const-pattern-irrefutable.stderr b/tests/ui/consts/const-pattern-irrefutable.stderr
index c156ea161..2aed68bdd 100644
--- a/tests/ui/consts/const-pattern-irrefutable.stderr
+++ b/tests/ui/consts/const-pattern-irrefutable.stderr
@@ -1,9 +1,6 @@
error[E0005]: refutable pattern in local binding
--> $DIR/const-pattern-irrefutable.rs:12:9
|
-LL | const a: u8 = 2;
- | ----------- constant defined here
-...
LL | let a = 4;
| ^
| |
@@ -11,14 +8,13 @@ LL | let a = 4;
| missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
| help: introduce a variable instead: `a_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 `u8`
error[E0005]: refutable pattern in local binding
--> $DIR/const-pattern-irrefutable.rs:17:9
|
-LL | pub const b: u8 = 2;
- | --------------- constant defined here
-...
LL | let c = 4;
| ^
| |
@@ -26,14 +22,13 @@ LL | let c = 4;
| missing patterns are not covered because `c` is interpreted as a constant pattern, not a new variable
| help: introduce a variable instead: `c_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 `u8`
error[E0005]: refutable pattern in local binding
--> $DIR/const-pattern-irrefutable.rs:22:9
|
-LL | pub const d: u8 = 2;
- | --------------- constant defined here
-...
LL | let d = 4;
| ^
| |
@@ -41,6 +36,8 @@ LL | let d = 4;
| missing patterns are not covered because `d` is interpreted as a constant pattern, not a new variable
| help: introduce a variable instead: `d_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 `u8`
error: aborting due to 3 previous errors
diff --git a/tests/ui/consts/const_in_pattern/cross-crate-fail.stderr b/tests/ui/consts/const_in_pattern/cross-crate-fail.stderr
index a8066a88c..2f6786999 100644
--- a/tests/ui/consts/const_in_pattern/cross-crate-fail.stderr
+++ b/tests/ui/consts/const_in_pattern/cross-crate-fail.stderr
@@ -3,12 +3,18 @@ error: to use a constant of type `CustomEq` in a pattern, `CustomEq` must be ann
|
LL | consts::SOME => panic!(),
| ^^^^^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `CustomEq` in a pattern, `CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/cross-crate-fail.rs:20:9
|
LL | <Defaulted as consts::AssocConst>::SOME => panic!(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to 2 previous errors
diff --git a/tests/ui/consts/const_in_pattern/custom-eq-branch-warn.rs b/tests/ui/consts/const_in_pattern/custom-eq-branch-warn.rs
index 856d20417..41de5e7b4 100644
--- a/tests/ui/consts/const_in_pattern/custom-eq-branch-warn.rs
+++ b/tests/ui/consts/const_in_pattern/custom-eq-branch-warn.rs
@@ -28,6 +28,8 @@ fn main() {
match Foo::Qux(CustomEq) {
BAR_BAZ => panic!(),
//~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
//~| WARN this was previously accepted
//~| NOTE see issue #73448
//~| NOTE `#[warn(nontrivial_structural_match)]` on by default
diff --git a/tests/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr b/tests/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr
index 223482722..3f19c67d2 100644
--- a/tests/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr
+++ b/tests/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr
@@ -6,6 +6,8 @@ LL | BAR_BAZ => panic!(),
|
= 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 #73448 <https://github.com/rust-lang/rust/issues/73448>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
= note: `#[warn(nontrivial_structural_match)]` on by default
warning: 1 warning emitted
diff --git a/tests/ui/consts/const_in_pattern/incomplete-slice.stderr b/tests/ui/consts/const_in_pattern/incomplete-slice.stderr
index ddc576ced..be144a87b 100644
--- a/tests/ui/consts/const_in_pattern/incomplete-slice.stderr
+++ b/tests/ui/consts/const_in_pattern/incomplete-slice.stderr
@@ -6,6 +6,8 @@ LL | E_SL => {}
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
= note: `#[warn(indirect_structural_match)]` on by default
error[E0004]: non-exhaustive patterns: `&_` not covered
@@ -17,7 +19,7 @@ LL | match &[][..] {
= note: the matched value is of type `&[E]`
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 ~ E_SL => {}
+LL ~ E_SL => {},
LL + &_ => todo!()
|
diff --git a/tests/ui/consts/const_in_pattern/issue-78057.stderr b/tests/ui/consts/const_in_pattern/issue-78057.stderr
index 35619594f..df155bdb6 100644
--- a/tests/ui/consts/const_in_pattern/issue-78057.stderr
+++ b/tests/ui/consts/const_in_pattern/issue-78057.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `Opaque` in a pattern, `Opaque` must be annotat
|
LL | FOO => {},
| ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: unreachable pattern
--> $DIR/issue-78057.rs:14:9
diff --git a/tests/ui/consts/const_in_pattern/no-eq-branch-fail.stderr b/tests/ui/consts/const_in_pattern/no-eq-branch-fail.stderr
index e505dad69..cced6af49 100644
--- a/tests/ui/consts/const_in_pattern/no-eq-branch-fail.stderr
+++ b/tests/ui/consts/const_in_pattern/no-eq-branch-fail.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated wit
|
LL | BAR_BAZ => panic!(),
| ^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/consts/const_in_pattern/reject_non_partial_eq.stderr b/tests/ui/consts/const_in_pattern/reject_non_partial_eq.stderr
index 95cfa4a9e..958bf373c 100644
--- a/tests/ui/consts/const_in_pattern/reject_non_partial_eq.stderr
+++ b/tests/ui/consts/const_in_pattern/reject_non_partial_eq.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `NoPartialEq` in a pattern, `NoPartialEq` must
|
LL | NO_PARTIAL_EQ_NONE => println!("NO_PARTIAL_EQ_NONE"),
| ^^^^^^^^^^^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/consts/const_in_pattern/reject_non_structural.rs b/tests/ui/consts/const_in_pattern/reject_non_structural.rs
index 75fde0d92..dc6b9a331 100644
--- a/tests/ui/consts/const_in_pattern/reject_non_structural.rs
+++ b/tests/ui/consts/const_in_pattern/reject_non_structural.rs
@@ -39,45 +39,67 @@ fn main() {
const ENUM: Derive<NoDerive> = Derive::Some(NoDerive);
match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
const FIELD: OND = TrivialEq(Some(NoDerive)).0;
match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
const NO_DERIVE_SOME: OND = Some(NoDerive);
const INDIRECT: OND = NO_DERIVE_SOME;
match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
const TUPLE: (OND, OND) = (None, Some(NoDerive));
match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
const TYPE_ASCRIPTION: OND = type_ascribe!(Some(NoDerive), OND);
match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
const ARRAY: [OND; 2] = [None, Some(NoDerive)];
match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
const REPEAT: [OND; 2] = [Some(NoDerive); 2];
match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
//~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
trait Trait: Sized { const ASSOC: Option<Self>; }
impl Trait for NoDerive { const ASSOC: Option<NoDerive> = Some(NoDerive); }
match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
const BLOCK: OND = { NoDerive; Some(NoDerive) };
match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
const ADDR_OF: &OND = &Some(NoDerive);
match &Some(NoDerive) { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), };
//~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| NOTE the traits must be derived
+ //~| NOTE StructuralEq.html for details
//~| WARN previously accepted by the compiler but is being phased out
//~| NOTE for more information, see issue #62411
}
diff --git a/tests/ui/consts/const_in_pattern/reject_non_structural.stderr b/tests/ui/consts/const_in_pattern/reject_non_structural.stderr
index 660198349..b6e439f21 100644
--- a/tests/ui/consts/const_in_pattern/reject_non_structural.stderr
+++ b/tests/ui/consts/const_in_pattern/reject_non_structural.stderr
@@ -3,69 +3,101 @@ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be ann
|
LL | match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), };
| ^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:44:28
+ --> $DIR/reject_non_structural.rs:46:28
|
LL | match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), };
| ^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:49:27
+ --> $DIR/reject_non_structural.rs:53:27
|
LL | match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
| ^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:53:36
+ --> $DIR/reject_non_structural.rs:59:36
|
LL | match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
| ^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:57:28
+ --> $DIR/reject_non_structural.rs:65:28
|
LL | match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
| ^^^^^^^^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:61:36
+ --> $DIR/reject_non_structural.rs:71:36
|
LL | match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
| ^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:65:33
+ --> $DIR/reject_non_structural.rs:77:33
|
LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
| ^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:65:33
+ --> $DIR/reject_non_structural.rs:77:33
|
LL | match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
| ^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:71:28
+ --> $DIR/reject_non_structural.rs:87:28
|
LL | match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
| ^^^^^^^^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:75:28
+ --> $DIR/reject_non_structural.rs:93:28
|
LL | match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
| ^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/reject_non_structural.rs:79:29
+ --> $DIR/reject_non_structural.rs:99:29
|
LL | match &Some(NoDerive) { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), };
| ^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
note: the lint level is defined here
--> $DIR/reject_non_structural.rs:12:9
|
diff --git a/tests/ui/consts/const_in_pattern/warn_corner_cases.stderr b/tests/ui/consts/const_in_pattern/warn_corner_cases.stderr
index e957a43a1..8c01d2f65 100644
--- a/tests/ui/consts/const_in_pattern/warn_corner_cases.stderr
+++ b/tests/ui/consts/const_in_pattern/warn_corner_cases.stderr
@@ -6,6 +6,8 @@ LL | match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), };
|
= 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 #73448 <https://github.com/rust-lang/rust/issues/73448>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
= note: `#[warn(nontrivial_structural_match)]` on by default
warning: to use a constant of type `NoDerive` in a pattern, the constant's initializer must be trivial or `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
@@ -16,6 +18,8 @@ LL | match None { Some(_) => panic!("whoops"), CALL => dbg!(CALL), };
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #73448 <https://github.com/rust-lang/rust/issues/73448>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
warning: to use a constant of type `NoDerive` in a pattern, the constant's initializer must be trivial or `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/warn_corner_cases.rs:38:47
@@ -25,6 +29,8 @@ LL | match None { Some(_) => panic!("whoops"), METHOD_CALL => dbg!(METHOD_CA
|
= 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 #73448 <https://github.com/rust-lang/rust/issues/73448>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
warning: 3 warnings emitted
diff --git a/tests/ui/consts/invalid-inline-const-in-match-arm.rs b/tests/ui/consts/invalid-inline-const-in-match-arm.rs
index 4d2d8fb13..17acb2d9d 100644
--- a/tests/ui/consts/invalid-inline-const-in-match-arm.rs
+++ b/tests/ui/consts/invalid-inline-const-in-match-arm.rs
@@ -5,5 +5,6 @@ fn main() {
match () {
const { (|| {})() } => {}
//~^ ERROR cannot call non-const closure in constants
+ //~| ERROR the trait bound
}
}
diff --git a/tests/ui/consts/invalid-inline-const-in-match-arm.stderr b/tests/ui/consts/invalid-inline-const-in-match-arm.stderr
index 257ecd7f3..ac174849f 100644
--- a/tests/ui/consts/invalid-inline-const-in-match-arm.stderr
+++ b/tests/ui/consts/invalid-inline-const-in-match-arm.stderr
@@ -1,3 +1,17 @@
+error[E0277]: the trait bound `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]: Fn<()>` is not satisfied
+ --> $DIR/invalid-inline-const-in-match-arm.rs:6:17
+ |
+LL | const { (|| {})() } => {}
+ | ^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]`
+ |
+ = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]`
+note: the trait `Fn<()>` is implemented for `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]`, but that implementation is not `const`
+ --> $DIR/invalid-inline-const-in-match-arm.rs:6:17
+ |
+LL | const { (|| {})() } => {}
+ | ^^^^^^^^^
+ = note: wrap the `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]` in a closure with no arguments: `|| { /* code */ }`
+
error[E0015]: cannot call non-const closure in constants
--> $DIR/invalid-inline-const-in-match-arm.rs:6:17
|
@@ -8,6 +22,7 @@ LL | const { (|| {})() } => {}
= note: calls in constants 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
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-28113.rs b/tests/ui/consts/issue-28113.rs
index f8131c9f3..e45c009d6 100644
--- a/tests/ui/consts/issue-28113.rs
+++ b/tests/ui/consts/issue-28113.rs
@@ -3,6 +3,7 @@
const X: u8 =
|| -> u8 { 5 }()
//~^ ERROR cannot call non-const closure
+ //~| ERROR the trait bound
;
fn main() {}
diff --git a/tests/ui/consts/issue-28113.stderr b/tests/ui/consts/issue-28113.stderr
index 1294cc99b..e177a3585 100644
--- a/tests/ui/consts/issue-28113.stderr
+++ b/tests/ui/consts/issue-28113.stderr
@@ -1,3 +1,17 @@
+error[E0277]: the trait bound `[closure@$DIR/issue-28113.rs:4:5: 4:13]: Fn<()>` is not satisfied
+ --> $DIR/issue-28113.rs:4:5
+ |
+LL | || -> u8 { 5 }()
+ | ^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-28113.rs:4:5: 4:13]`
+ |
+ = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-28113.rs:4:5: 4:13]`
+note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-28113.rs:4:5: 4:13]`, but that implementation is not `const`
+ --> $DIR/issue-28113.rs:4:5
+ |
+LL | || -> u8 { 5 }()
+ | ^^^^^^^^^^^^^^^^
+ = note: wrap the `[closure@$DIR/issue-28113.rs:4:5: 4:13]` in a closure with no arguments: `|| { /* code */ }`
+
error[E0015]: cannot call non-const closure in constants
--> $DIR/issue-28113.rs:4:5
|
@@ -8,6 +22,7 @@ LL | || -> u8 { 5 }()
= note: calls in constants 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
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-43105.rs b/tests/ui/consts/issue-43105.rs
index cac12b909..20b78d642 100644
--- a/tests/ui/consts/issue-43105.rs
+++ b/tests/ui/consts/issue-43105.rs
@@ -7,7 +7,6 @@ fn main() {
match 1 {
NUM => unimplemented!(),
//~^ ERROR could not evaluate constant pattern
- //~| ERROR could not evaluate constant pattern
_ => unimplemented!(),
}
}
diff --git a/tests/ui/consts/issue-43105.stderr b/tests/ui/consts/issue-43105.stderr
index 2d1174af7..856a8f0da 100644
--- a/tests/ui/consts/issue-43105.stderr
+++ b/tests/ui/consts/issue-43105.stderr
@@ -12,12 +12,6 @@ error: could not evaluate constant pattern
LL | NUM => unimplemented!(),
| ^^^
-error: could not evaluate constant pattern
- --> $DIR/issue-43105.rs:8:9
- |
-LL | NUM => unimplemented!(),
- | ^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-56164.rs b/tests/ui/consts/issue-56164.rs
index 22c257d0b..00875c4b5 100644
--- a/tests/ui/consts/issue-56164.rs
+++ b/tests/ui/consts/issue-56164.rs
@@ -1,5 +1,6 @@
const fn foo() { (||{})() }
//~^ ERROR cannot call non-const closure
+//~| ERROR the trait bound
const fn bad(input: fn()) {
input()
diff --git a/tests/ui/consts/issue-56164.stderr b/tests/ui/consts/issue-56164.stderr
index 845b23d5d..003f84744 100644
--- a/tests/ui/consts/issue-56164.stderr
+++ b/tests/ui/consts/issue-56164.stderr
@@ -1,3 +1,17 @@
+error[E0277]: the trait bound `[closure@$DIR/issue-56164.rs:1:19: 1:21]: Fn<()>` is not satisfied
+ --> $DIR/issue-56164.rs:1:18
+ |
+LL | const fn foo() { (||{})() }
+ | ^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-56164.rs:1:19: 1:21]`
+ |
+ = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-56164.rs:1:19: 1:21]`
+note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-56164.rs:1:19: 1:21]`, but that implementation is not `const`
+ --> $DIR/issue-56164.rs:1:18
+ |
+LL | const fn foo() { (||{})() }
+ | ^^^^^^^^
+ = note: wrap the `[closure@$DIR/issue-56164.rs:1:19: 1:21]` in a closure with no arguments: `|| { /* code */ }`
+
error[E0015]: cannot call non-const closure in constant functions
--> $DIR/issue-56164.rs:1:18
|
@@ -9,7 +23,7 @@ LL | const fn foo() { (||{})() }
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
error: function pointer calls are not allowed in constant functions
- --> $DIR/issue-56164.rs:5:5
+ --> $DIR/issue-56164.rs:6:5
|
LL | input()
| ^^^^^^^
@@ -26,6 +40,7 @@ note: erroneous constant used
LL | const fn foo() { (||{})() }
| ^^^^^^
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-64506.rs b/tests/ui/consts/issue-64506.rs
index db3e85a7b..9275a8a07 100644
--- a/tests/ui/consts/issue-64506.rs
+++ b/tests/ui/consts/issue-64506.rs
@@ -1,4 +1,4 @@
-// check-pass
+// check-fail
#[derive(Copy, Clone)]
pub struct ChildStdin {
@@ -14,6 +14,7 @@ const FOO: () = {
b: (),
}
let x = unsafe { Foo { b: () }.a };
+ //~^ ERROR: evaluation of constant value failed
let x = &x.inner;
};
diff --git a/tests/ui/consts/issue-64506.stderr b/tests/ui/consts/issue-64506.stderr
new file mode 100644
index 000000000..31a5b1df8
--- /dev/null
+++ b/tests/ui/consts/issue-64506.stderr
@@ -0,0 +1,9 @@
+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
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/issue-68542-closure-in-array-len.rs b/tests/ui/consts/issue-68542-closure-in-array-len.rs
index 37958e791..a88e0cc60 100644
--- a/tests/ui/consts/issue-68542-closure-in-array-len.rs
+++ b/tests/ui/consts/issue-68542-closure-in-array-len.rs
@@ -4,6 +4,7 @@
struct Bug {
a: [(); (|| { 0 })()] //~ ERROR cannot call non-const closure
+ //~^ ERROR the trait bound
}
fn main() {}
diff --git a/tests/ui/consts/issue-68542-closure-in-array-len.stderr b/tests/ui/consts/issue-68542-closure-in-array-len.stderr
index d23513ed7..ace62f09d 100644
--- a/tests/ui/consts/issue-68542-closure-in-array-len.stderr
+++ b/tests/ui/consts/issue-68542-closure-in-array-len.stderr
@@ -1,3 +1,17 @@
+error[E0277]: the trait bound `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]: Fn<()>` is not satisfied
+ --> $DIR/issue-68542-closure-in-array-len.rs:6:13
+ |
+LL | a: [(); (|| { 0 })()]
+ | ^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`
+ |
+ = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`
+note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`, but that implementation is not `const`
+ --> $DIR/issue-68542-closure-in-array-len.rs:6:13
+ |
+LL | a: [(); (|| { 0 })()]
+ | ^^^^^^^^^^^^
+ = note: wrap the `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]` in a closure with no arguments: `|| { /* code */ }`
+
error[E0015]: cannot call non-const closure in constants
--> $DIR/issue-68542-closure-in-array-len.rs:6:13
|
@@ -8,6 +22,7 @@ LL | a: [(); (|| { 0 })()]
= note: calls in constants 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
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-73976-polymorphic.rs b/tests/ui/consts/issue-73976-polymorphic.rs
index 787462da9..2c576d1f9 100644
--- a/tests/ui/consts/issue-73976-polymorphic.rs
+++ b/tests/ui/consts/issue-73976-polymorphic.rs
@@ -19,7 +19,6 @@ impl<T: 'static> GetTypeId<T> {
const fn check_type_id<T: 'static>() -> bool {
matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
//~^ ERROR constant pattern depends on a generic parameter
- //~| ERROR constant pattern depends on a generic parameter
}
pub struct GetTypeNameLen<T>(T);
@@ -31,7 +30,6 @@ impl<T: 'static> GetTypeNameLen<T> {
const fn check_type_name_len<T: 'static>() -> bool {
matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
//~^ ERROR constant pattern depends on a generic parameter
- //~| ERROR constant pattern depends on a generic parameter
}
fn main() {
diff --git a/tests/ui/consts/issue-73976-polymorphic.stderr b/tests/ui/consts/issue-73976-polymorphic.stderr
index 442ad23f2..97a5fbc57 100644
--- a/tests/ui/consts/issue-73976-polymorphic.stderr
+++ b/tests/ui/consts/issue-73976-polymorphic.stderr
@@ -5,22 +5,10 @@ LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
| ^^^^^^^^^^^^^^^^^^^^^
error: constant pattern depends on a generic parameter
- --> $DIR/issue-73976-polymorphic.rs:32:42
+ --> $DIR/issue-73976-polymorphic.rs:31:42
|
LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: constant pattern depends on a generic parameter
- --> $DIR/issue-73976-polymorphic.rs:20:37
- |
-LL | matches!(GetTypeId::<T>::VALUE, GetTypeId::<T>::VALUE)
- | ^^^^^^^^^^^^^^^^^^^^^
-
-error: constant pattern depends on a generic parameter
- --> $DIR/issue-73976-polymorphic.rs:32:42
- |
-LL | matches!(GetTypeNameLen::<T>::VALUE, GetTypeNameLen::<T>::VALUE)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
diff --git a/tests/ui/consts/issue-78655.rs b/tests/ui/consts/issue-78655.rs
index 82d2d7c21..cd95ee32c 100644
--- a/tests/ui/consts/issue-78655.rs
+++ b/tests/ui/consts/issue-78655.rs
@@ -6,5 +6,4 @@ const FOO: *const u32 = {
fn main() {
let FOO = FOO;
//~^ ERROR could not evaluate constant pattern
- //~| ERROR could not evaluate constant pattern
}
diff --git a/tests/ui/consts/issue-78655.stderr b/tests/ui/consts/issue-78655.stderr
index 6b83fa0e5..5a38d023d 100644
--- a/tests/ui/consts/issue-78655.stderr
+++ b/tests/ui/consts/issue-78655.stderr
@@ -17,12 +17,6 @@ error: could not evaluate constant pattern
LL | let FOO = FOO;
| ^^^
-error: could not evaluate constant pattern
- --> $DIR/issue-78655.rs:7:9
- |
-LL | let FOO = FOO;
- | ^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0381`.
diff --git a/tests/ui/consts/issue-79137-toogeneric.rs b/tests/ui/consts/issue-79137-toogeneric.rs
index 456035458..a80c9f48d 100644
--- a/tests/ui/consts/issue-79137-toogeneric.rs
+++ b/tests/ui/consts/issue-79137-toogeneric.rs
@@ -11,7 +11,6 @@ impl<T> GetVariantCount<T> {
const fn check_variant_count<T>() -> bool {
matches!(GetVariantCount::<T>::VALUE, GetVariantCount::<T>::VALUE)
//~^ ERROR constant pattern depends on a generic parameter
- //~| ERROR constant pattern depends on a generic parameter
}
fn main() {
diff --git a/tests/ui/consts/issue-79137-toogeneric.stderr b/tests/ui/consts/issue-79137-toogeneric.stderr
index 579e6aa09..efe4fd22e 100644
--- a/tests/ui/consts/issue-79137-toogeneric.stderr
+++ b/tests/ui/consts/issue-79137-toogeneric.stderr
@@ -4,11 +4,5 @@ error: constant pattern depends on a generic parameter
LL | matches!(GetVariantCount::<T>::VALUE, GetVariantCount::<T>::VALUE)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: constant pattern depends on a generic parameter
- --> $DIR/issue-79137-toogeneric.rs:12:43
- |
-LL | matches!(GetVariantCount::<T>::VALUE, GetVariantCount::<T>::VALUE)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
+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 61865b1da..a10eea9de 100644
--- a/tests/ui/consts/issue-miri-1910.stderr
+++ b/tests/ui/consts/issue-miri-1910.stderr
@@ -1,7 +1,7 @@
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
- = note: unable to copy parts of a pointer from memory at ALLOC
+ = 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
diff --git a/tests/ui/consts/match_ice.stderr b/tests/ui/consts/match_ice.stderr
index 699b4a5e2..342d94ed3 100644
--- a/tests/ui/consts/match_ice.stderr
+++ b/tests/ui/consts/match_ice.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `S` in a pattern, `S` must be annotated with `#
|
LL | C => {}
| ^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
index 778b0e55f..7ec2508ca 100644
--- a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
+++ b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
@@ -22,11 +22,13 @@ LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
help: if it is not part of the public API, make this function unstably const
|
-LL | #[rustc_const_unstable(feature = "...", issue = "...")]
+LL + #[rustc_const_unstable(feature = "...", issue = "...")]
+LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
|
-LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
+LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
+LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
error: `foo2_gated` is not yet stable as a const fn
diff --git a/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs b/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
index a6e1788bb..df20ff446 100644
--- a/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
+++ b/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
@@ -7,4 +7,7 @@ const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
//~^ dereferencing raw mutable pointers in constant functions
+const unsafe fn bad_const_unsafe_deref_raw_underscore(x: *mut usize) { let _ = *x; }
+//~^ dereferencing raw mutable pointers in constant functions
+
fn main() {}
diff --git a/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr b/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
index 820b6433f..e68376e7b 100644
--- a/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
+++ b/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
@@ -25,6 +25,15 @@ LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static u
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-error: aborting due to 3 previous errors
+error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
+ --> $DIR/min_const_fn_unsafe_bad.rs:10:80
+ |
+LL | const unsafe fn bad_const_unsafe_deref_raw_underscore(x: *mut usize) { let _ = *x; }
+ | ^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
index 0174cb77f..72c1f175d 100644
--- a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
+++ b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
@@ -22,11 +22,13 @@ LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
help: if it is not part of the public API, make this function unstably const
|
-LL | #[rustc_const_unstable(feature = "...", issue = "...")]
+LL + #[rustc_const_unstable(feature = "...", issue = "...")]
+LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
|
-LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
+LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
+LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
error: `foo2_gated` is not yet stable as a const fn
diff --git a/tests/ui/consts/miri_unleashed/assoc_const.stderr b/tests/ui/consts/miri_unleashed/assoc_const.stderr
index e1da43c3a..8e22cb74b 100644
--- a/tests/ui/consts/miri_unleashed/assoc_const.stderr
+++ b/tests/ui/consts/miri_unleashed/assoc_const.stderr
@@ -25,12 +25,6 @@ note: erroneous constant used
LL | let y = <String as Bar<Vec<u32>, String>>::F;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: erroneous constant used
- --> $DIR/assoc_const.rs:29:13
- |
-LL | let y = <String as Bar<Vec<u32>, String>>::F;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
diff --git a/tests/ui/consts/miri_unleashed/assoc_const_2.stderr b/tests/ui/consts/miri_unleashed/assoc_const_2.stderr
index fc4b18056..ae7b03fc9 100644
--- a/tests/ui/consts/miri_unleashed/assoc_const_2.stderr
+++ b/tests/ui/consts/miri_unleashed/assoc_const_2.stderr
@@ -16,12 +16,6 @@ note: erroneous constant used
LL | let y = <String as Bar<String>>::F;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: erroneous constant used
- --> $DIR/assoc_const_2.rs:27:13
- |
-LL | let y = <String as Bar<String>>::F;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
error: aborting due to previous error
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/miri_unleashed/box.rs b/tests/ui/consts/miri_unleashed/box.rs
index c2a260aa1..39cddda2b 100644
--- a/tests/ui/consts/miri_unleashed/box.rs
+++ b/tests/ui/consts/miri_unleashed/box.rs
@@ -1,12 +1,11 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![feature(box_syntax)]
use std::mem::ManuallyDrop;
fn main() {}
static TEST_BAD: &mut i32 = {
- &mut *(box 0)
+ &mut *(Box::new(0))
//~^ ERROR could not evaluate static initializer
- //~| NOTE calling non-const function `alloc::alloc::exchange_malloc`
+ //~| NOTE calling non-const function `Box::<i32>::new`
};
diff --git a/tests/ui/consts/miri_unleashed/box.stderr b/tests/ui/consts/miri_unleashed/box.stderr
index bc5d4a257..407f5d8cb 100644
--- a/tests/ui/consts/miri_unleashed/box.stderr
+++ b/tests/ui/consts/miri_unleashed/box.stderr
@@ -1,31 +1,26 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/box.rs:9:11
+ --> $DIR/box.rs:8:11
|
-LL | &mut *(box 0)
- | ^^^^^^^ calling non-const function `alloc::alloc::exchange_malloc`
+LL | &mut *(Box::new(0))
+ | ^^^^^^^^^^^^^ calling non-const function `Box::<i32>::new`
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/box.rs:9:11
+ --> $DIR/box.rs:8:11
|
-LL | &mut *(box 0)
- | ^^^^^^^
+LL | &mut *(Box::new(0))
+ | ^^^^^^^^^^^^^
help: skipping check for `const_mut_refs` feature
- --> $DIR/box.rs:9:16
+ --> $DIR/box.rs:8:5
|
-LL | &mut *(box 0)
- | ^
-help: skipping check for `const_mut_refs` feature
- --> $DIR/box.rs:9:5
- |
-LL | &mut *(box 0)
- | ^^^^^^^^^^^^^
+LL | &mut *(Box::new(0))
+ | ^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/box.rs:9:5
+ --> $DIR/box.rs:8:5
|
-LL | &mut *(box 0)
- | ^^^^^^^^^^^^^
+LL | &mut *(Box::new(0))
+ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
index 6df2fe3d0..e3a0d93f0 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
@@ -27,7 +27,7 @@ LL | const U8_MUT: &u8 = {
}
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:43:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:42:9
|
LL | U8_MUT => true,
| ^^^^^^
@@ -39,7 +39,7 @@ LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:54:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:52:9
|
LL | U8_MUT2 => true,
| ^^^^^^^
@@ -51,31 +51,7 @@ LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None =>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:62:9
- |
-LL | U8_MUT3 => true,
- | ^^^^^^^
-
-error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:34:9
- |
-LL | SLICE_MUT => true,
- | ^^^^^^^^^
-
-error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:43:9
- |
-LL | U8_MUT => true,
- | ^^^^^^
-
-error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:54:9
- |
-LL | U8_MUT2 => true,
- | ^^^^^^^
-
-error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:62:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:59:9
|
LL | U8_MUT3 => true,
| ^^^^^^^
@@ -133,6 +109,6 @@ help: skipping check that does not even have a feature gate
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 12 previous errors; 1 warning emitted
+error: aborting due to 8 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
index 8802f3ada..a323e9a05 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
@@ -27,7 +27,7 @@ LL | const U8_MUT: &u8 = {
}
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:43:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:42:9
|
LL | U8_MUT => true,
| ^^^^^^
@@ -39,7 +39,7 @@ LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:54:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:52:9
|
LL | U8_MUT2 => true,
| ^^^^^^^
@@ -51,31 +51,7 @@ LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None =>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:62:9
- |
-LL | U8_MUT3 => true,
- | ^^^^^^^
-
-error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:34:9
- |
-LL | SLICE_MUT => true,
- | ^^^^^^^^^
-
-error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:43:9
- |
-LL | U8_MUT => true,
- | ^^^^^^
-
-error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:54:9
- |
-LL | U8_MUT2 => true,
- | ^^^^^^^
-
-error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:62:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:59:9
|
LL | U8_MUT3 => true,
| ^^^^^^^
@@ -133,6 +109,6 @@ help: skipping check that does not even have a feature gate
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 12 previous errors; 1 warning emitted
+error: aborting due to 8 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
index bf4f14f4d..bbaa32ddf 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
@@ -33,7 +33,6 @@ pub fn test(x: &[u8; 1]) -> bool {
match x {
SLICE_MUT => true,
//~^ ERROR could not evaluate constant pattern
- //~| ERROR could not evaluate constant pattern
&[1..] => false,
}
}
@@ -42,7 +41,6 @@ pub fn test2(x: &u8) -> bool {
match x {
U8_MUT => true,
//~^ ERROR could not evaluate constant pattern
- //~| ERROR could not evaluate constant pattern
&(1..) => false,
}
}
@@ -53,7 +51,6 @@ pub fn test3(x: &u8) -> bool {
match x {
U8_MUT2 => true,
//~^ ERROR could not evaluate constant pattern
- //~| ERROR could not evaluate constant pattern
&(1..) => false,
}
}
@@ -61,7 +58,6 @@ pub fn test4(x: &u8) -> bool {
match x {
U8_MUT3 => true,
//~^ ERROR could not evaluate constant pattern
- //~| ERROR could not evaluate constant pattern
&(1..) => false,
}
}
diff --git a/tests/ui/consts/miri_unleashed/tls.stderr b/tests/ui/consts/miri_unleashed/tls.stderr
index 7aaeadd04..ec24527d6 100644
--- a/tests/ui/consts/miri_unleashed/tls.stderr
+++ b/tests/ui/consts/miri_unleashed/tls.stderr
@@ -2,13 +2,13 @@ error[E0080]: could not evaluate static initializer
--> $DIR/tls.rs:11:25
|
LL | unsafe { let _val = A; }
- | ^ cannot access thread local static (DefId(0:4 ~ tls[78b0]::A))
+ | ^ cannot access thread local static (DefId(0:4 ~ tls[ca29]::A))
error[E0080]: could not evaluate static initializer
--> $DIR/tls.rs:18:26
|
LL | unsafe { let _val = &A; }
- | ^ cannot access thread local static (DefId(0:4 ~ tls[78b0]::A))
+ | ^ cannot access thread local static (DefId(0:4 ~ tls[ca29]::A))
warning: skipping const checks
|
diff --git a/tests/ui/consts/offset_from_ub.stderr b/tests/ui/consts/offset_from_ub.stderr
index fff472968..6530084a5 100644
--- a/tests/ui/consts/offset_from_ub.stderr
+++ b/tests/ui/consts/offset_from_ub.stderr
@@ -39,19 +39,19 @@ 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: alloc18 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: alloc21 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: alloc24 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
diff --git a/tests/ui/consts/uninhabited-const-issue-61744.stderr b/tests/ui/consts/uninhabited-const-issue-61744.stderr
index 3a94e1931..adefbf336 100644
--- a/tests/ui/consts/uninhabited-const-issue-61744.stderr
+++ b/tests/ui/consts/uninhabited-const-issue-61744.stderr
@@ -657,12 +657,6 @@ note: erroneous constant used
LL | dbg!(i32::CONSTANT);
| ^^^^^^^^^^^^^
-note: erroneous constant used
- --> $DIR/uninhabited-const-issue-61744.rs:18:10
- |
-LL | dbg!(i32::CONSTANT);
- | ^^^^^^^^^^^^^
-
error: aborting due to previous error
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr b/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr
index f6ffcc4b5..e2b2aac05 100644
--- a/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr
+++ b/tests/ui/cycle-trait/cycle-trait-supertrait-direct.stderr
@@ -1,15 +1,10 @@
error[E0391]: cycle detected when computing the super predicates of `Chromosome`
- --> $DIR/cycle-trait-supertrait-direct.rs:3:1
- |
-LL | trait Chromosome: Chromosome {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: ...which requires computing the super traits of `Chromosome`...
--> $DIR/cycle-trait-supertrait-direct.rs:3:19
|
LL | trait Chromosome: Chromosome {
| ^^^^^^^^^^
- = note: ...which again requires computing the super predicates of `Chromosome`, completing the cycle
+ |
+ = note: ...which immediately requires computing the super predicates of `Chromosome` again
note: cycle used when collecting item types in top-level module
--> $DIR/cycle-trait-supertrait-direct.rs:3:1
|
diff --git a/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr b/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr
index 0a2284e0e..c903e1146 100644
--- a/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr
+++ b/tests/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr
@@ -1,26 +1,16 @@
error[E0391]: cycle detected when computing the super predicates of `B`
- --> $DIR/cycle-trait-supertrait-indirect.rs:7:1
- |
-LL | trait B: C {
- | ^^^^^^^^^^
- |
-note: ...which requires computing the super traits of `B`...
--> $DIR/cycle-trait-supertrait-indirect.rs:7:10
|
LL | trait B: C {
| ^
-note: ...which requires computing the super predicates of `C`...
- --> $DIR/cycle-trait-supertrait-indirect.rs:11:1
|
-LL | trait C: B { }
- | ^^^^^^^^^^
-note: ...which requires computing the super traits of `C`...
+note: ...which requires computing the super predicates of `C`...
--> $DIR/cycle-trait-supertrait-indirect.rs:11:10
|
LL | trait C: B { }
| ^
= note: ...which again requires computing the super predicates of `B`, completing the cycle
-note: cycle used when computing the super traits of `A`
+note: cycle used when computing the super predicates of `A`
--> $DIR/cycle-trait-supertrait-indirect.rs:4:10
|
LL | trait A: B {
diff --git a/tests/ui/derived-errors/issue-31997-1.stderr b/tests/ui/derived-errors/issue-31997-1.stderr
index 2f4aabf84..a0262f4c1 100644
--- a/tests/ui/derived-errors/issue-31997-1.stderr
+++ b/tests/ui/derived-errors/issue-31997-1.stderr
@@ -6,7 +6,7 @@ LL | let mut map = HashMap::new();
|
help: consider importing this struct
|
-LL | use std::collections::HashMap;
+LL + use std::collections::HashMap;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derive-assoc-type-not-impl.stderr b/tests/ui/derives/derive-assoc-type-not-impl.stderr
index 91b334b41..9f17c76c2 100644
--- a/tests/ui/derives/derive-assoc-type-not-impl.stderr
+++ b/tests/ui/derives/derive-assoc-type-not-impl.stderr
@@ -23,7 +23,8 @@ LL | #[derive(Clone)]
candidate #1: `Clone`
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NotClone;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Clone-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Clone-enum-struct-variant.stderr
index 7326324b0..31ab589cf 100644
--- a/tests/ui/derives/derives-span-Clone-enum-struct-variant.stderr
+++ b/tests/ui/derives/derives-span-Clone-enum-struct-variant.stderr
@@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Clone-enum.stderr b/tests/ui/derives/derives-span-Clone-enum.stderr
index 229a4f7d9..b5580c02f 100644
--- a/tests/ui/derives/derives-span-Clone-enum.stderr
+++ b/tests/ui/derives/derives-span-Clone-enum.stderr
@@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Clone-struct.stderr b/tests/ui/derives/derives-span-Clone-struct.stderr
index 96bad9eda..fbe7e3f84 100644
--- a/tests/ui/derives/derives-span-Clone-struct.stderr
+++ b/tests/ui/derives/derives-span-Clone-struct.stderr
@@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Clone-tuple-struct.stderr b/tests/ui/derives/derives-span-Clone-tuple-struct.stderr
index b61341e57..639f4d542 100644
--- a/tests/ui/derives/derives-span-Clone-tuple-struct.stderr
+++ b/tests/ui/derives/derives-span-Clone-tuple-struct.stderr
@@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Debug-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Debug-enum-struct-variant.stderr
index 58a64a4f5..7ff6851f6 100644
--- a/tests/ui/derives/derives-span-Debug-enum-struct-variant.stderr
+++ b/tests/ui/derives/derives-span-Debug-enum-struct-variant.stderr
@@ -12,7 +12,8 @@ LL | x: Error
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`
|
-LL | #[derive(Debug)]
+LL + #[derive(Debug)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Debug-enum.stderr b/tests/ui/derives/derives-span-Debug-enum.stderr
index e9bb5f960..346cbec90 100644
--- a/tests/ui/derives/derives-span-Debug-enum.stderr
+++ b/tests/ui/derives/derives-span-Debug-enum.stderr
@@ -12,7 +12,8 @@ LL | Error
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`
|
-LL | #[derive(Debug)]
+LL + #[derive(Debug)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Debug-struct.stderr b/tests/ui/derives/derives-span-Debug-struct.stderr
index 0a117c060..4b39eeb09 100644
--- a/tests/ui/derives/derives-span-Debug-struct.stderr
+++ b/tests/ui/derives/derives-span-Debug-struct.stderr
@@ -12,7 +12,8 @@ LL | x: Error
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`
|
-LL | #[derive(Debug)]
+LL + #[derive(Debug)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Debug-tuple-struct.stderr b/tests/ui/derives/derives-span-Debug-tuple-struct.stderr
index f2e90a418..f3043abca 100644
--- a/tests/ui/derives/derives-span-Debug-tuple-struct.stderr
+++ b/tests/ui/derives/derives-span-Debug-tuple-struct.stderr
@@ -12,7 +12,8 @@ LL | Error
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`
|
-LL | #[derive(Debug)]
+LL + #[derive(Debug)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Default-struct.stderr b/tests/ui/derives/derives-span-Default-struct.stderr
index d4affd535..4844b6359 100644
--- a/tests/ui/derives/derives-span-Default-struct.stderr
+++ b/tests/ui/derives/derives-span-Default-struct.stderr
@@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Default)]`
|
-LL | #[derive(Default)]
+LL + #[derive(Default)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Default-tuple-struct.stderr b/tests/ui/derives/derives-span-Default-tuple-struct.stderr
index 129351f59..9cac7f107 100644
--- a/tests/ui/derives/derives-span-Default-tuple-struct.stderr
+++ b/tests/ui/derives/derives-span-Default-tuple-struct.stderr
@@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Default)]`
|
-LL | #[derive(Default)]
+LL + #[derive(Default)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Eq-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Eq-enum-struct-variant.stderr
index 2be69a30b..1a9ff9832 100644
--- a/tests/ui/derives/derives-span-Eq-enum-struct-variant.stderr
+++ b/tests/ui/derives/derives-span-Eq-enum-struct-variant.stderr
@@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Eq)]`
|
-LL | #[derive(Eq)]
+LL + #[derive(Eq)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Eq-enum.stderr b/tests/ui/derives/derives-span-Eq-enum.stderr
index 4f4f821cc..8205657bb 100644
--- a/tests/ui/derives/derives-span-Eq-enum.stderr
+++ b/tests/ui/derives/derives-span-Eq-enum.stderr
@@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Eq)]`
|
-LL | #[derive(Eq)]
+LL + #[derive(Eq)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Eq-struct.stderr b/tests/ui/derives/derives-span-Eq-struct.stderr
index f15659c3e..af510181d 100644
--- a/tests/ui/derives/derives-span-Eq-struct.stderr
+++ b/tests/ui/derives/derives-span-Eq-struct.stderr
@@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Eq)]`
|
-LL | #[derive(Eq)]
+LL + #[derive(Eq)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Eq-tuple-struct.stderr b/tests/ui/derives/derives-span-Eq-tuple-struct.stderr
index 4e5659b35..f7c371d7d 100644
--- a/tests/ui/derives/derives-span-Eq-tuple-struct.stderr
+++ b/tests/ui/derives/derives-span-Eq-tuple-struct.stderr
@@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Eq)]`
|
-LL | #[derive(Eq)]
+LL + #[derive(Eq)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Hash-enum-struct-variant.stderr
index fe5e0e96a..311edade0 100644
--- a/tests/ui/derives/derives-span-Hash-enum-struct-variant.stderr
+++ b/tests/ui/derives/derives-span-Hash-enum-struct-variant.stderr
@@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Hash)]`
|
-LL | #[derive(Hash)]
+LL + #[derive(Hash)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Hash-enum.stderr b/tests/ui/derives/derives-span-Hash-enum.stderr
index 99785b87c..043aa954b 100644
--- a/tests/ui/derives/derives-span-Hash-enum.stderr
+++ b/tests/ui/derives/derives-span-Hash-enum.stderr
@@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Hash)]`
|
-LL | #[derive(Hash)]
+LL + #[derive(Hash)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Hash-struct.stderr b/tests/ui/derives/derives-span-Hash-struct.stderr
index 4db83dd13..26d31b661 100644
--- a/tests/ui/derives/derives-span-Hash-struct.stderr
+++ b/tests/ui/derives/derives-span-Hash-struct.stderr
@@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Hash)]`
|
-LL | #[derive(Hash)]
+LL + #[derive(Hash)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Hash-tuple-struct.stderr b/tests/ui/derives/derives-span-Hash-tuple-struct.stderr
index 8660c97e6..3155a023c 100644
--- a/tests/ui/derives/derives-span-Hash-tuple-struct.stderr
+++ b/tests/ui/derives/derives-span-Hash-tuple-struct.stderr
@@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Hash)]`
|
-LL | #[derive(Hash)]
+LL + #[derive(Hash)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Ord-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Ord-enum-struct-variant.stderr
index 6e48332c2..1a06aee52 100644
--- a/tests/ui/derives/derives-span-Ord-enum-struct-variant.stderr
+++ b/tests/ui/derives/derives-span-Ord-enum-struct-variant.stderr
@@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Ord)]`
|
-LL | #[derive(Ord)]
+LL + #[derive(Ord)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Ord-enum.stderr b/tests/ui/derives/derives-span-Ord-enum.stderr
index b05cf0a05..377728e8a 100644
--- a/tests/ui/derives/derives-span-Ord-enum.stderr
+++ b/tests/ui/derives/derives-span-Ord-enum.stderr
@@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Ord)]`
|
-LL | #[derive(Ord)]
+LL + #[derive(Ord)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Ord-struct.stderr b/tests/ui/derives/derives-span-Ord-struct.stderr
index c4def34a8..e00e990da 100644
--- a/tests/ui/derives/derives-span-Ord-struct.stderr
+++ b/tests/ui/derives/derives-span-Ord-struct.stderr
@@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Ord)]`
|
-LL | #[derive(Ord)]
+LL + #[derive(Ord)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-Ord-tuple-struct.stderr b/tests/ui/derives/derives-span-Ord-tuple-struct.stderr
index a3b288d0f..959d0b964 100644
--- a/tests/ui/derives/derives-span-Ord-tuple-struct.stderr
+++ b/tests/ui/derives/derives-span-Ord-tuple-struct.stderr
@@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Ord)]`
|
-LL | #[derive(Ord)]
+LL + #[derive(Ord)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr b/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
index 9953154fd..9fc25f2ad 100644
--- a/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
+++ b/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
@@ -15,7 +15,8 @@ LL | struct Error;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-PartialEq-enum.stderr b/tests/ui/derives/derives-span-PartialEq-enum.stderr
index 7c1304523..f56e78447 100644
--- a/tests/ui/derives/derives-span-PartialEq-enum.stderr
+++ b/tests/ui/derives/derives-span-PartialEq-enum.stderr
@@ -15,7 +15,8 @@ LL | struct Error;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-PartialEq-struct.stderr b/tests/ui/derives/derives-span-PartialEq-struct.stderr
index ba3d6ced3..76c0b0104 100644
--- a/tests/ui/derives/derives-span-PartialEq-struct.stderr
+++ b/tests/ui/derives/derives-span-PartialEq-struct.stderr
@@ -15,7 +15,8 @@ LL | struct Error;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-PartialEq-tuple-struct.stderr b/tests/ui/derives/derives-span-PartialEq-tuple-struct.stderr
index ab0b56a9e..7dae01dbb 100644
--- a/tests/ui/derives/derives-span-PartialEq-tuple-struct.stderr
+++ b/tests/ui/derives/derives-span-PartialEq-tuple-struct.stderr
@@ -15,7 +15,8 @@ LL | struct Error;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr b/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr
index 2d19aaf68..746c1d5d2 100644
--- a/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr
+++ b/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr
@@ -11,7 +11,8 @@ LL | x: Error
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
-LL | #[derive(PartialOrd)]
+LL + #[derive(PartialOrd)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-PartialOrd-enum.stderr b/tests/ui/derives/derives-span-PartialOrd-enum.stderr
index dfbb8060f..8af1776da 100644
--- a/tests/ui/derives/derives-span-PartialOrd-enum.stderr
+++ b/tests/ui/derives/derives-span-PartialOrd-enum.stderr
@@ -11,7 +11,8 @@ LL | Error
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
-LL | #[derive(PartialOrd)]
+LL + #[derive(PartialOrd)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-PartialOrd-struct.stderr b/tests/ui/derives/derives-span-PartialOrd-struct.stderr
index ba63d86e8..11ea7f9dc 100644
--- a/tests/ui/derives/derives-span-PartialOrd-struct.stderr
+++ b/tests/ui/derives/derives-span-PartialOrd-struct.stderr
@@ -11,7 +11,8 @@ LL | x: Error
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
-LL | #[derive(PartialOrd)]
+LL + #[derive(PartialOrd)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/derives-span-PartialOrd-tuple-struct.stderr b/tests/ui/derives/derives-span-PartialOrd-tuple-struct.stderr
index 7686ed806..0a41a3db3 100644
--- a/tests/ui/derives/derives-span-PartialOrd-tuple-struct.stderr
+++ b/tests/ui/derives/derives-span-PartialOrd-tuple-struct.stderr
@@ -11,7 +11,8 @@ LL | Error
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
-LL | #[derive(PartialOrd)]
+LL + #[derive(PartialOrd)]
+LL | struct Error;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/deriving-no-inner-impl-error-message.stderr b/tests/ui/derives/deriving-no-inner-impl-error-message.stderr
index ef8c44caa..10af5d36e 100644
--- a/tests/ui/derives/deriving-no-inner-impl-error-message.stderr
+++ b/tests/ui/derives/deriving-no-inner-impl-error-message.stderr
@@ -15,7 +15,8 @@ LL | struct NoCloneOrEq;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `NoCloneOrEq` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct NoCloneOrEq;
|
error[E0277]: the trait bound `NoCloneOrEq: Clone` is not satisfied
@@ -30,7 +31,8 @@ LL | x: NoCloneOrEq
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `NoCloneOrEq` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NoCloneOrEq;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/derives/deriving-with-repr-packed-2.stderr b/tests/ui/derives/deriving-with-repr-packed-2.stderr
index ab3646057..afeca9fec 100644
--- a/tests/ui/derives/deriving-with-repr-packed-2.stderr
+++ b/tests/ui/derives/deriving-with-repr-packed-2.stderr
@@ -25,7 +25,8 @@ LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
| ^^^^^ unsatisfied trait bound introduced in this `derive` macro
help: consider annotating `NonCopy` with `#[derive(Clone, Copy)]`
|
-LL | #[derive(Clone, Copy)]
+LL + #[derive(Clone, Copy)]
+LL | struct NonCopy;
|
error: aborting due to previous error
diff --git a/tests/ui/derives/issue-91492.stderr b/tests/ui/derives/issue-91492.stderr
index cee30ac50..fc64828b1 100644
--- a/tests/ui/derives/issue-91492.stderr
+++ b/tests/ui/derives/issue-91492.stderr
@@ -11,7 +11,8 @@ LL | foo.extend_from_slice(bar);
`NoDerives: Clone`
help: consider annotating `NoDerives` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | pub struct NoDerives;
|
error[E0599]: the method `extend_from_slice` exists for mutable reference `&mut Vec<SomeDerives>`, but its trait bounds were not satisfied
@@ -27,7 +28,8 @@ LL | foo.extend_from_slice(bar);
`SomeDerives: Clone`
help: consider annotating `SomeDerives` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | pub struct SomeDerives;
|
error[E0599]: the method `use_clone` exists for struct `Object<NoDerives, SomeDerives>`, but its trait bounds were not satisfied
@@ -51,7 +53,8 @@ LL | impl<T: Clone, A: Default> Object<T, A> {
| unsatisfied trait bound introduced here
help: consider annotating `NoDerives` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | pub struct NoDerives;
|
error: aborting due to 3 previous errors
diff --git a/tests/ui/derives/issue-91550.stderr b/tests/ui/derives/issue-91550.stderr
index af03f0e5e..1324b80b5 100644
--- a/tests/ui/derives/issue-91550.stderr
+++ b/tests/ui/derives/issue-91550.stderr
@@ -18,7 +18,8 @@ LL | hs.insert(Value(0));
`Value: Hash`
help: consider annotating `Value` with `#[derive(Eq, Hash, PartialEq)]`
|
-LL | #[derive(Eq, Hash, PartialEq)]
+LL + #[derive(Eq, Hash, PartialEq)]
+LL | struct Value(u32);
|
error[E0599]: the method `use_eq` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
@@ -48,7 +49,8 @@ LL | impl<T: Eq> Object<T> {
which is required by `NoDerives: Eq`
help: consider annotating `NoDerives` with `#[derive(Eq, PartialEq)]`
|
-LL | #[derive(Eq, PartialEq)]
+LL + #[derive(Eq, PartialEq)]
+LL | pub struct NoDerives;
|
error[E0599]: the method `use_ord` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
@@ -84,7 +86,8 @@ LL | impl<T: Ord> Object<T> {
which is required by `NoDerives: Ord`
help: consider annotating `NoDerives` with `#[derive(Eq, Ord, PartialEq, PartialOrd)]`
|
-LL | #[derive(Eq, Ord, PartialEq, PartialOrd)]
+LL + #[derive(Eq, Ord, PartialEq, PartialOrd)]
+LL | pub struct NoDerives;
|
error[E0599]: the method `use_ord_and_partial_ord` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
@@ -123,7 +126,8 @@ LL | impl<T: Ord + PartialOrd> Object<T> {
which is required by `NoDerives: PartialOrd`
help: consider annotating `NoDerives` with `#[derive(Eq, Ord, PartialEq, PartialOrd)]`
|
-LL | #[derive(Eq, Ord, PartialEq, PartialOrd)]
+LL + #[derive(Eq, Ord, PartialEq, PartialOrd)]
+LL | pub struct NoDerives;
|
error: aborting due to 4 previous errors
diff --git a/tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs b/tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs
new file mode 100644
index 000000000..93418b765
--- /dev/null
+++ b/tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs
@@ -0,0 +1,6 @@
+// ignore-tidy-tab
+
+pub struct S;
+impl S {
+ fn method(&self) {}
+}
diff --git a/tests/ui/diagnostic-width/tab-column-numbers.rs b/tests/ui/diagnostic-width/tab-column-numbers.rs
new file mode 100644
index 000000000..2abb0bcde
--- /dev/null
+++ b/tests/ui/diagnostic-width/tab-column-numbers.rs
@@ -0,0 +1,12 @@
+// Test for #109537: ensure that column numbers are correctly generated when using hard tabs.
+// aux-build:tab_column_numbers.rs
+
+// ignore-tidy-tab
+
+extern crate tab_column_numbers;
+
+fn main() {
+ let s = tab_column_numbers::S;
+ s.method();
+ //~^ ERROR method `method` is private
+}
diff --git a/tests/ui/diagnostic-width/tab-column-numbers.stderr b/tests/ui/diagnostic-width/tab-column-numbers.stderr
new file mode 100644
index 000000000..ea4e1ff52
--- /dev/null
+++ b/tests/ui/diagnostic-width/tab-column-numbers.stderr
@@ -0,0 +1,14 @@
+error[E0624]: method `method` is private
+ --> $DIR/tab-column-numbers.rs:10:4
+ |
+LL | s.method();
+ | ^^^^^^ private method
+ |
+ ::: $DIR/auxiliary/tab_column_numbers.rs:5:3
+ |
+LL | fn method(&self) {}
+ | ---------------- private method defined here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0624`.
diff --git a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr
index abc040c05..5c610f363 100644
--- a/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr
+++ b/tests/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr
@@ -24,13 +24,13 @@ LL | fn setup() -> Set { Set }
|
help: consider importing one of these items
|
-LL | use AffixHeart::Set;
+LL + use AffixHeart::Set;
|
-LL | use CauseToBe::Set;
+LL + use CauseToBe::Set;
|
-LL | use Determine::Set;
+LL + use Determine::Set;
|
-LL | use PutDown::Set;
+LL + use PutDown::Set;
|
and 3 other candidates
diff --git a/tests/ui/did_you_mean/recursion_limit.stderr b/tests/ui/did_you_mean/recursion_limit.stderr
index 247fe4b5b..70e49566a 100644
--- a/tests/ui/did_you_mean/recursion_limit.stderr
+++ b/tests/ui/did_you_mean/recursion_limit.stderr
@@ -1,15 +1,10 @@
-error[E0275]: overflow evaluating the requirement `K: Send`
+error[E0275]: overflow evaluating the requirement `J: Send`
--> $DIR/recursion_limit.rs:34:5
|
LL | is_send::<A>();
| ^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]` attribute to your crate (`recursion_limit`)
-note: required because it appears within the type `J`
- --> $DIR/recursion_limit.rs:24:9
- |
-LL | link! { J, K }
- | ^
note: required because it appears within the type `I`
--> $DIR/recursion_limit.rs:23:9
|
diff --git a/tests/ui/did_you_mean/recursion_limit_deref.stderr b/tests/ui/did_you_mean/recursion_limit_deref.stderr
index 32fb628c4..b0c493faf 100644
--- a/tests/ui/did_you_mean/recursion_limit_deref.stderr
+++ b/tests/ui/did_you_mean/recursion_limit_deref.stderr
@@ -1,3 +1,7 @@
+error: reached the recursion limit finding the struct tail for `Bottom`
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]`
+
error[E0055]: reached the recursion limit while auto-dereferencing `J`
--> $DIR/recursion_limit_deref.rs:51:22
|
@@ -17,7 +21,7 @@ LL | let x: &Bottom = &t;
= note: expected reference `&Bottom`
found reference `&Top`
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
Some errors have detailed explanations: E0055, E0308.
For more information about an error, try `rustc --explain E0055`.
diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-1.rs b/tests/ui/dst/issue-90528-unsizing-suggestion-1.rs
new file mode 100644
index 000000000..52863e22b
--- /dev/null
+++ b/tests/ui/dst/issue-90528-unsizing-suggestion-1.rs
@@ -0,0 +1,20 @@
+// Issue #90528: provide helpful suggestions when a trait bound is unsatisfied
+// due to a missed unsizing coercion.
+//
+// This test exercises array literals and a trait implemented on immutable slices.
+
+trait Read {}
+
+impl Read for &[u8] {}
+
+fn wants_read(_: impl Read) {}
+
+fn main() {
+ wants_read([0u8]);
+ //~^ ERROR the trait bound `[u8; 1]: Read` is not satisfied
+ wants_read(&[0u8]);
+ //~^ ERROR the trait bound `&[u8; 1]: Read` is not satisfied
+ wants_read(&[0u8][..]);
+ wants_read(&mut [0u8]);
+ //~^ ERROR the trait bound `&mut [u8; 1]: Read` is not satisfied
+}
diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-1.stderr b/tests/ui/dst/issue-90528-unsizing-suggestion-1.stderr
new file mode 100644
index 000000000..27ef3fe97
--- /dev/null
+++ b/tests/ui/dst/issue-90528-unsizing-suggestion-1.stderr
@@ -0,0 +1,56 @@
+error[E0277]: the trait bound `[u8; 1]: Read` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-1.rs:13:16
+ |
+LL | wants_read([0u8]);
+ | ---------- ^^^^^ the trait `Read` is not implemented for `[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Read` is implemented for `&[u8]`
+note: required by a bound in `wants_read`
+ --> $DIR/issue-90528-unsizing-suggestion-1.rs:10:23
+ |
+LL | fn wants_read(_: impl Read) {}
+ | ^^^^ required by this bound in `wants_read`
+help: convert the array to a `&[u8]` slice instead
+ |
+LL | wants_read(&[0u8][..]);
+ | + ++++
+
+error[E0277]: the trait bound `&[u8; 1]: Read` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-1.rs:15:16
+ |
+LL | wants_read(&[0u8]);
+ | ---------- ^^^^^^ the trait `Read` is not implemented for `&[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Read` is implemented for `&[u8]`
+note: required by a bound in `wants_read`
+ --> $DIR/issue-90528-unsizing-suggestion-1.rs:10:23
+ |
+LL | fn wants_read(_: impl Read) {}
+ | ^^^^ required by this bound in `wants_read`
+help: convert the array to a `&[u8]` slice instead
+ |
+LL | wants_read(&[0u8][..]);
+ | ++++
+
+error[E0277]: the trait bound `&mut [u8; 1]: Read` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-1.rs:18:16
+ |
+LL | wants_read(&mut [0u8]);
+ | ---------- ^^^^^^^^^^ the trait `Read` is not implemented for `&mut [u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Read` is implemented for `&[u8]`
+note: required by a bound in `wants_read`
+ --> $DIR/issue-90528-unsizing-suggestion-1.rs:10:23
+ |
+LL | fn wants_read(_: impl Read) {}
+ | ^^^^ required by this bound in `wants_read`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-2.rs b/tests/ui/dst/issue-90528-unsizing-suggestion-2.rs
new file mode 100644
index 000000000..f2762ad42
--- /dev/null
+++ b/tests/ui/dst/issue-90528-unsizing-suggestion-2.rs
@@ -0,0 +1,28 @@
+// Issue #90528: provide helpful suggestions when a trait bound is unsatisfied
+// due to a missed unsizing coercion.
+//
+// This test exercises array variables and a trait implemented on immmutable slices.
+
+trait Read {}
+
+impl Read for &[u8] {}
+
+fn wants_read(_: impl Read) {}
+
+fn main() {
+ let x = [0u8];
+ wants_read(x);
+ //~^ ERROR the trait bound `[u8; 1]: Read` is not satisfied
+ wants_read(&x);
+ //~^ ERROR the trait bound `&[u8; 1]: Read` is not satisfied
+ wants_read(&x[..]);
+
+ let x = &[0u8];
+ wants_read(x);
+ //~^ ERROR the trait bound `&[u8; 1]: Read` is not satisfied
+ wants_read(&x);
+ //~^ ERROR the trait bound `&&[u8; 1]: Read` is not satisfied
+ wants_read(*x);
+ //~^ ERROR the trait bound `[u8; 1]: Read` is not satisfied
+ wants_read(&x[..]);
+}
diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-2.stderr b/tests/ui/dst/issue-90528-unsizing-suggestion-2.stderr
new file mode 100644
index 000000000..ae0c4ca50
--- /dev/null
+++ b/tests/ui/dst/issue-90528-unsizing-suggestion-2.stderr
@@ -0,0 +1,94 @@
+error[E0277]: the trait bound `[u8; 1]: Read` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:14:16
+ |
+LL | wants_read(x);
+ | ---------- ^ the trait `Read` is not implemented for `[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Read` is implemented for `&[u8]`
+note: required by a bound in `wants_read`
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:10:23
+ |
+LL | fn wants_read(_: impl Read) {}
+ | ^^^^ required by this bound in `wants_read`
+help: convert the array to a `&[u8]` slice instead
+ |
+LL | wants_read(&x[..]);
+ | + ++++
+
+error[E0277]: the trait bound `&[u8; 1]: Read` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:16:16
+ |
+LL | wants_read(&x);
+ | ---------- ^^ the trait `Read` is not implemented for `&[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Read` is implemented for `&[u8]`
+note: required by a bound in `wants_read`
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:10:23
+ |
+LL | fn wants_read(_: impl Read) {}
+ | ^^^^ required by this bound in `wants_read`
+help: convert the array to a `&[u8]` slice instead
+ |
+LL | wants_read(&x[..]);
+ | ++++
+
+error[E0277]: the trait bound `&[u8; 1]: Read` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:21:16
+ |
+LL | wants_read(x);
+ | ---------- ^ the trait `Read` is not implemented for `&[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Read` is implemented for `&[u8]`
+note: required by a bound in `wants_read`
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:10:23
+ |
+LL | fn wants_read(_: impl Read) {}
+ | ^^^^ required by this bound in `wants_read`
+help: convert the array to a `&[u8]` slice instead
+ |
+LL | wants_read(&x[..]);
+ | + ++++
+
+error[E0277]: the trait bound `&&[u8; 1]: Read` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:23:16
+ |
+LL | wants_read(&x);
+ | ---------- ^^ the trait `Read` is not implemented for `&&[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Read` is implemented for `&[u8]`
+note: required by a bound in `wants_read`
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:10:23
+ |
+LL | fn wants_read(_: impl Read) {}
+ | ^^^^ required by this bound in `wants_read`
+
+error[E0277]: the trait bound `[u8; 1]: Read` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:25:16
+ |
+LL | wants_read(*x);
+ | ---------- ^^ the trait `Read` is not implemented for `[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Read` is implemented for `&[u8]`
+note: required by a bound in `wants_read`
+ --> $DIR/issue-90528-unsizing-suggestion-2.rs:10:23
+ |
+LL | fn wants_read(_: impl Read) {}
+ | ^^^^ required by this bound in `wants_read`
+help: convert the array to a `&[u8]` slice instead
+ |
+LL | wants_read(&*x[..]);
+ | + ++++
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-3.rs b/tests/ui/dst/issue-90528-unsizing-suggestion-3.rs
new file mode 100644
index 000000000..218843d05
--- /dev/null
+++ b/tests/ui/dst/issue-90528-unsizing-suggestion-3.rs
@@ -0,0 +1,22 @@
+// Issue #90528: provide helpful suggestions when a trait bound is unsatisfied
+// due to a missed unsizing coercion.
+//
+// This test exercises array literals and a trait implemented on mutable slices.
+
+trait Write {}
+
+impl Write for &mut [u8] {}
+
+fn wants_write(_: impl Write) {}
+
+fn main() {
+ wants_write([0u8]);
+ //~^ ERROR the trait bound `[u8; 1]: Write` is not satisfied
+ wants_write(&mut [0u8]);
+ //~^ ERROR the trait bound `&mut [u8; 1]: Write` is not satisfied
+ wants_write(&mut [0u8][..]);
+ wants_write(&[0u8]);
+ //~^ ERROR the trait bound `&[u8; 1]: Write` is not satisfied
+ wants_write(&[0u8][..]);
+ //~^ ERROR the trait bound `&[u8]: Write` is not satisfied
+}
diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-3.stderr b/tests/ui/dst/issue-90528-unsizing-suggestion-3.stderr
new file mode 100644
index 000000000..774d5ba3c
--- /dev/null
+++ b/tests/ui/dst/issue-90528-unsizing-suggestion-3.stderr
@@ -0,0 +1,75 @@
+error[E0277]: the trait bound `[u8; 1]: Write` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-3.rs:13:17
+ |
+LL | wants_write([0u8]);
+ | ----------- ^^^^^ the trait `Write` is not implemented for `[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Write` is implemented for `&mut [u8]`
+note: required by a bound in `wants_write`
+ --> $DIR/issue-90528-unsizing-suggestion-3.rs:10:24
+ |
+LL | fn wants_write(_: impl Write) {}
+ | ^^^^^ required by this bound in `wants_write`
+help: convert the array to a `&mut [u8]` slice instead
+ |
+LL | wants_write(&mut [0u8][..]);
+ | ++++ ++++
+
+error[E0277]: the trait bound `&mut [u8; 1]: Write` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-3.rs:15:17
+ |
+LL | wants_write(&mut [0u8]);
+ | ----------- ^^^^^^^^^^ the trait `Write` is not implemented for `&mut [u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Write` is implemented for `&mut [u8]`
+note: required by a bound in `wants_write`
+ --> $DIR/issue-90528-unsizing-suggestion-3.rs:10:24
+ |
+LL | fn wants_write(_: impl Write) {}
+ | ^^^^^ required by this bound in `wants_write`
+help: convert the array to a `&mut [u8]` slice instead
+ |
+LL | wants_write(&mut [0u8][..]);
+ | ++++
+
+error[E0277]: the trait bound `&[u8; 1]: Write` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-3.rs:18:17
+ |
+LL | wants_write(&[0u8]);
+ | ----------- ^^^^^^ the trait `Write` is not implemented for `&[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Write` is implemented for `&mut [u8]`
+note: required by a bound in `wants_write`
+ --> $DIR/issue-90528-unsizing-suggestion-3.rs:10:24
+ |
+LL | fn wants_write(_: impl Write) {}
+ | ^^^^^ required by this bound in `wants_write`
+
+error[E0277]: the trait bound `&[u8]: Write` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-3.rs:20:17
+ |
+LL | wants_write(&[0u8][..]);
+ | ----------- ^^^^^^^^^^ the trait `Write` is not implemented for `&[u8]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Write` is implemented for `&mut [u8]`
+note: required by a bound in `wants_write`
+ --> $DIR/issue-90528-unsizing-suggestion-3.rs:10:24
+ |
+LL | fn wants_write(_: impl Write) {}
+ | ^^^^^ required by this bound in `wants_write`
+help: consider changing this borrow's mutability
+ |
+LL | wants_write(&mut [0u8][..]);
+ | ~~~~
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-4.rs b/tests/ui/dst/issue-90528-unsizing-suggestion-4.rs
new file mode 100644
index 000000000..eae953c61
--- /dev/null
+++ b/tests/ui/dst/issue-90528-unsizing-suggestion-4.rs
@@ -0,0 +1,26 @@
+// Issue #90528: provide helpful suggestions when a trait bound is unsatisfied
+// due to a missed unsizing coercion.
+//
+// This test exercises array variables and a trait implemented on mutable slices.
+
+trait Write {}
+
+impl Write for &mut [u8] {}
+
+fn wants_write(_: impl Write) {}
+
+fn main() {
+ let mut x = [0u8];
+ wants_write(x);
+ //~^ ERROR the trait bound `[u8; 1]: Write` is not satisfied
+ wants_write(&mut x);
+ //~^ ERROR the trait bound `&mut [u8; 1]: Write` is not satisfied
+ wants_write(&mut x[..]);
+
+ let x = &mut [0u8];
+ wants_write(x);
+ //~^ ERROR the trait bound `&mut [u8; 1]: Write` is not satisfied
+ wants_write(*x);
+ //~^ ERROR the trait bound `[u8; 1]: Write` is not satisfied
+ wants_write(&mut x[..]);
+}
diff --git a/tests/ui/dst/issue-90528-unsizing-suggestion-4.stderr b/tests/ui/dst/issue-90528-unsizing-suggestion-4.stderr
new file mode 100644
index 000000000..a4020ee07
--- /dev/null
+++ b/tests/ui/dst/issue-90528-unsizing-suggestion-4.stderr
@@ -0,0 +1,79 @@
+error[E0277]: the trait bound `[u8; 1]: Write` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-4.rs:14:17
+ |
+LL | wants_write(x);
+ | ----------- ^ the trait `Write` is not implemented for `[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Write` is implemented for `&mut [u8]`
+note: required by a bound in `wants_write`
+ --> $DIR/issue-90528-unsizing-suggestion-4.rs:10:24
+ |
+LL | fn wants_write(_: impl Write) {}
+ | ^^^^^ required by this bound in `wants_write`
+help: convert the array to a `&mut [u8]` slice instead
+ |
+LL | wants_write(&mut x[..]);
+ | ++++ ++++
+
+error[E0277]: the trait bound `&mut [u8; 1]: Write` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-4.rs:16:17
+ |
+LL | wants_write(&mut x);
+ | ----------- ^^^^^^ the trait `Write` is not implemented for `&mut [u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Write` is implemented for `&mut [u8]`
+note: required by a bound in `wants_write`
+ --> $DIR/issue-90528-unsizing-suggestion-4.rs:10:24
+ |
+LL | fn wants_write(_: impl Write) {}
+ | ^^^^^ required by this bound in `wants_write`
+help: convert the array to a `&mut [u8]` slice instead
+ |
+LL | wants_write(&mut x[..]);
+ | ++++
+
+error[E0277]: the trait bound `&mut [u8; 1]: Write` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-4.rs:21:17
+ |
+LL | wants_write(x);
+ | ----------- ^ the trait `Write` is not implemented for `&mut [u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Write` is implemented for `&mut [u8]`
+note: required by a bound in `wants_write`
+ --> $DIR/issue-90528-unsizing-suggestion-4.rs:10:24
+ |
+LL | fn wants_write(_: impl Write) {}
+ | ^^^^^ required by this bound in `wants_write`
+help: convert the array to a `&mut [u8]` slice instead
+ |
+LL | wants_write(&mut x[..]);
+ | ++++ ++++
+
+error[E0277]: the trait bound `[u8; 1]: Write` is not satisfied
+ --> $DIR/issue-90528-unsizing-suggestion-4.rs:23:17
+ |
+LL | wants_write(*x);
+ | ----------- ^^ the trait `Write` is not implemented for `[u8; 1]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Write` is implemented for `&mut [u8]`
+note: required by a bound in `wants_write`
+ --> $DIR/issue-90528-unsizing-suggestion-4.rs:10:24
+ |
+LL | fn wants_write(_: impl Write) {}
+ | ^^^^^ required by this bound in `wants_write`
+help: convert the array to a `&mut [u8]` slice instead
+ |
+LL | wants_write(&mut *x[..]);
+ | ++++ ++++
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/dyn-star/align.normal.stderr b/tests/ui/dyn-star/align.normal.stderr
index 53c2cbeac..42fa4fd6f 100644
--- a/tests/ui/dyn-star/align.normal.stderr
+++ b/tests/ui/dyn-star/align.normal.stderr
@@ -1,5 +1,5 @@
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/align.rs:4:12
+ --> $DIR/align.rs:3:12
|
LL | #![feature(dyn_star)]
| ^^^^^^^^
@@ -7,5 +7,14 @@ LL | #![feature(dyn_star)]
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= note: `#[warn(incomplete_features)]` on by default
-warning: 1 warning emitted
+error[E0277]: `AlignedUsize` needs to have the same ABI as a pointer
+ --> $DIR/align.rs:14:13
+ |
+LL | let x = AlignedUsize(12) as dyn* Debug;
+ | ^^^^^^^^^^^^^^^^ `AlignedUsize` needs to be a pointer-like type
+ |
+ = help: the trait `PointerLike` is not implemented for `AlignedUsize`
+
+error: aborting due to previous error; 1 warning emitted
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/dyn-star/align.over_aligned.stderr b/tests/ui/dyn-star/align.over_aligned.stderr
index 0365d87a6..42fa4fd6f 100644
--- a/tests/ui/dyn-star/align.over_aligned.stderr
+++ b/tests/ui/dyn-star/align.over_aligned.stderr
@@ -1,5 +1,5 @@
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/align.rs:4:12
+ --> $DIR/align.rs:3:12
|
LL | #![feature(dyn_star)]
| ^^^^^^^^
@@ -7,8 +7,8 @@ LL | #![feature(dyn_star)]
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= note: `#[warn(incomplete_features)]` on by default
-error[E0277]: `AlignedUsize` needs to have the same alignment and size as a pointer
- --> $DIR/align.rs:15:13
+error[E0277]: `AlignedUsize` needs to have the same ABI as a pointer
+ --> $DIR/align.rs:14:13
|
LL | let x = AlignedUsize(12) as dyn* Debug;
| ^^^^^^^^^^^^^^^^ `AlignedUsize` needs to be a pointer-like type
diff --git a/tests/ui/dyn-star/align.rs b/tests/ui/dyn-star/align.rs
index 6679997a9..79cbaba0c 100644
--- a/tests/ui/dyn-star/align.rs
+++ b/tests/ui/dyn-star/align.rs
@@ -1,5 +1,4 @@
// revisions: normal over_aligned
-//[normal] check-pass
#![feature(dyn_star)]
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
@@ -13,5 +12,5 @@ struct AlignedUsize(usize);
fn main() {
let x = AlignedUsize(12) as dyn* Debug;
- //[over_aligned]~^ ERROR `AlignedUsize` needs to have the same alignment and size as a pointer
+ //~^ ERROR `AlignedUsize` needs to have the same ABI as a pointer
}
diff --git a/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs b/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs
index 85749aa7b..913c2faac 100644
--- a/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs
+++ b/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs
@@ -9,7 +9,7 @@ fn dyn_debug(_: (dyn* Debug + '_)) {
fn polymorphic<T: Debug + ?Sized>(t: &T) {
dyn_debug(t);
- //~^ ERROR `&T` needs to have the same alignment and size as a pointer
+ //~^ ERROR `&T` needs to have the same ABI as a pointer
}
fn main() {}
diff --git a/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr b/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr
index 350630f79..8726fae79 100644
--- a/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr
+++ b/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr
@@ -1,4 +1,4 @@
-error[E0277]: `&T` needs to have the same alignment and size as a pointer
+error[E0277]: `&T` needs to have the same ABI as a pointer
--> $DIR/check-size-at-cast-polymorphic-bad.rs:11:15
|
LL | dyn_debug(t);
diff --git a/tests/ui/dyn-star/check-size-at-cast.rs b/tests/ui/dyn-star/check-size-at-cast.rs
index 17bc4f303..e15e090b5 100644
--- a/tests/ui/dyn-star/check-size-at-cast.rs
+++ b/tests/ui/dyn-star/check-size-at-cast.rs
@@ -5,6 +5,6 @@ use std::fmt::Debug;
fn main() {
let i = [1, 2, 3, 4] as dyn* Debug;
- //~^ ERROR `[i32; 4]` needs to have the same alignment and size as a pointer
+ //~^ ERROR `[i32; 4]` needs to have the same ABI as a pointer
dbg!(i);
}
diff --git a/tests/ui/dyn-star/check-size-at-cast.stderr b/tests/ui/dyn-star/check-size-at-cast.stderr
index 19700b406..e60b5c56f 100644
--- a/tests/ui/dyn-star/check-size-at-cast.stderr
+++ b/tests/ui/dyn-star/check-size-at-cast.stderr
@@ -1,4 +1,4 @@
-error[E0277]: `[i32; 4]` needs to have the same alignment and size as a pointer
+error[E0277]: `[i32; 4]` needs to have the same ABI as a pointer
--> $DIR/check-size-at-cast.rs:7:13
|
LL | let i = [1, 2, 3, 4] as dyn* Debug;
diff --git a/tests/ui/dyn-star/const-and-static.rs b/tests/ui/dyn-star/const-and-static.rs
new file mode 100644
index 000000000..551b072ab
--- /dev/null
+++ b/tests/ui/dyn-star/const-and-static.rs
@@ -0,0 +1,10 @@
+// check-pass
+
+#![feature(dyn_star)]
+//~^ WARN the feature `dyn_star` is incomplete
+
+const C: dyn* Send + Sync = &();
+
+static S: dyn* Send + Sync = &();
+
+fn main() {}
diff --git a/tests/ui/dyn-star/const-and-static.stderr b/tests/ui/dyn-star/const-and-static.stderr
new file mode 100644
index 000000000..df8f42fb0
--- /dev/null
+++ b/tests/ui/dyn-star/const-and-static.stderr
@@ -0,0 +1,11 @@
+warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/const-and-static.rs:3:12
+ |
+LL | #![feature(dyn_star)]
+ | ^^^^^^^^
+ |
+ = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/dyn-star/feature-gate-dyn_star.rs b/tests/ui/dyn-star/feature-gate-dyn_star.rs
index 4756661cf..41eed71cd 100644
--- a/tests/ui/dyn-star/feature-gate-dyn_star.rs
+++ b/tests/ui/dyn-star/feature-gate-dyn_star.rs
@@ -3,7 +3,7 @@
/// dyn* is not necessarily the final surface syntax (if we have one at all),
/// but for now we will support it to aid in writing tests independently.
pub fn dyn_star_parameter(_: &dyn* Send) {
- //~^ dyn* trait objects are unstable
+ //~^ `dyn*` trait objects are experimental
}
fn main() {}
diff --git a/tests/ui/dyn-star/feature-gate-dyn_star.stderr b/tests/ui/dyn-star/feature-gate-dyn_star.stderr
index c3449b627..342e71c3a 100644
--- a/tests/ui/dyn-star/feature-gate-dyn_star.stderr
+++ b/tests/ui/dyn-star/feature-gate-dyn_star.stderr
@@ -1,8 +1,8 @@
-error[E0658]: dyn* trait objects are unstable
+error[E0658]: `dyn*` trait objects are experimental
--> $DIR/feature-gate-dyn_star.rs:5:31
|
LL | pub fn dyn_star_parameter(_: &dyn* Send) {
- | ^^^^^^^^^
+ | ^^^^
|
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= help: add `#![feature(dyn_star)]` to the crate attributes to enable
diff --git a/tests/ui/dyn-star/gated-span.rs b/tests/ui/dyn-star/gated-span.rs
new file mode 100644
index 000000000..a747987bd
--- /dev/null
+++ b/tests/ui/dyn-star/gated-span.rs
@@ -0,0 +1,8 @@
+macro_rules! t {
+ ($t:ty) => {}
+}
+
+t!(dyn* Send);
+//~^ ERROR `dyn*` trait objects are experimental
+
+fn main() {}
diff --git a/tests/ui/dyn-star/gated-span.stderr b/tests/ui/dyn-star/gated-span.stderr
new file mode 100644
index 000000000..626b6cd1b
--- /dev/null
+++ b/tests/ui/dyn-star/gated-span.stderr
@@ -0,0 +1,12 @@
+error[E0658]: `dyn*` trait objects are experimental
+ --> $DIR/gated-span.rs:5:4
+ |
+LL | t!(dyn* Send);
+ | ^^^^
+ |
+ = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
+ = help: add `#![feature(dyn_star)]` 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/dyn-star/no-explicit-dyn-star-cast.rs b/tests/ui/dyn-star/no-explicit-dyn-star-cast.rs
index 67240c8e8..2d28f516a 100644
--- a/tests/ui/dyn-star/no-explicit-dyn-star-cast.rs
+++ b/tests/ui/dyn-star/no-explicit-dyn-star-cast.rs
@@ -4,8 +4,8 @@ fn make_dyn_star() {
let i = 42usize;
let dyn_i: dyn* Debug = i as dyn* Debug;
//~^ ERROR casting `usize` as `dyn* Debug` is invalid
- //~| ERROR dyn* trait objects are unstable
- //~| ERROR dyn* trait objects are unstable
+ //~| ERROR `dyn*` trait objects are experimental
+ //~| ERROR `dyn*` trait objects are experimental
}
fn main() {
diff --git a/tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr b/tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr
index eb9c93305..78af9c7a3 100644
--- a/tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr
+++ b/tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr
@@ -1,17 +1,17 @@
-error[E0658]: dyn* trait objects are unstable
+error[E0658]: `dyn*` trait objects are experimental
--> $DIR/no-explicit-dyn-star-cast.rs:5:16
|
LL | let dyn_i: dyn* Debug = i as dyn* Debug;
- | ^^^^^^^^^^
+ | ^^^^
|
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= help: add `#![feature(dyn_star)]` to the crate attributes to enable
-error[E0658]: dyn* trait objects are unstable
+error[E0658]: `dyn*` trait objects are experimental
--> $DIR/no-explicit-dyn-star-cast.rs:5:34
|
LL | let dyn_i: dyn* Debug = i as dyn* Debug;
- | ^^^^^^^^^^
+ | ^^^^
|
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= help: add `#![feature(dyn_star)]` to the crate attributes to enable
diff --git a/tests/ui/dyn-star/upcast.stderr b/tests/ui/dyn-star/upcast.stderr
index e60144fea..8b34c7f8b 100644
--- a/tests/ui/dyn-star/upcast.stderr
+++ b/tests/ui/dyn-star/upcast.stderr
@@ -7,7 +7,7 @@ LL | #![feature(dyn_star, trait_upcasting)]
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= note: `#[warn(incomplete_features)]` on by default
-error[E0277]: `dyn* Foo` needs to have the same alignment and size as a pointer
+error[E0277]: `dyn* Foo` needs to have the same ABI as a pointer
--> $DIR/upcast.rs:30:23
|
LL | let w: dyn* Bar = w;
diff --git a/tests/ui/empty/empty-struct-tuple-pat.stderr b/tests/ui/empty/empty-struct-tuple-pat.stderr
index 8d0f75d20..45001c797 100644
--- a/tests/ui/empty/empty-struct-tuple-pat.stderr
+++ b/tests/ui/empty/empty-struct-tuple-pat.stderr
@@ -46,8 +46,8 @@ LL | XEmpty5(),
|
help: use the tuple variant pattern syntax instead
|
-LL | XE::XEmpty5(/* fields */) => (),
- | ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | XE::XEmpty5() => (),
+ | ~~~~~~~~~~~~~
help: a unit variant with a similar name exists
|
LL | XE::XEmpty4 => (),
diff --git a/tests/ui/enum-discriminant/auxiliary/discr-foreign-dep.rs b/tests/ui/enum-discriminant/auxiliary/discr-foreign-dep.rs
new file mode 100644
index 000000000..a2cc10a4b
--- /dev/null
+++ b/tests/ui/enum-discriminant/auxiliary/discr-foreign-dep.rs
@@ -0,0 +1,7 @@
+#[derive(Default)]
+pub enum Foo {
+ A(u32),
+ #[default]
+ B,
+ C(u32),
+}
diff --git a/tests/ui/enum-discriminant/discr-foreign.rs b/tests/ui/enum-discriminant/discr-foreign.rs
new file mode 100644
index 000000000..e7123b344
--- /dev/null
+++ b/tests/ui/enum-discriminant/discr-foreign.rs
@@ -0,0 +1,11 @@
+// aux-build:discr-foreign-dep.rs
+// build-pass
+
+extern crate discr_foreign_dep;
+
+fn main() {
+ match Default::default() {
+ discr_foreign_dep::Foo::A(_) => {}
+ _ => {}
+ }
+}
diff --git a/tests/ui/enum-discriminant/issue-104519.rs b/tests/ui/enum-discriminant/issue-104519.rs
index c4630f76b..507c0988f 100644
--- a/tests/ui/enum-discriminant/issue-104519.rs
+++ b/tests/ui/enum-discriminant/issue-104519.rs
@@ -23,14 +23,4 @@ fn some_match(result: OpenResult) -> u8 {
fn main() {
let result = OpenResult::Ok(());
assert_eq!(some_match(result), 0);
-
- let result = OpenResult::Ok(());
- match result {
- OpenResult::Ok(()) => (),
- _ => unreachable!("message a"),
- }
- match result {
- OpenResult::Ok(()) => (),
- _ => unreachable!("message b"),
- }
}
diff --git a/tests/ui/issues/issue-61696.rs b/tests/ui/enum-discriminant/issue-61696.rs
index dca52927f..8a633a916 100644
--- a/tests/ui/issues/issue-61696.rs
+++ b/tests/ui/enum-discriminant/issue-61696.rs
@@ -55,12 +55,23 @@ pub enum E2<X> {
V4,
}
-fn main() {
- if let E1::V2 { .. } = (E1::V1 { f: true }) {
- unreachable!()
+#[inline(never)]
+fn match_e1(y: E1) -> u8 {
+ match y {
+ E1::V2 { .. } => 1,
+ _ => 0,
}
+}
- if let E2::V1 { .. } = E2::V3::<Infallible> {
- unreachable!()
+#[inline(never)]
+fn match_e2(y: E2<Infallible>) -> u8 {
+ match y {
+ E2::V1 { .. } => 1,
+ _ => 0,
}
}
+
+fn main() {
+ assert_eq!(match_e1(E1::V1 { f: true }), 0);
+ assert_eq!(match_e2(E2::V3), 0);
+}
diff --git a/tests/ui/error-codes/E0004.stderr b/tests/ui/error-codes/E0004.stderr
index 4ac8c904f..603bc5237 100644
--- a/tests/ui/error-codes/E0004.stderr
+++ b/tests/ui/error-codes/E0004.stderr
@@ -14,7 +14,7 @@ LL | HastaLaVistaBaby,
= note: the matched value is of type `Terminator`
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 ~ Terminator::TalkToMyHand => {}
+LL ~ Terminator::TalkToMyHand => {},
LL + Terminator::HastaLaVistaBaby => todo!()
|
diff --git a/tests/ui/error-codes/E0010-teach.rs b/tests/ui/error-codes/E0010-teach.rs
index fc5dffb37..798fcda2a 100644
--- a/tests/ui/error-codes/E0010-teach.rs
+++ b/tests/ui/error-codes/E0010-teach.rs
@@ -1,8 +1,7 @@
// compile-flags: -Z teach
-#![feature(box_syntax)]
#![allow(warnings)]
-const CON : Box<i32> = box 0; //~ ERROR E0010
-
+const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010
+//~| ERROR cannot call non-const fn
fn main() {}
diff --git a/tests/ui/error-codes/E0010-teach.stderr b/tests/ui/error-codes/E0010-teach.stderr
index 33de9fd68..7634970f3 100644
--- a/tests/ui/error-codes/E0010-teach.stderr
+++ b/tests/ui/error-codes/E0010-teach.stderr
@@ -1,11 +1,22 @@
error[E0010]: allocations are not allowed in constants
- --> $DIR/E0010-teach.rs:6:24
+ --> $DIR/E0010-teach.rs:5:23
|
-LL | const CON : Box<i32> = box 0;
- | ^^^^^ allocation not allowed in constants
+LL | const CON: Vec<i32> = vec![1, 2, 3];
+ | ^^^^^^^^^^^^^ allocation not allowed in constants
|
= note: The value of statics and constants must be known at compile time, and they live for the entire lifetime of a program. Creating a boxed value allocates memory on the heap at runtime, and therefore cannot be done at compile time.
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to previous error
+error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants
+ --> $DIR/E0010-teach.rs:5:23
+ |
+LL | const CON: Vec<i32> = vec![1, 2, 3];
+ | ^^^^^^^^^^^^^
+ |
+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
+ = note: this error originates in the macro `vec` (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 E0010`.
+Some errors have detailed explanations: E0010, E0015.
+For more information about an error, try `rustc --explain E0010`.
diff --git a/tests/ui/error-codes/E0010.rs b/tests/ui/error-codes/E0010.rs
index e62997640..11721efff 100644
--- a/tests/ui/error-codes/E0010.rs
+++ b/tests/ui/error-codes/E0010.rs
@@ -1,6 +1,5 @@
-#![feature(box_syntax)]
#![allow(warnings)]
-const CON : Box<i32> = box 0; //~ ERROR E0010
-
+const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010
+//~| ERROR cannot call non-const fn
fn main() {}
diff --git a/tests/ui/error-codes/E0010.stderr b/tests/ui/error-codes/E0010.stderr
index 0042333b9..089472224 100644
--- a/tests/ui/error-codes/E0010.stderr
+++ b/tests/ui/error-codes/E0010.stderr
@@ -1,9 +1,21 @@
error[E0010]: allocations are not allowed in constants
- --> $DIR/E0010.rs:4:24
+ --> $DIR/E0010.rs:3:23
|
-LL | const CON : Box<i32> = box 0;
- | ^^^^^ allocation not allowed in constants
+LL | const CON: Vec<i32> = vec![1, 2, 3];
+ | ^^^^^^^^^^^^^ allocation not allowed in constants
+ |
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants
+ --> $DIR/E0010.rs:3:23
+ |
+LL | const CON: Vec<i32> = vec![1, 2, 3];
+ | ^^^^^^^^^^^^^
+ |
+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
+ = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to previous error
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0010`.
+Some errors have detailed explanations: E0010, E0015.
+For more information about an error, try `rustc --explain E0010`.
diff --git a/tests/ui/error-codes/E0030-teach.rs b/tests/ui/error-codes/E0030-teach.rs
index 8caa4f093..388064fb0 100644
--- a/tests/ui/error-codes/E0030-teach.rs
+++ b/tests/ui/error-codes/E0030-teach.rs
@@ -4,6 +4,5 @@ fn main() {
match 5u32 {
1000 ..= 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
- //~| ERROR lower range bound must be less than or equal to upper
}
}
diff --git a/tests/ui/error-codes/E0030-teach.stderr b/tests/ui/error-codes/E0030-teach.stderr
index 800f66416..3f1ad4af3 100644
--- a/tests/ui/error-codes/E0030-teach.stderr
+++ b/tests/ui/error-codes/E0030-teach.stderr
@@ -6,12 +6,6 @@ LL | 1000 ..= 5 => {}
|
= note: When matching against a range, the compiler verifies that the range is non-empty. Range patterns include both end-points, so this is equivalent to requiring the start of the range to be less than or equal to the end of the range.
-error[E0030]: lower range bound must be less than or equal to upper
- --> $DIR/E0030-teach.rs:5:9
- |
-LL | 1000 ..= 5 => {}
- | ^^^^ lower bound larger than upper bound
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0030`.
diff --git a/tests/ui/error-codes/E0030.rs b/tests/ui/error-codes/E0030.rs
index a5d8f8726..58d856b7c 100644
--- a/tests/ui/error-codes/E0030.rs
+++ b/tests/ui/error-codes/E0030.rs
@@ -2,6 +2,5 @@ fn main() {
match 5u32 {
1000 ..= 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
- //~| ERROR lower range bound must be less than or equal to upper
}
}
diff --git a/tests/ui/error-codes/E0030.stderr b/tests/ui/error-codes/E0030.stderr
index 8a6114024..db8161d8f 100644
--- a/tests/ui/error-codes/E0030.stderr
+++ b/tests/ui/error-codes/E0030.stderr
@@ -4,12 +4,6 @@ error[E0030]: lower range bound must be less than or equal to upper
LL | 1000 ..= 5 => {}
| ^^^^ lower bound larger than upper bound
-error[E0030]: lower range bound must be less than or equal to upper
- --> $DIR/E0030.rs:3:9
- |
-LL | 1000 ..= 5 => {}
- | ^^^^ lower bound larger than upper bound
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0030`.
diff --git a/tests/ui/error-codes/E0184.stderr b/tests/ui/error-codes/E0184.stderr
index bb3017b6e..52f1f30a4 100644
--- a/tests/ui/error-codes/E0184.stderr
+++ b/tests/ui/error-codes/E0184.stderr
@@ -1,4 +1,4 @@
-error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
+error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/E0184.rs:1:10
|
LL | #[derive(Copy)]
diff --git a/tests/ui/error-codes/E0206.rs b/tests/ui/error-codes/E0206.rs
index 0f3d427ce..74738d810 100644
--- a/tests/ui/error-codes/E0206.rs
+++ b/tests/ui/error-codes/E0206.rs
@@ -2,7 +2,7 @@
struct Bar;
impl Copy for &'static mut Bar { }
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
fn main() {
}
diff --git a/tests/ui/error-codes/E0206.stderr b/tests/ui/error-codes/E0206.stderr
index 57ae2647d..60d8d7bfe 100644
--- a/tests/ui/error-codes/E0206.stderr
+++ b/tests/ui/error-codes/E0206.stderr
@@ -1,4 +1,4 @@
-error[E0206]: the trait `Copy` may not be implemented for this type
+error[E0206]: the trait `Copy` cannot be implemented for this type
--> $DIR/E0206.rs:4:15
|
LL | impl Copy for &'static mut Bar { }
diff --git a/tests/ui/error-codes/E0275.stderr b/tests/ui/error-codes/E0275.stderr
index cf9a7f69b..03c37d6f0 100644
--- a/tests/ui/error-codes/E0275.stderr
+++ b/tests/ui/error-codes/E0275.stderr
@@ -11,7 +11,7 @@ note: required for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<
LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/error-codes/E0275/E0275.long-type-hash.txt'
- = note: 127 redundant requirements hidden
+ = note: 126 redundant requirements hidden
= note: required for `Bar<T>` to implement `Foo`
error: aborting due to previous error
diff --git a/tests/ui/error-codes/E0277-3.stderr b/tests/ui/error-codes/E0277-3.stderr
index 0127e1ccc..0d4782935 100644
--- a/tests/ui/error-codes/E0277-3.stderr
+++ b/tests/ui/error-codes/E0277-3.stderr
@@ -14,7 +14,8 @@ LL | fn foo<T: PartialEq>(_: T) {}
| ^^^^^^^^^ required by this bound in `foo`
help: consider annotating `S` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct S;
|
error: aborting due to previous error
diff --git a/tests/ui/error-codes/E0449.stderr b/tests/ui/error-codes/E0449.stderr
index 8221a5e0a..cf41bcce8 100644
--- a/tests/ui/error-codes/E0449.stderr
+++ b/tests/ui/error-codes/E0449.stderr
@@ -1,22 +1,26 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/E0449.rs:7:1
|
LL | pub impl Bar {}
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual impl items instead
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/E0449.rs:9:1
|
LL | pub impl Foo for Bar {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/E0449.rs:10:5
|
LL | pub fn foo() {}
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
error: aborting due to 3 previous errors
diff --git a/tests/ui/exclusive-drop-and-copy.rs b/tests/ui/exclusive-drop-and-copy.rs
index 7a251671e..210ecaed7 100644
--- a/tests/ui/exclusive-drop-and-copy.rs
+++ b/tests/ui/exclusive-drop-and-copy.rs
@@ -1,13 +1,13 @@
// issue #20126
-#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
+#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
struct Foo;
impl Drop for Foo {
fn drop(&mut self) {}
}
-#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
+#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
struct Bar<T>(::std::marker::PhantomData<T>);
impl<T> Drop for Bar<T> {
diff --git a/tests/ui/exclusive-drop-and-copy.stderr b/tests/ui/exclusive-drop-and-copy.stderr
index 8649c8abb..546079422 100644
--- a/tests/ui/exclusive-drop-and-copy.stderr
+++ b/tests/ui/exclusive-drop-and-copy.stderr
@@ -1,4 +1,4 @@
-error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
+error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/exclusive-drop-and-copy.rs:3:10
|
LL | #[derive(Copy, Clone)]
@@ -6,7 +6,7 @@ LL | #[derive(Copy, Clone)]
|
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
+error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/exclusive-drop-and-copy.rs:10:10
|
LL | #[derive(Copy, Clone)]
diff --git a/tests/ui/extenv/extenv-no-args.rs b/tests/ui/extenv/extenv-no-args.rs
index 9f221ed10..2ff6d242b 100644
--- a/tests/ui/extenv/extenv-no-args.rs
+++ b/tests/ui/extenv/extenv-no-args.rs
@@ -1 +1 @@
-fn main() { env!(); } //~ ERROR: env! takes 1 or 2 arguments
+fn main() { env!(); } //~ ERROR: `env!()` takes 1 or 2 arguments
diff --git a/tests/ui/extenv/extenv-no-args.stderr b/tests/ui/extenv/extenv-no-args.stderr
index 318ed635b..70b85932c 100644
--- a/tests/ui/extenv/extenv-no-args.stderr
+++ b/tests/ui/extenv/extenv-no-args.stderr
@@ -1,4 +1,4 @@
-error: env! takes 1 or 2 arguments
+error: `env!()` takes 1 or 2 arguments
--> $DIR/extenv-no-args.rs:1:13
|
LL | fn main() { env!(); }
diff --git a/tests/ui/extenv/extenv-too-many-args.rs b/tests/ui/extenv/extenv-too-many-args.rs
index 1adbee583..ffad1c513 100644
--- a/tests/ui/extenv/extenv-too-many-args.rs
+++ b/tests/ui/extenv/extenv-too-many-args.rs
@@ -1 +1 @@
-fn main() { env!("one", "two", "three"); } //~ ERROR: env! takes 1 or 2 arguments
+fn main() { env!("one", "two", "three"); } //~ ERROR: `env!()` takes 1 or 2 arguments
diff --git a/tests/ui/extenv/extenv-too-many-args.stderr b/tests/ui/extenv/extenv-too-many-args.stderr
index 54150a332..47cf810b7 100644
--- a/tests/ui/extenv/extenv-too-many-args.stderr
+++ b/tests/ui/extenv/extenv-too-many-args.stderr
@@ -1,4 +1,4 @@
-error: env! takes 1 or 2 arguments
+error: `env!()` takes 1 or 2 arguments
--> $DIR/extenv-too-many-args.rs:1:13
|
LL | fn main() { env!("one", "two", "three"); }
diff --git a/tests/ui/extenv/issue-55897.stderr b/tests/ui/extenv/issue-55897.stderr
index 5752a965e..401db8278 100644
--- a/tests/ui/extenv/issue-55897.stderr
+++ b/tests/ui/extenv/issue-55897.stderr
@@ -4,7 +4,7 @@ error: environment variable `NON_EXISTENT` not defined at compile time
LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs"));
| ^^^^^^^^^^^^^^^^^^^^
|
- = help: Use `std::env::var("NON_EXISTENT")` to read the variable at run time
+ = help: use `std::env::var("NON_EXISTENT")` to read the variable at run time
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
error: suffixes on string literals are invalid
diff --git a/tests/ui/extern-mod-syntax.rs b/tests/ui/extern-mod-syntax.rs
new file mode 100644
index 000000000..65dfa6a0f
--- /dev/null
+++ b/tests/ui/extern-mod-syntax.rs
@@ -0,0 +1,11 @@
+// run-pass
+
+#![allow(unused_imports)]
+#![no_std]
+
+extern crate std;
+use std::ffi::c_void;
+
+pub fn main() {
+ std::println!("Hello world!");
+}
diff --git a/tests/ui/feature-gates/feature-gate-box-expr.rs b/tests/ui/feature-gates/feature-gate-box-expr.rs
deleted file mode 100644
index 870253d2f..000000000
--- a/tests/ui/feature-gates/feature-gate-box-expr.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// gate-test-box_syntax
-
-// Check that `box EXPR` is feature-gated.
-//
-// See also feature-gate-placement-expr.rs
-//
-// (Note that the two tests are separated since the checks appear to
-// be performed at distinct phases, with an abort_if_errors call
-// separating them.)
-
-fn main() {
- let x = box 'c'; //~ ERROR box expression syntax is experimental
- println!("x: {}", x);
-}
diff --git a/tests/ui/feature-gates/feature-gate-box-expr.stderr b/tests/ui/feature-gates/feature-gate-box-expr.stderr
deleted file mode 100644
index af864b25f..000000000
--- a/tests/ui/feature-gates/feature-gate-box-expr.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: box expression syntax is experimental; you can call `Box::new` instead
- --> $DIR/feature-gate-box-expr.rs:12:13
- |
-LL | let x = box 'c';
- | ^^^^^^^
- |
- = note: see issue #49733 <https://github.com/rust-lang/rust/issues/49733> for more information
- = help: add `#![feature(box_syntax)]` 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/feature-gates/feature-gate-box_syntax.rs b/tests/ui/feature-gates/feature-gate-box_syntax.rs
deleted file mode 100644
index 778660cc0..000000000
--- a/tests/ui/feature-gates/feature-gate-box_syntax.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-// Test that the use of the box syntax is gated by `box_syntax` feature gate.
-
-fn main() {
- let x = box 3;
- //~^ ERROR box expression syntax is experimental; you can call `Box::new` instead
-}
diff --git a/tests/ui/feature-gates/feature-gate-box_syntax.stderr b/tests/ui/feature-gates/feature-gate-box_syntax.stderr
deleted file mode 100644
index dcf8eeed7..000000000
--- a/tests/ui/feature-gates/feature-gate-box_syntax.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: box expression syntax is experimental; you can call `Box::new` instead
- --> $DIR/feature-gate-box_syntax.rs:4:13
- |
-LL | let x = box 3;
- | ^^^^^
- |
- = note: see issue #49733 <https://github.com/rust-lang/rust/issues/49733> for more information
- = help: add `#![feature(box_syntax)]` 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/feature-gates/feature-gate-closure_track_caller.rs b/tests/ui/feature-gates/feature-gate-closure_track_caller.rs
index a8d63a814..a4c91f3bc 100644
--- a/tests/ui/feature-gates/feature-gate-closure_track_caller.rs
+++ b/tests/ui/feature-gates/feature-gate-closure_track_caller.rs
@@ -1,7 +1,9 @@
+// edition:2021
#![feature(stmt_expr_attributes)]
#![feature(generators)]
fn main() {
let _closure = #[track_caller] || {}; //~ `#[track_caller]` on closures
let _generator = #[track_caller] || { yield; }; //~ `#[track_caller]` on closures
+ let _future = #[track_caller] async {}; //~ `#[track_caller]` on closures
}
diff --git a/tests/ui/feature-gates/feature-gate-closure_track_caller.stderr b/tests/ui/feature-gates/feature-gate-closure_track_caller.stderr
index ed63d74fe..cf2ea5fe1 100644
--- a/tests/ui/feature-gates/feature-gate-closure_track_caller.stderr
+++ b/tests/ui/feature-gates/feature-gate-closure_track_caller.stderr
@@ -1,5 +1,5 @@
error[E0658]: `#[track_caller]` on closures is currently unstable
- --> $DIR/feature-gate-closure_track_caller.rs:5:20
+ --> $DIR/feature-gate-closure_track_caller.rs:6:20
|
LL | let _closure = #[track_caller] || {};
| ^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | let _closure = #[track_caller] || {};
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable
error[E0658]: `#[track_caller]` on closures is currently unstable
- --> $DIR/feature-gate-closure_track_caller.rs:6:22
+ --> $DIR/feature-gate-closure_track_caller.rs:7:22
|
LL | let _generator = #[track_caller] || { yield; };
| ^^^^^^^^^^^^^^^
@@ -16,6 +16,15 @@ LL | let _generator = #[track_caller] || { yield; };
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable
-error: aborting due to 2 previous errors
+error[E0658]: `#[track_caller]` on closures is currently unstable
+ --> $DIR/feature-gate-closure_track_caller.rs:8:19
+ |
+LL | let _future = #[track_caller] async {};
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information
+ = help: add `#![feature(closure_track_caller)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs b/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs
new file mode 100644
index 000000000..de0487cdb
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs
@@ -0,0 +1,18 @@
+trait Foo {
+ type Bar;
+}
+
+impl Foo for () {
+ type Bar = impl std::fmt::Debug;
+ //~^ ERROR: `impl Trait` in associated types is unstable
+}
+
+struct Mop;
+
+impl Mop {
+ type Bop = impl std::fmt::Debug;
+ //~^ ERROR: `impl Trait` in associated types is unstable
+ //~| ERROR: inherent associated types are unstable
+}
+
+fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.stderr b/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.stderr
new file mode 100644
index 000000000..9a1ded968
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.stderr
@@ -0,0 +1,30 @@
+error[E0658]: `impl Trait` in associated types is unstable
+ --> $DIR/feature-gate-impl_trait_in_assoc_type.rs:6:16
+ |
+LL | type Bar = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+ = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
+
+error[E0658]: `impl Trait` in associated types is unstable
+ --> $DIR/feature-gate-impl_trait_in_assoc_type.rs:13:16
+ |
+LL | type Bop = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+ = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
+
+error[E0658]: inherent associated types are unstable
+ --> $DIR/feature-gate-impl_trait_in_assoc_type.rs:13:5
+ |
+LL | type Bop = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 3 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/feature-gate-link_cfg.stderr b/tests/ui/feature-gates/feature-gate-link_cfg.stderr
index 8f47d5965..97b6cbca4 100644
--- a/tests/ui/feature-gates/feature-gate-link_cfg.stderr
+++ b/tests/ui/feature-gates/feature-gate-link_cfg.stderr
@@ -4,7 +4,6 @@ error[E0658]: link cfg is unstable
LL | #[link(name = "foo", cfg(foo))]
| ^^^^^^^^
|
- = note: see issue #37406 <https://github.com/rust-lang/rust/issues/37406> for more information
= help: add `#![feature(link_cfg)]` to the crate attributes to enable
error: aborting due to previous error
diff --git a/tests/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr b/tests/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr
index 4d79ce3c6..fb39c404c 100644
--- a/tests/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr
+++ b/tests/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr
@@ -115,7 +115,7 @@ LL | A, B, C,
= note: the matched value is of type `Foo`
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 ~ Foo::B => {}
+LL ~ Foo::B => {},
LL + Foo::C => todo!()
|
diff --git a/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr b/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
index b55106833..853b57052 100644
--- a/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
+++ b/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
@@ -9,7 +9,7 @@ LL | match 0usize {
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
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 ~ 0..=usize::MAX => {}
+LL ~ 0..=usize::MAX => {},
LL + _ => todo!()
|
@@ -24,7 +24,7 @@ LL | match 0isize {
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
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 ~ isize::MIN..=isize::MAX => {}
+LL ~ isize::MIN..=isize::MAX => {},
LL + _ => todo!()
|
diff --git a/tests/ui/feature-gates/feature-gate-return_type_notation.cfg.stderr b/tests/ui/feature-gates/feature-gate-return_type_notation.cfg.stderr
new file mode 100644
index 000000000..c3a371e25
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.cfg.stderr
@@ -0,0 +1,36 @@
+error[E0658]: return type notation is experimental
+ --> $DIR/feature-gate-return_type_notation.rs:15: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: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/feature-gate-return_type_notation.rs:7:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error: parenthesized generic arguments cannot be used in associated type constraints
+ --> $DIR/feature-gate-return_type_notation.rs:15: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:15:17
+ |
+LL | fn foo<T: Trait<m(): Send>>() {}
+ | ^ associated type `m` not found
+
+error: aborting due to 3 previous errors; 1 warning emitted
+
+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.stderr b/tests/ui/feature-gates/feature-gate-return_type_notation.no.stderr
new file mode 100644
index 000000000..52c90c156
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.no.stderr
@@ -0,0 +1,22 @@
+warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/feature-gate-return_type_notation.rs:7:12
+ |
+LL | #![feature(async_fn_in_trait)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: return type notation is experimental
+ --> $DIR/feature-gate-return_type_notation.rs:15: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: 2 warnings 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
new file mode 100644
index 000000000..5028b9ec9
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-return_type_notation.rs
@@ -0,0 +1,22 @@
+// edition: 2021
+// revisions: cfg no
+
+//[no] check-pass
+// Since we're not adding new syntax, `cfg`'d out RTN must pass.
+
+#![feature(async_fn_in_trait)]
+//~^ WARN the feature `async_fn_in_trait` is incomplete
+
+trait Trait {
+ async fn m();
+}
+
+#[cfg(cfg)]
+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!
+
+fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr b/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr
index f647380ef..b1613f638 100644
--- a/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr
+++ b/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr
@@ -64,6 +64,12 @@ error[E0229]: associated type bindings are not allowed here
|
LL | impl FnOnce() for Foo1 {
| ^^^^^^^^ associated type not allowed here
+ |
+help: parenthesized trait syntax expands to `FnOnce<(), Output=()>`
+ --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:16:6
+ |
+LL | impl FnOnce() for Foo1 {
+ | ^^^^^^^^
error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change
--> $DIR/feature-gate-unboxed-closures-manual-impls.rs:23:6
diff --git a/tests/ui/feature-gates/test-listing-format-json.rs b/tests/ui/feature-gates/test-listing-format-json.rs
new file mode 100644
index 000000000..2dd0e10b5
--- /dev/null
+++ b/tests/ui/feature-gates/test-listing-format-json.rs
@@ -0,0 +1,18 @@
+// no-prefer-dynamic
+// compile-flags: --test
+// run-flags: --list --format json -Zunstable-options
+// run-fail
+// check-run-results
+// ignore-nightly
+// unset-exec-env:RUSTC_BOOTSTRAP
+
+#![cfg(test)]
+#[test]
+fn m_test() {}
+
+#[test]
+#[ignore = "not yet implemented"]
+fn z_test() {}
+
+#[test]
+fn a_test() {}
diff --git a/tests/ui/feature-gates/test-listing-format-json.run.stderr b/tests/ui/feature-gates/test-listing-format-json.run.stderr
new file mode 100644
index 000000000..e81cb81f3
--- /dev/null
+++ b/tests/ui/feature-gates/test-listing-format-json.run.stderr
@@ -0,0 +1 @@
+error: the option `Z` is only accepted on the nightly compiler
diff --git a/tests/ui/fmt/auxiliary/format-string-proc-macro.rs b/tests/ui/fmt/auxiliary/format-string-proc-macro.rs
index 1b7ef93f4..0c39ade72 100644
--- a/tests/ui/fmt/auxiliary/format-string-proc-macro.rs
+++ b/tests/ui/fmt/auxiliary/format-string-proc-macro.rs
@@ -28,25 +28,41 @@ pub fn err_with_input_span(input: TokenStream) -> TokenStream {
TokenStream::from(TokenTree::Literal(lit))
}
+fn build_format(args: impl Into<TokenStream>) -> TokenStream {
+ TokenStream::from_iter([
+ TokenTree::from(Ident::new("format", Span::call_site())),
+ TokenTree::from(Punct::new('!', Spacing::Alone)),
+ TokenTree::from(Group::new(Delimiter::Parenthesis, args.into())),
+ ])
+}
#[proc_macro]
pub fn respan_to_invalid_format_literal(input: TokenStream) -> TokenStream {
let mut s = Literal::string("{");
s.set_span(input.into_iter().next().unwrap().span());
- TokenStream::from_iter([
- TokenTree::from(Ident::new("format", Span::call_site())),
- TokenTree::from(Punct::new('!', Spacing::Alone)),
- TokenTree::from(Group::new(Delimiter::Parenthesis, TokenTree::from(s).into())),
- ])
+
+ build_format(TokenTree::from(s))
}
#[proc_macro]
pub fn capture_a_with_prepended_space_preserve_span(input: TokenStream) -> TokenStream {
let mut s = Literal::string(" {a}");
s.set_span(input.into_iter().next().unwrap().span());
- TokenStream::from_iter([
- TokenTree::from(Ident::new("format", Span::call_site())),
- TokenTree::from(Punct::new('!', Spacing::Alone)),
- TokenTree::from(Group::new(Delimiter::Parenthesis, TokenTree::from(s).into())),
- ])
+
+ build_format(TokenTree::from(s))
+}
+
+#[proc_macro]
+pub fn format_args_captures(_: TokenStream) -> TokenStream {
+ r#"{ let x = 5; format!("{x}") }"#.parse().unwrap()
+}
+
+#[proc_macro]
+pub fn bad_format_args_captures(_: TokenStream) -> TokenStream {
+ r#"{ let x = 5; format!(concat!("{x}")) }"#.parse().unwrap()
+}
+
+#[proc_macro]
+pub fn identity_pm(input: TokenStream) -> TokenStream {
+ input
}
diff --git a/tests/ui/fmt/format-args-argument-span.rs b/tests/ui/fmt/format-args-argument-span.rs
new file mode 100644
index 000000000..c7acb08f8
--- /dev/null
+++ b/tests/ui/fmt/format-args-argument-span.rs
@@ -0,0 +1,22 @@
+// check-compile
+
+struct DisplayOnly;
+
+impl std::fmt::Display for DisplayOnly {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ unimplemented!()
+ }
+}
+
+fn main() {
+ let x = Some(1);
+ println!("{x:?} {x} {x:?}");
+ //~^ ERROR: `Option<{integer}>` doesn't implement `std::fmt::Display`
+ println!("{x:?} {x} {x:?}", x = Some(1));
+ //~^ ERROR: `Option<{integer}>` doesn't implement `std::fmt::Display`
+ let x = DisplayOnly;
+ println!("{x} {x:?} {x}");
+ //~^ ERROR: `DisplayOnly` doesn't implement `Debug`
+ println!("{x} {x:?} {x}", x = DisplayOnly);
+ //~^ ERROR: `DisplayOnly` doesn't implement `Debug`
+}
diff --git a/tests/ui/fmt/format-args-argument-span.stderr b/tests/ui/fmt/format-args-argument-span.stderr
new file mode 100644
index 000000000..4e2702383
--- /dev/null
+++ b/tests/ui/fmt/format-args-argument-span.stderr
@@ -0,0 +1,53 @@
+error[E0277]: `Option<{integer}>` doesn't implement `std::fmt::Display`
+ --> $DIR/format-args-argument-span.rs:13:21
+ |
+LL | println!("{x:?} {x} {x:?}");
+ | ^^^ `Option<{integer}>` cannot be formatted with the default formatter
+ |
+ = help: the trait `std::fmt::Display` is not implemented for `Option<{integer}>`
+ = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+ = 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[E0277]: `Option<{integer}>` doesn't implement `std::fmt::Display`
+ --> $DIR/format-args-argument-span.rs:15:37
+ |
+LL | println!("{x:?} {x} {x:?}", x = Some(1));
+ | ^^^^^^^ `Option<{integer}>` cannot be formatted with the default formatter
+ |
+ = help: the trait `std::fmt::Display` is not implemented for `Option<{integer}>`
+ = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+ = 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[E0277]: `DisplayOnly` doesn't implement `Debug`
+ --> $DIR/format-args-argument-span.rs:18:19
+ |
+LL | println!("{x} {x:?} {x}");
+ | ^^^^^ `DisplayOnly` cannot be formatted using `{:?}`
+ |
+ = help: the trait `Debug` is not implemented for `DisplayOnly`
+ = note: add `#[derive(Debug)]` to `DisplayOnly` or manually `impl Debug for DisplayOnly`
+ = 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)
+help: consider annotating `DisplayOnly` with `#[derive(Debug)]`
+ |
+LL + #[derive(Debug)]
+LL | struct DisplayOnly;
+ |
+
+error[E0277]: `DisplayOnly` doesn't implement `Debug`
+ --> $DIR/format-args-argument-span.rs:20:35
+ |
+LL | println!("{x} {x:?} {x}", x = DisplayOnly);
+ | ^^^^^^^^^^^ `DisplayOnly` cannot be formatted using `{:?}`
+ |
+ = help: the trait `Debug` is not implemented for `DisplayOnly`
+ = note: add `#[derive(Debug)]` to `DisplayOnly` or manually `impl Debug for DisplayOnly`
+ = 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)
+help: consider annotating `DisplayOnly` with `#[derive(Debug)]`
+ |
+LL + #[derive(Debug)]
+LL | struct DisplayOnly;
+ |
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs b/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs
new file mode 100644
index 000000000..bf5c0dcb5
--- /dev/null
+++ b/tests/ui/fmt/format-args-capture-first-literal-is-macro.rs
@@ -0,0 +1,21 @@
+// aux-build:format-string-proc-macro.rs
+
+#[macro_use]
+extern crate format_string_proc_macro;
+
+macro_rules! identity_mbe {
+ ($tt:tt) => {
+ $tt
+ //~^ ERROR there is no argument named `a`
+ };
+}
+
+fn main() {
+ let a = 0;
+
+ format!(identity_pm!("{a}"));
+ //~^ ERROR there is no argument named `a`
+ format!(identity_mbe!("{a}"));
+ format!(concat!("{a}"));
+ //~^ ERROR there is no argument named `a`
+}
diff --git a/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr b/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr
new file mode 100644
index 000000000..4cf3afad7
--- /dev/null
+++ b/tests/ui/fmt/format-args-capture-first-literal-is-macro.stderr
@@ -0,0 +1,30 @@
+error: there is no argument named `a`
+ --> $DIR/format-args-capture-first-literal-is-macro.rs:16:26
+ |
+LL | format!(identity_pm!("{a}"));
+ | ^^^^^
+ |
+ = note: did you intend to capture a variable `a` from the surrounding scope?
+ = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
+
+error: there is no argument named `a`
+ --> $DIR/format-args-capture-first-literal-is-macro.rs:8:9
+ |
+LL | $tt
+ | ^^^
+ |
+ = note: did you intend to capture a variable `a` from the surrounding scope?
+ = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
+
+error: there is no argument named `a`
+ --> $DIR/format-args-capture-first-literal-is-macro.rs:19:13
+ |
+LL | format!(concat!("{a}"));
+ | ^^^^^^^^^^^^^^
+ |
+ = note: did you intend to capture a variable `a` from the surrounding scope?
+ = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
+ = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs
new file mode 100644
index 000000000..f67edf5e1
--- /dev/null
+++ b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs
@@ -0,0 +1,8 @@
+// aux-build:format-string-proc-macro.rs
+
+extern crate format_string_proc_macro;
+
+fn main() {
+ format_string_proc_macro::bad_format_args_captures!();
+ //~^ ERROR there is no argument named `x`
+}
diff --git a/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr
new file mode 100644
index 000000000..bb6a14d88
--- /dev/null
+++ b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr
@@ -0,0 +1,12 @@
+error: there is no argument named `x`
+ --> $DIR/format-args-capture-from-pm-first-arg-macro.rs:6:5
+ |
+LL | format_string_proc_macro::bad_format_args_captures!();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: did you intend to capture a variable `x` from the surrounding scope?
+ = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
+ = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
diff --git a/tests/ui/fmt/format-args-capture-issue-106408.rs b/tests/ui/fmt/format-args-capture-issue-106408.rs
new file mode 100644
index 000000000..0fd195416
--- /dev/null
+++ b/tests/ui/fmt/format-args-capture-issue-106408.rs
@@ -0,0 +1,10 @@
+// check-pass
+// aux-build:format-string-proc-macro.rs
+
+extern crate format_string_proc_macro;
+
+fn main() {
+ // While literal macros like `format_args!(concat!())` are not supposed to work with implicit
+ // captures, it should work if the whole invocation comes from a macro expansion (#106408).
+ format_string_proc_macro::format_args_captures!();
+}
diff --git a/tests/ui/fmt/format-args-capture-macro-hygiene-pass.rs b/tests/ui/fmt/format-args-capture-macro-hygiene-pass.rs
new file mode 100644
index 000000000..7553fcc4e
--- /dev/null
+++ b/tests/ui/fmt/format-args-capture-macro-hygiene-pass.rs
@@ -0,0 +1,16 @@
+// run-pass
+
+macro_rules! format_mbe {
+ ($tt:tt) => {
+ {
+ #[allow(unused_variables)]
+ let a = 123;
+ format!($tt)
+ }
+ };
+}
+
+fn main() {
+ let a = 0;
+ assert_eq!(format_mbe!("{a}"), "0");
+}
diff --git a/tests/ui/fmt/ifmt-bad-arg.stderr b/tests/ui/fmt/ifmt-bad-arg.stderr
index d716bbe51..bf18fb315 100644
--- a/tests/ui/fmt/ifmt-bad-arg.stderr
+++ b/tests/ui/fmt/ifmt-bad-arg.stderr
@@ -300,10 +300,9 @@ error[E0308]: mismatched types
--> $DIR/ifmt-bad-arg.rs:78:32
|
LL | println!("{} {:.*} {}", 1, 3.2, 4);
- | ^^^
- | |
- | expected `&usize`, found `&{float}`
- | arguments to this function are incorrect
+ | -- ^^^ expected `&usize`, found `&{float}`
+ | |
+ | arguments to this function are incorrect
|
= note: expected reference `&usize`
found reference `&{float}`
@@ -315,10 +314,9 @@ error[E0308]: mismatched types
--> $DIR/ifmt-bad-arg.rs:81:35
|
LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
- | ^^^
- | |
- | expected `&usize`, found `&{float}`
- | arguments to this function are incorrect
+ | -- ^^^ expected `&usize`, found `&{float}`
+ | |
+ | arguments to this function are incorrect
|
= note: expected reference `&usize`
found reference `&{float}`
diff --git a/tests/ui/fmt/ifmt-unimpl.stderr b/tests/ui/fmt/ifmt-unimpl.stderr
index 3480a2ec8..dc2dee3f3 100644
--- a/tests/ui/fmt/ifmt-unimpl.stderr
+++ b/tests/ui/fmt/ifmt-unimpl.stderr
@@ -2,7 +2,9 @@ error[E0277]: the trait bound `str: UpperHex` is not satisfied
--> $DIR/ifmt-unimpl.rs:2:21
|
LL | format!("{:X}", "3");
- | ^^^ the trait `UpperHex` is not implemented for `str`
+ | ---- ^^^ the trait `UpperHex` is not implemented for `str`
+ | |
+ | required by a bound introduced by this call
|
= help: the following other types implement trait `UpperHex`:
&T
diff --git a/tests/ui/fmt/respanned-literal-issue-106191.rs b/tests/ui/fmt/respanned-literal-issue-106191.rs
index 5a18983a3..44642a10f 100644
--- a/tests/ui/fmt/respanned-literal-issue-106191.rs
+++ b/tests/ui/fmt/respanned-literal-issue-106191.rs
@@ -1,15 +1,10 @@
// aux-build:format-string-proc-macro.rs
-// check-fail
-// known-bug: #106191
-// unset-rustc-env:RUST_BACKTRACE
-// had to be reverted
-// error-pattern:unexpectedly panicked
-// failure-status:101
-// dont-check-compiler-stderr
extern crate format_string_proc_macro;
fn main() {
format_string_proc_macro::respan_to_invalid_format_literal!("¡");
+ //~^ ERROR invalid format string: expected `'}'` but string was terminated
format_args!(r#concat!("¡ {"));
+ //~^ ERROR invalid format string: expected `'}'` but string was terminated
}
diff --git a/tests/ui/fmt/respanned-literal-issue-106191.stderr b/tests/ui/fmt/respanned-literal-issue-106191.stderr
index 16717f422..73a3af65a 100644
--- a/tests/ui/fmt/respanned-literal-issue-106191.stderr
+++ b/tests/ui/fmt/respanned-literal-issue-106191.stderr
@@ -1,2 +1,19 @@
- query stack during panic:
-end of query stack
+error: invalid format string: expected `'}'` but string was terminated
+ --> $DIR/respanned-literal-issue-106191.rs:6:65
+ |
+LL | format_string_proc_macro::respan_to_invalid_format_literal!("¡");
+ | ^^^ expected `'}'` in format string
+ |
+ = note: if you intended to print `{`, you can escape it using `{{`
+
+error: invalid format string: expected `'}'` but string was terminated
+ --> $DIR/respanned-literal-issue-106191.rs:8:18
+ |
+LL | format_args!(r#concat!("¡ {"));
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected `'}'` in format string
+ |
+ = note: if you intended to print `{`, you can escape it using `{{`
+ = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs b/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs
new file mode 100644
index 000000000..eec7da044
--- /dev/null
+++ b/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs
@@ -0,0 +1,10 @@
+// check-pass
+trait MyCmp {
+ fn cmp(&self) {}
+}
+impl MyCmp for f32 {}
+
+fn main() {
+ // Ensure that `impl<F: FnPtr> Ord for F` is never considered for int and float infer vars.
+ 0.0.cmp();
+}
diff --git a/tests/ui/fn/fn-ptr-trait.rs b/tests/ui/fn/fn-ptr-trait.rs
new file mode 100644
index 000000000..45918ae5b
--- /dev/null
+++ b/tests/ui/fn/fn-ptr-trait.rs
@@ -0,0 +1,9 @@
+#![feature(fn_ptr_trait)]
+// check-pass
+
+use std::marker::FnPtr;
+
+trait Foo {}
+impl<T> Foo for Vec<T> where T: FnPtr {}
+
+fn main() {}
diff --git a/tests/ui/fn/issue-39259.rs b/tests/ui/fn/issue-39259.rs
new file mode 100644
index 000000000..5872f1007
--- /dev/null
+++ b/tests/ui/fn/issue-39259.rs
@@ -0,0 +1,13 @@
+#![feature(fn_traits)]
+#![feature(unboxed_closures)]
+
+struct S;
+
+impl Fn(u32) -> u32 for S {
+//~^ ERROR associated type bindings are not allowed here [E0229]
+ fn call(&self) -> u32 {
+ 5
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/fn/issue-39259.stderr b/tests/ui/fn/issue-39259.stderr
new file mode 100644
index 000000000..b656b76bf
--- /dev/null
+++ b/tests/ui/fn/issue-39259.stderr
@@ -0,0 +1,15 @@
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/issue-39259.rs:6:17
+ |
+LL | impl Fn(u32) -> u32 for S {
+ | ^^^ associated type not allowed here
+ |
+help: parenthesized trait syntax expands to `Fn<(u32,), Output=u32>`
+ --> $DIR/issue-39259.rs:6:6
+ |
+LL | impl Fn(u32) -> u32 for S {
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0229`.
diff --git a/tests/ui/generator/clone-impl.stderr b/tests/ui/generator/clone-impl.stderr
index a92646b19..64eb47c1a 100644
--- a/tests/ui/generator/clone-impl.stderr
+++ b/tests/ui/generator/clone-impl.stderr
@@ -110,7 +110,8 @@ LL | fn check_copy<T: Copy>(_x: &T) {}
| ^^^^ required by this bound in `check_copy`
help: consider annotating `NonClone` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct NonClone;
|
error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
@@ -134,7 +135,8 @@ LL | fn check_clone<T: Clone>(_x: &T) {}
| ^^^^^ required by this bound in `check_clone`
help: consider annotating `NonClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NonClone;
|
error: aborting due to 6 previous errors
diff --git a/tests/ui/generator/issue-105084.drop_tracking_mir.stderr b/tests/ui/generator/issue-105084.drop_tracking_mir.stderr
index cfc0cf7cd..1cd4c4e4d 100644
--- a/tests/ui/generator/issue-105084.drop_tracking_mir.stderr
+++ b/tests/ui/generator/issue-105084.drop_tracking_mir.stderr
@@ -1,5 +1,5 @@
error[E0382]: borrow of moved value: `g`
- --> $DIR/issue-105084.rs:44:14
+ --> $DIR/issue-105084.rs:45:14
|
LL | let mut g = || {
| ----- move occurs because `g` has type `[generator@$DIR/issue-105084.rs:22:17: 22:19]`, which does not implement the `Copy` trait
@@ -23,7 +23,7 @@ LL | let mut h = copy(g.clone());
| ++++++++
error[E0277]: the trait bound `Box<(i32, ())>: Copy` is not satisfied in `[generator@$DIR/issue-105084.rs:22:17: 22:19]`
- --> $DIR/issue-105084.rs:38:17
+ --> $DIR/issue-105084.rs:39:17
|
LL | let mut g = || {
| -- within this `[generator@$DIR/issue-105084.rs:22:17: 22:19]`
@@ -32,13 +32,13 @@ LL | let mut h = copy(g);
| ^^^^ within `[generator@$DIR/issue-105084.rs:22:17: 22:19]`, the trait `Copy` is not implemented for `Box<(i32, ())>`
|
note: generator does not implement `Copy` as this value is used across a yield
- --> $DIR/issue-105084.rs:28:25
+ --> $DIR/issue-105084.rs:29:22
|
-LL | let t = box (5, yield);
- | --------^^^^^-
- | | |
- | | yield occurs here, with `box (5, yield)` maybe used later
- | has type `Box<(i32, ())>` which does not implement `Copy`
+LL | Box::new((5, yield));
+ | -------------^^^^^--
+ | | |
+ | | yield occurs here, with `Box::new((5, yield))` maybe used later
+ | has type `Box<(i32, ())>` which does not implement `Copy`
note: required by a bound in `copy`
--> $DIR/issue-105084.rs:17:12
|
diff --git a/tests/ui/generator/issue-105084.rs b/tests/ui/generator/issue-105084.rs
index 7c9a97b40..ff9357b76 100644
--- a/tests/ui/generator/issue-105084.rs
+++ b/tests/ui/generator/issue-105084.rs
@@ -9,7 +9,7 @@
#![feature(generators)]
#![feature(generator_clone)]
#![feature(generator_trait)]
-#![feature(box_syntax)]
+#![feature(rustc_attrs, stmt_expr_attributes)]
use std::ops::Generator;
use std::pin::Pin;
@@ -25,7 +25,8 @@ fn main() {
// - create a Box that is ignored for trait computations;
// - compute fields (and yields);
// - assign to `t`.
- let t = box (5, yield);
+ let t = #[rustc_box]
+ Box::new((5, yield));
drop(t);
};
diff --git a/tests/ui/generator/issue-87142.rs b/tests/ui/generator/issue-87142.rs
index fc10d04d4..7f670919e 100644
--- a/tests/ui/generator/issue-87142.rs
+++ b/tests/ui/generator/issue-87142.rs
@@ -4,7 +4,7 @@
// Regression test for #87142
// This test needs the above flags and the "lib" crate type.
-#![feature(type_alias_impl_trait, generator_trait, generators)]
+#![feature(impl_trait_in_assoc_type, generator_trait, generators)]
#![crate_type = "lib"]
use std::ops::Generator;
diff --git a/tests/ui/generator/non-static-is-unpin.rs b/tests/ui/generator/non-static-is-unpin.rs
index 96d0a8e28..17e23f5bc 100644
--- a/tests/ui/generator/non-static-is-unpin.rs
+++ b/tests/ui/generator/non-static-is-unpin.rs
@@ -1,3 +1,5 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
// run-pass
#![feature(generators, generator_trait)]
diff --git a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr
index 7d0a20169..429b202f6 100644
--- a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr
+++ b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr
@@ -10,7 +10,7 @@ note: generator is not `Send` as this value is used across a yield
--> $DIR/generator-print-verbose-1.rs:38:9
|
LL | let _non_send_gen = make_non_send_generator();
- | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
+ | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
LL | yield;
| ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
LL | };
@@ -37,17 +37,17 @@ note: required because it's used within this generator
|
LL | || {
| ^^
-note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])`
+note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])`
--> $DIR/generator-print-verbose-1.rs:44:30
|
LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`
+note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`
--> $DIR/generator-print-verbose-1.rs:50:34
|
LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()`
+ = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`, `()`
note: required because it's used within this generator
--> $DIR/generator-print-verbose-1.rs:55:20
|
diff --git a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr
index c045b1441..01a30fd2f 100644
--- a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr
+++ b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr
@@ -10,7 +10,7 @@ note: generator is not `Send` as this value is used across a yield
--> $DIR/generator-print-verbose-1.rs:38:9
|
LL | let _non_send_gen = make_non_send_generator();
- | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
+ | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
LL | yield;
| ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
note: required by a bound in `require_send`
@@ -33,17 +33,17 @@ note: required because it's used within this generator
|
LL | || {
| ^^
-note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])`
+note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])`
--> $DIR/generator-print-verbose-1.rs:44:30
|
LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`
+note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`
--> $DIR/generator-print-verbose-1.rs:50:34
|
LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`
+ = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`
note: required because it's used within this generator
--> $DIR/generator-print-verbose-1.rs:55:20
|
diff --git a/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr
index 7d0a20169..429b202f6 100644
--- a/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr
+++ b/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr
@@ -10,7 +10,7 @@ note: generator is not `Send` as this value is used across a yield
--> $DIR/generator-print-verbose-1.rs:38:9
|
LL | let _non_send_gen = make_non_send_generator();
- | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
+ | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
LL | yield;
| ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
LL | };
@@ -37,17 +37,17 @@ note: required because it's used within this generator
|
LL | || {
| ^^
-note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])`
+note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])`
--> $DIR/generator-print-verbose-1.rs:44:30
|
LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`
+note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`
--> $DIR/generator-print-verbose-1.rs:50:34
|
LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()`
+ = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`, `()`
note: required because it's used within this generator
--> $DIR/generator-print-verbose-1.rs:55:20
|
diff --git a/tests/ui/generator/static-not-unpin.stderr b/tests/ui/generator/static-not-unpin.current.stderr
index e3859595f..ecd8ca60c 100644
--- a/tests/ui/generator/static-not-unpin.stderr
+++ b/tests/ui/generator/static-not-unpin.current.stderr
@@ -1,14 +1,15 @@
-error[E0277]: `[static generator@$DIR/static-not-unpin.rs:11:25: 11:34]` cannot be unpinned
- --> $DIR/static-not-unpin.rs:14:18
+error[E0277]: `[static generator@$DIR/static-not-unpin.rs:14:25: 14:34]` cannot be unpinned
+ --> $DIR/static-not-unpin.rs:17:18
|
LL | assert_unpin(generator);
- | ------------ ^^^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:11:25: 11:34]`
+ | ------------ ^^^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:14:25: 14:34]`
| |
| required by a bound introduced by this call
|
- = note: consider using `Box::pin`
+ = note: consider using the `pin!` macro
+ consider using `Box::pin` if you need to access the pinned value outside of the current scope
note: required by a bound in `assert_unpin`
- --> $DIR/static-not-unpin.rs:7:20
+ --> $DIR/static-not-unpin.rs:10:20
|
LL | fn assert_unpin<T: Unpin>(_: T) {
| ^^^^^ required by this bound in `assert_unpin`
diff --git a/tests/ui/generator/static-not-unpin.next.stderr b/tests/ui/generator/static-not-unpin.next.stderr
new file mode 100644
index 000000000..ecd8ca60c
--- /dev/null
+++ b/tests/ui/generator/static-not-unpin.next.stderr
@@ -0,0 +1,19 @@
+error[E0277]: `[static generator@$DIR/static-not-unpin.rs:14:25: 14:34]` cannot be unpinned
+ --> $DIR/static-not-unpin.rs:17:18
+ |
+LL | assert_unpin(generator);
+ | ------------ ^^^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:14:25: 14:34]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: consider using the `pin!` macro
+ consider using `Box::pin` if you need to access the pinned value outside of the current scope
+note: required by a bound in `assert_unpin`
+ --> $DIR/static-not-unpin.rs:10:20
+ |
+LL | fn assert_unpin<T: Unpin>(_: T) {
+ | ^^^^^ required by this bound in `assert_unpin`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/generator/static-not-unpin.rs b/tests/ui/generator/static-not-unpin.rs
index cfcb94737..30d3f2918 100644
--- a/tests/ui/generator/static-not-unpin.rs
+++ b/tests/ui/generator/static-not-unpin.rs
@@ -1,3 +1,6 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
#![feature(generators)]
// normalize-stderr-test "std::pin::Unpin" -> "std::marker::Unpin"
diff --git a/tests/ui/generator/yield-in-box.rs b/tests/ui/generator/yield-in-box.rs
deleted file mode 100644
index dd6fa7c15..000000000
--- a/tests/ui/generator/yield-in-box.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// run-pass
-// Test that box-statements with yields in them work.
-
-#![feature(generators, box_syntax, generator_trait)]
-use std::pin::Pin;
-use std::ops::Generator;
-use std::ops::GeneratorState;
-
-fn main() {
- let x = 0i32;
- || { //~ WARN unused generator that must be used
- let y = 2u32;
- {
- let _t = box (&x, yield 0, &y);
- }
- match box (&x, yield 0, &y) {
- _t => {}
- }
- };
-
- let mut g = |_| box yield;
- assert_eq!(Pin::new(&mut g).resume(1), GeneratorState::Yielded(()));
- assert_eq!(Pin::new(&mut g).resume(2), GeneratorState::Complete(box 2));
-}
diff --git a/tests/ui/generator/yield-in-box.stderr b/tests/ui/generator/yield-in-box.stderr
deleted file mode 100644
index 9d03ee008..000000000
--- a/tests/ui/generator/yield-in-box.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: unused generator that must be used
- --> $DIR/yield-in-box.rs:11:5
- |
-LL | / || {
-LL | | let y = 2u32;
-LL | | {
-LL | | let _t = box (&x, yield 0, &y);
-... |
-LL | | }
-LL | | };
- | |_____^
- |
- = note: generators are lazy and do nothing unless resumed
- = note: `#[warn(unused_must_use)]` on by default
-
-warning: 1 warning emitted
-
diff --git a/tests/ui/generic-associated-types/bugs/issue-100013.stderr b/tests/ui/generic-associated-types/bugs/issue-100013.stderr
index 9db124a81..86dbad84d 100644
--- a/tests/ui/generic-associated-types/bugs/issue-100013.stderr
+++ b/tests/ui/generic-associated-types/bugs/issue-100013.stderr
@@ -28,12 +28,12 @@ LL | | async {}.await; // a yield point
LL | | }
| |_____^
|
-note: the lifetime defined here...
+note: the lifetime `'b` defined here...
--> $DIR/issue-100013.rs:21:14
|
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
| ^^
-note: ...must outlive the lifetime defined here
+note: ...must outlive the lifetime `'a` defined here
--> $DIR/issue-100013.rs:21:10
|
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
@@ -62,12 +62,12 @@ LL | | async {}.await; // a yield point
LL | | }
| |_____^
|
-note: the lifetime defined here...
+note: the lifetime `'b` defined here...
--> $DIR/issue-100013.rs:28:18
|
LL | fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
| ^^
-note: ...must outlive the lifetime defined here
+note: ...must outlive the lifetime `'a` defined here
--> $DIR/issue-100013.rs:28:10
|
LL | fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
diff --git a/tests/ui/generic-associated-types/gat-bounds-normalize-pred.rs b/tests/ui/generic-associated-types/gat-bounds-normalize-pred.rs
new file mode 100644
index 000000000..b43f98228
--- /dev/null
+++ b/tests/ui/generic-associated-types/gat-bounds-normalize-pred.rs
@@ -0,0 +1,17 @@
+// check-pass
+
+trait Foo {
+ type Assoc<T>: PartialEq<Self::Assoc<i32>>;
+}
+
+impl Foo for () {
+ type Assoc<T> = Wrapper<T>;
+}
+
+struct Wrapper<T>(T);
+
+impl<T> PartialEq<Wrapper<i32>> for Wrapper<T> {
+ fn eq(&self, _other: &Wrapper<i32>) -> bool { true }
+}
+
+fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-86218-2.rs b/tests/ui/generic-associated-types/issue-86218-2.rs
index 63c839ea8..8a5e4a0f3 100644
--- a/tests/ui/generic-associated-types/issue-86218-2.rs
+++ b/tests/ui/generic-associated-types/issue-86218-2.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Stream {
type Item;
@@ -17,7 +17,9 @@ trait Yay<AdditionalValue> {
impl<T> Yay<T> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
- fn foo<'s>() -> Self::InnerStream<'s> { () }
+ fn foo<'s>() -> Self::InnerStream<'s> {
+ ()
+ }
}
fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-86218.rs b/tests/ui/generic-associated-types/issue-86218.rs
index b2c3071f0..61cfdd35a 100644
--- a/tests/ui/generic-associated-types/issue-86218.rs
+++ b/tests/ui/generic-associated-types/issue-86218.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Stream {
type Item;
@@ -18,7 +18,9 @@ trait Yay<AdditionalValue> {
impl<'a> Yay<&'a ()> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
//^ ERROR does not fulfill the required lifetime
- fn foo<'s>() -> Self::InnerStream<'s> { () }
+ fn foo<'s>() -> Self::InnerStream<'s> {
+ ()
+ }
}
fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-87258_a.rs b/tests/ui/generic-associated-types/issue-87258_a.rs
index 9ab683d3d..6f737b21f 100644
--- a/tests/ui/generic-associated-types/issue-87258_a.rs
+++ b/tests/ui/generic-associated-types/issue-87258_a.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
// See https://github.com/rust-lang/rust/issues/87258#issuecomment-883293367
diff --git a/tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr b/tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr
index b1abe012b..a44bb6993 100644
--- a/tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr
+++ b/tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr
@@ -12,7 +12,8 @@ LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family2::Member`
help: consider annotating `Foo` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct Foo;
|
error: aborting due to previous error
diff --git a/tests/ui/generic-associated-types/issue-87429-specialization.stderr b/tests/ui/generic-associated-types/issue-87429-specialization.stderr
index 11c4ebf60..c259c89a7 100644
--- a/tests/ui/generic-associated-types/issue-87429-specialization.stderr
+++ b/tests/ui/generic-associated-types/issue-87429-specialization.stderr
@@ -22,7 +22,8 @@ LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family::Member`
help: consider annotating `Foo` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct Foo;
|
error: aborting due to previous error; 1 warning emitted
diff --git a/tests/ui/generic-associated-types/issue-88595.rs b/tests/ui/generic-associated-types/issue-88595.rs
index 24641ee1f..5a40a6129 100644
--- a/tests/ui/generic-associated-types/issue-88595.rs
+++ b/tests/ui/generic-associated-types/issue-88595.rs
@@ -1,7 +1,8 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
fn main() {}
+#[rustfmt::skip]
trait A<'a> {
type B<'b>: Clone
// FIXME(generic_associated_types): Remove one of the below bounds
diff --git a/tests/ui/generic-associated-types/issue-88595.stderr b/tests/ui/generic-associated-types/issue-88595.stderr
index bcefc8066..79d3479af 100644
--- a/tests/ui/generic-associated-types/issue-88595.stderr
+++ b/tests/ui/generic-associated-types/issue-88595.stderr
@@ -1,11 +1,11 @@
error: non-defining opaque type use in defining scope
- --> $DIR/issue-88595.rs:20:35
+ --> $DIR/issue-88595.rs:21:35
|
LL | fn a(&'a self) -> Self::B<'a> {}
| ^^
|
note: lifetime used multiple times
- --> $DIR/issue-88595.rs:17:6
+ --> $DIR/issue-88595.rs:18:6
|
LL | impl<'a> A<'a> for C {
| ^^
diff --git a/tests/ui/generic-associated-types/issue-89008.rs b/tests/ui/generic-associated-types/issue-89008.rs
index 669dbafb5..94b07e674 100644
--- a/tests/ui/generic-associated-types/issue-89008.rs
+++ b/tests/ui/generic-associated-types/issue-89008.rs
@@ -1,7 +1,7 @@
// check-pass
// edition:2021
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
use std::future::Future;
use std::marker::PhantomData;
diff --git a/tests/ui/generic-associated-types/issue-90014.rs b/tests/ui/generic-associated-types/issue-90014.rs
index 55db95a6d..c4d762796 100644
--- a/tests/ui/generic-associated-types/issue-90014.rs
+++ b/tests/ui/generic-associated-types/issue-90014.rs
@@ -1,11 +1,13 @@
// edition:2018
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
use std::future::Future;
trait MakeFut {
- type Fut<'a> where Self: 'a;
+ type Fut<'a>
+ where
+ Self: 'a;
fn make_fut<'a>(&'a self) -> Self::Fut<'a>;
}
diff --git a/tests/ui/generic-associated-types/issue-90014.stderr b/tests/ui/generic-associated-types/issue-90014.stderr
index b4b1bc7da..0d49398ca 100644
--- a/tests/ui/generic-associated-types/issue-90014.stderr
+++ b/tests/ui/generic-associated-types/issue-90014.stderr
@@ -1,14 +1,14 @@
error[E0477]: the type `&mut ()` does not fulfill the required lifetime
- --> $DIR/issue-90014.rs:13:20
+ --> $DIR/issue-90014.rs:15:20
|
-LL | type Fut<'a> where Self: 'a;
+LL | type Fut<'a>
| ------------ definition of `Fut` from trait
...
LL | type Fut<'a> = impl Future<Output = ()>;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
note: type must outlive the lifetime `'a` as defined here
- --> $DIR/issue-90014.rs:13:14
+ --> $DIR/issue-90014.rs:15:14
|
LL | type Fut<'a> = impl Future<Output = ()>;
| ^^
diff --git a/tests/ui/generics/auxiliary/foreign-generic-mismatch.rs b/tests/ui/generics/auxiliary/foreign-generic-mismatch.rs
new file mode 100644
index 000000000..d89c1e036
--- /dev/null
+++ b/tests/ui/generics/auxiliary/foreign-generic-mismatch.rs
@@ -0,0 +1,3 @@
+pub fn const_arg<const N: usize, T>() {}
+
+pub fn lt_arg<'a: 'a>() {}
diff --git a/tests/ui/generics/foreign-generic-mismatch.rs b/tests/ui/generics/foreign-generic-mismatch.rs
new file mode 100644
index 000000000..403fd73d7
--- /dev/null
+++ b/tests/ui/generics/foreign-generic-mismatch.rs
@@ -0,0 +1,10 @@
+// aux-build: foreign-generic-mismatch.rs
+
+extern crate foreign_generic_mismatch;
+
+fn main() {
+ foreign_generic_mismatch::const_arg::<()>();
+ //~^ ERROR function takes 2 generic arguments but 1 generic argument was supplied
+ foreign_generic_mismatch::lt_arg::<'static, 'static>();
+ //~^ ERROR function takes 1 lifetime argument but 2 lifetime arguments were supplied
+}
diff --git a/tests/ui/generics/foreign-generic-mismatch.stderr b/tests/ui/generics/foreign-generic-mismatch.stderr
new file mode 100644
index 000000000..5322b3f91
--- /dev/null
+++ b/tests/ui/generics/foreign-generic-mismatch.stderr
@@ -0,0 +1,35 @@
+error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied
+ --> $DIR/foreign-generic-mismatch.rs:6:31
+ |
+LL | foreign_generic_mismatch::const_arg::<()>();
+ | ^^^^^^^^^ -- supplied 1 generic argument
+ | |
+ | expected 2 generic arguments
+ |
+note: function defined here, with 2 generic parameters: `N`, `T`
+ --> $DIR/auxiliary/foreign-generic-mismatch.rs:1:8
+ |
+LL | pub fn const_arg<const N: usize, T>() {}
+ | ^^^^^^^^^ -------------- -
+help: add missing generic argument
+ |
+LL | foreign_generic_mismatch::const_arg::<(), T>();
+ | +++
+
+error[E0107]: function takes 1 lifetime argument but 2 lifetime arguments were supplied
+ --> $DIR/foreign-generic-mismatch.rs:8:31
+ |
+LL | foreign_generic_mismatch::lt_arg::<'static, 'static>();
+ | ^^^^^^ ------- help: remove this lifetime argument
+ | |
+ | expected 1 lifetime argument
+ |
+note: function defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/auxiliary/foreign-generic-mismatch.rs:3:8
+ |
+LL | pub fn lt_arg<'a: 'a>() {}
+ | ^^^^^^ --
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/tests/ui/slightly-nice-generic-literal-messages.rs b/tests/ui/generics/slightly-nice-generic-literal-messages.rs
index 268009f65..268009f65 100644
--- a/tests/ui/slightly-nice-generic-literal-messages.rs
+++ b/tests/ui/generics/slightly-nice-generic-literal-messages.rs
diff --git a/tests/ui/slightly-nice-generic-literal-messages.stderr b/tests/ui/generics/slightly-nice-generic-literal-messages.stderr
index 83ef522ab..83ef522ab 100644
--- a/tests/ui/slightly-nice-generic-literal-messages.stderr
+++ b/tests/ui/generics/slightly-nice-generic-literal-messages.stderr
diff --git a/tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs b/tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs
index f55566602..4b14a314e 100644
--- a/tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs
+++ b/tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs
@@ -10,44 +10,31 @@ macro_rules! m {
fn main() {
m!(0, ..u8::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..u16::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..u32::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..u64::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..u128::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..i8::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..i16::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..i32::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..i64::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0, ..i128::MIN);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0f32, ..f32::NEG_INFINITY);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!(0f64, ..f64::NEG_INFINITY);
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
m!('a', ..'\u{0}');
//~^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
}
diff --git a/tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr b/tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr
index 56b224a85..e9702bb38 100644
--- a/tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr
+++ b/tests/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr
@@ -5,155 +5,77 @@ LL | m!(0, ..u8::MIN);
| ^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:14:11
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:13:11
|
LL | m!(0, ..u16::MIN);
| ^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:17:11
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:15:11
|
LL | m!(0, ..u32::MIN);
| ^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:20:11
- |
-LL | m!(0, ..u64::MIN);
- | ^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:23:11
- |
-LL | m!(0, ..u128::MIN);
- | ^^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:27:11
- |
-LL | m!(0, ..i8::MIN);
- | ^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:30:11
- |
-LL | m!(0, ..i16::MIN);
- | ^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:33:11
- |
-LL | m!(0, ..i32::MIN);
- | ^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:36:11
- |
-LL | m!(0, ..i64::MIN);
- | ^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:39:11
- |
-LL | m!(0, ..i128::MIN);
- | ^^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:43:14
- |
-LL | m!(0f32, ..f32::NEG_INFINITY);
- | ^^^^^^^^^^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:46:14
- |
-LL | m!(0f64, ..f64::NEG_INFINITY);
- | ^^^^^^^^^^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:50:13
- |
-LL | m!('a', ..'\u{0}');
- | ^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:11:11
- |
-LL | m!(0, ..u8::MIN);
- | ^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:14:11
- |
-LL | m!(0, ..u16::MIN);
- | ^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
--> $DIR/half-open-range-pats-thir-lower-empty.rs:17:11
|
-LL | m!(0, ..u32::MIN);
- | ^^^^^^^^^^
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:20:11
- |
LL | m!(0, ..u64::MIN);
| ^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:23:11
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:19:11
|
LL | m!(0, ..u128::MIN);
| ^^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:27:11
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:22:11
|
LL | m!(0, ..i8::MIN);
| ^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:30:11
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:24:11
|
LL | m!(0, ..i16::MIN);
| ^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:33:11
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:26:11
|
LL | m!(0, ..i32::MIN);
| ^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:36:11
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:28:11
|
LL | m!(0, ..i64::MIN);
| ^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:39:11
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:30:11
|
LL | m!(0, ..i128::MIN);
| ^^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:43:14
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:33:14
|
LL | m!(0f32, ..f32::NEG_INFINITY);
| ^^^^^^^^^^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:46:14
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:35:14
|
LL | m!(0f64, ..f64::NEG_INFINITY);
| ^^^^^^^^^^^^^^^^^^^
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:50:13
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:38:13
|
LL | m!('a', ..'\u{0}');
| ^^^^^^^^^
-error: aborting due to 26 previous errors
+error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0579`.
diff --git a/tests/ui/higher-rank-trait-bounds/fn-ptr.classic.stderr b/tests/ui/higher-rank-trait-bounds/fn-ptr.classic.stderr
new file mode 100644
index 000000000..9af6bc45c
--- /dev/null
+++ b/tests/ui/higher-rank-trait-bounds/fn-ptr.classic.stderr
@@ -0,0 +1,19 @@
+error[E0277]: expected a `Fn<(&'w (),)>` closure, found `fn(&'w ())`
+ --> $DIR/fn-ptr.rs:12:5
+ |
+LL | ice();
+ | ^^^ expected an `Fn<(&'w (),)>` closure, found `fn(&'w ())`
+ |
+ = help: the trait `for<'w> Fn<(&'w (),)>` is not implemented for `fn(&'w ())`
+note: required by a bound in `ice`
+ --> $DIR/fn-ptr.rs:7:25
+ |
+LL | fn ice()
+ | --- required by a bound in this function
+LL | where
+LL | for<'w> fn(&'w ()): Fn(&'w ()),
+ | ^^^^^^^^^^ required by this bound in `ice`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/higher-rank-trait-bounds/fn-ptr.rs b/tests/ui/higher-rank-trait-bounds/fn-ptr.rs
new file mode 100644
index 000000000..853160f96
--- /dev/null
+++ b/tests/ui/higher-rank-trait-bounds/fn-ptr.rs
@@ -0,0 +1,14 @@
+// revisions: classic next
+//[next] compile-flags: -Ztrait-solver=next
+//[next] check-pass
+
+fn ice()
+where
+ for<'w> fn(&'w ()): Fn(&'w ()),
+{
+}
+
+fn main() {
+ ice();
+ //[classic]~^ ERROR expected a `Fn<(&'w (),)>` closure, found `fn(&'w ())`
+}
diff --git a/tests/ui/higher-rank-trait-bounds/issue-95230.new.stderr b/tests/ui/higher-rank-trait-bounds/issue-95230.new.stderr
new file mode 100644
index 000000000..d4bc5b672
--- /dev/null
+++ b/tests/ui/higher-rank-trait-bounds/issue-95230.new.stderr
@@ -0,0 +1,19 @@
+error[E0275]: overflow evaluating the requirement `for<'a> &'a mut Bar well-formed`
+ --> $DIR/issue-95230.rs:9:13
+ |
+LL | for<'a> &'a mut Self:;
+ | ^^^^^^^^^^^^
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_95230`)
+note: required by a bound in `Bar`
+ --> $DIR/issue-95230.rs:9:13
+ |
+LL | pub struct Bar
+ | --- required by a bound in this struct
+LL | where
+LL | for<'a> &'a mut Self:;
+ | ^^^^^^^^^^^^ required by this bound in `Bar`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/higher-rank-trait-bounds/issue-95230.rs b/tests/ui/higher-rank-trait-bounds/issue-95230.rs
index 92c506eab..769b6a925 100644
--- a/tests/ui/higher-rank-trait-bounds/issue-95230.rs
+++ b/tests/ui/higher-rank-trait-bounds/issue-95230.rs
@@ -1,4 +1,8 @@
-// check-pass
+// revisions: old new
+//[new] compile-flags: -Ztrait-solver=next
+//[old] check-pass
+//[new] known-bug: #109764
+
pub struct Bar
where
diff --git a/tests/ui/hygiene/arguments.rs b/tests/ui/hygiene/arguments.rs
index f0f732f4c..ab58301d4 100644
--- a/tests/ui/hygiene/arguments.rs
+++ b/tests/ui/hygiene/arguments.rs
@@ -1,5 +1,3 @@
-// ignore-pretty pretty-printing is unhygienic
-
#![feature(decl_macro)]
macro m($t:ty, $e:expr) {
diff --git a/tests/ui/hygiene/arguments.stderr b/tests/ui/hygiene/arguments.stderr
index d072086e0..714178375 100644
--- a/tests/ui/hygiene/arguments.stderr
+++ b/tests/ui/hygiene/arguments.stderr
@@ -1,5 +1,5 @@
error[E0412]: cannot find type `S` in this scope
- --> $DIR/arguments.rs:16:8
+ --> $DIR/arguments.rs:14:8
|
LL | m!(S, S);
| ^ not found in this scope
diff --git a/tests/ui/hygiene/assoc_item_ctxt.rs b/tests/ui/hygiene/assoc_item_ctxt.rs
index 65593d1d5..f09f81a5d 100644
--- a/tests/ui/hygiene/assoc_item_ctxt.rs
+++ b/tests/ui/hygiene/assoc_item_ctxt.rs
@@ -1,5 +1,3 @@
-// ignore-pretty pretty-printing is unhygienic
-
#![feature(decl_macro)]
#![allow(unused)]
diff --git a/tests/ui/hygiene/assoc_item_ctxt.stderr b/tests/ui/hygiene/assoc_item_ctxt.stderr
index d65716ec2..effa9e8d6 100644
--- a/tests/ui/hygiene/assoc_item_ctxt.stderr
+++ b/tests/ui/hygiene/assoc_item_ctxt.stderr
@@ -1,5 +1,5 @@
error[E0407]: method `method` is not a member of trait `Tr`
- --> $DIR/assoc_item_ctxt.rs:35:13
+ --> $DIR/assoc_item_ctxt.rs:33:13
|
LL | fn method() {}
| ^^^------^^^^^
@@ -13,7 +13,7 @@ LL | mac_trait_impl!();
= note: this error originates in the macro `mac_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0046]: not all trait items implemented, missing: `method`
- --> $DIR/assoc_item_ctxt.rs:34:9
+ --> $DIR/assoc_item_ctxt.rs:32:9
|
LL | fn method();
| ------------ `method` from trait
diff --git a/tests/ui/hygiene/assoc_ty_bindings.rs b/tests/ui/hygiene/assoc_ty_bindings.rs
index 0567beab9..a78612749 100644
--- a/tests/ui/hygiene/assoc_ty_bindings.rs
+++ b/tests/ui/hygiene/assoc_ty_bindings.rs
@@ -1,5 +1,4 @@
// check-pass
-// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, associated_type_defaults)]
diff --git a/tests/ui/hygiene/auxiliary/legacy_interaction.rs b/tests/ui/hygiene/auxiliary/legacy_interaction.rs
index 90d5243b7..3293e346d 100644
--- a/tests/ui/hygiene/auxiliary/legacy_interaction.rs
+++ b/tests/ui/hygiene/auxiliary/legacy_interaction.rs
@@ -1,5 +1,3 @@
-// ignore-pretty pretty-printing is unhygienic
-
#[macro_export]
macro_rules! m {
() => {
diff --git a/tests/ui/hygiene/fields.rs b/tests/ui/hygiene/fields.rs
index 7a417b46f..86b3d8151 100644
--- a/tests/ui/hygiene/fields.rs
+++ b/tests/ui/hygiene/fields.rs
@@ -1,5 +1,3 @@
-// ignore-pretty pretty-printing is unhygienic
-
#![feature(decl_macro)]
mod foo {
diff --git a/tests/ui/hygiene/fields.stderr b/tests/ui/hygiene/fields.stderr
index 978120b1f..99252c4b7 100644
--- a/tests/ui/hygiene/fields.stderr
+++ b/tests/ui/hygiene/fields.stderr
@@ -1,5 +1,5 @@
error: type `foo::S` is private
- --> $DIR/fields.rs:15:17
+ --> $DIR/fields.rs:13:17
|
LL | let s = S { x: 0 };
| ^^^^^^^^^^ private type
@@ -10,7 +10,7 @@ LL | let s = foo::m!(S, x);
= note: this error originates in the macro `foo::m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: type `foo::S` is private
- --> $DIR/fields.rs:16:17
+ --> $DIR/fields.rs:14:17
|
LL | let _ = s.x;
| ^ private type
@@ -21,7 +21,7 @@ LL | let s = foo::m!(S, x);
= note: this error originates in the macro `foo::m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: type `T` is private
- --> $DIR/fields.rs:18:17
+ --> $DIR/fields.rs:16:17
|
LL | let t = T(0);
| ^^^^ private type
@@ -32,7 +32,7 @@ LL | let s = foo::m!(S, x);
= note: this error originates in the macro `foo::m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: type `T` is private
- --> $DIR/fields.rs:19:17
+ --> $DIR/fields.rs:17:17
|
LL | let _ = t.0;
| ^ private type
diff --git a/tests/ui/hygiene/generic_params.rs b/tests/ui/hygiene/generic_params.rs
index 3b6216c3e..b42152955 100644
--- a/tests/ui/hygiene/generic_params.rs
+++ b/tests/ui/hygiene/generic_params.rs
@@ -1,7 +1,6 @@
// Ensure that generic parameters always have modern hygiene.
// check-pass
-// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, rustc_attrs)]
diff --git a/tests/ui/hygiene/globs.stderr b/tests/ui/hygiene/globs.stderr
index c01901be5..180172644 100644
--- a/tests/ui/hygiene/globs.stderr
+++ b/tests/ui/hygiene/globs.stderr
@@ -13,7 +13,7 @@ LL | g();
| ~
help: consider importing this function
|
-LL | use foo::f;
+LL + use foo::f;
|
error[E0425]: cannot find function `g` in this scope
@@ -39,7 +39,7 @@ LL | f();
| ~
help: consider importing this function
|
-LL | use bar::g;
+LL + use bar::g;
|
error[E0425]: cannot find function `f` in this scope
diff --git a/tests/ui/hygiene/impl_items.rs b/tests/ui/hygiene/impl_items.rs
index ddb25c06b..51088e369 100644
--- a/tests/ui/hygiene/impl_items.rs
+++ b/tests/ui/hygiene/impl_items.rs
@@ -1,5 +1,3 @@
-// ignore-pretty pretty-printing is unhygienic
-
#![feature(decl_macro)]
mod foo {
diff --git a/tests/ui/hygiene/impl_items.stderr b/tests/ui/hygiene/impl_items.stderr
index 46a250038..32ba3741a 100644
--- a/tests/ui/hygiene/impl_items.stderr
+++ b/tests/ui/hygiene/impl_items.stderr
@@ -1,5 +1,5 @@
error: type `for<'a> fn(&'a foo::S) {foo::S::f}` is private
- --> $DIR/impl_items.rs:12:23
+ --> $DIR/impl_items.rs:10:23
|
LL | let _: () = S.f();
| ^ private type
diff --git a/tests/ui/hygiene/intercrate.rs b/tests/ui/hygiene/intercrate.rs
index d9b5b789e..2de62f6af 100644
--- a/tests/ui/hygiene/intercrate.rs
+++ b/tests/ui/hygiene/intercrate.rs
@@ -1,5 +1,3 @@
-// ignore-pretty pretty-printing is unhygienic
-
// aux-build:intercrate.rs
#![feature(decl_macro)]
diff --git a/tests/ui/hygiene/intercrate.stderr b/tests/ui/hygiene/intercrate.stderr
index 91358b279..f108617fb 100644
--- a/tests/ui/hygiene/intercrate.stderr
+++ b/tests/ui/hygiene/intercrate.stderr
@@ -1,5 +1,5 @@
error: type `fn() -> u32 {foo::bar::f}` is private
- --> $DIR/intercrate.rs:10:16
+ --> $DIR/intercrate.rs:8:16
|
LL | assert_eq!(intercrate::foo::m!(), 1);
| ^^^^^^^^^^^^^^^^^^^^^ private type
diff --git a/tests/ui/hygiene/issue-47311.rs b/tests/ui/hygiene/issue-47311.rs
index 5c2379a8a..3f1b73973 100644
--- a/tests/ui/hygiene/issue-47311.rs
+++ b/tests/ui/hygiene/issue-47311.rs
@@ -1,5 +1,4 @@
// check-pass
-// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]
#![allow(unused)]
diff --git a/tests/ui/hygiene/issue-47312.rs b/tests/ui/hygiene/issue-47312.rs
index bbcb3a7f3..c8b5c3676 100644
--- a/tests/ui/hygiene/issue-47312.rs
+++ b/tests/ui/hygiene/issue-47312.rs
@@ -1,5 +1,4 @@
// check-pass
-// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]
#![allow(unused)]
diff --git a/tests/ui/hygiene/items.rs b/tests/ui/hygiene/items.rs
index 1c625a972..a7ed749f5 100644
--- a/tests/ui/hygiene/items.rs
+++ b/tests/ui/hygiene/items.rs
@@ -1,5 +1,4 @@
// check-pass
-// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]
diff --git a/tests/ui/hygiene/legacy_interaction.rs b/tests/ui/hygiene/legacy_interaction.rs
index 52008eed5..4d150baf5 100644
--- a/tests/ui/hygiene/legacy_interaction.rs
+++ b/tests/ui/hygiene/legacy_interaction.rs
@@ -1,6 +1,5 @@
// check-pass
#![allow(dead_code)]
-// ignore-pretty pretty-printing is unhygienic
// aux-build:legacy_interaction.rs
diff --git a/tests/ui/hygiene/lexical.rs b/tests/ui/hygiene/lexical.rs
index 3d25c7209..81de974c2 100644
--- a/tests/ui/hygiene/lexical.rs
+++ b/tests/ui/hygiene/lexical.rs
@@ -1,5 +1,4 @@
// check-pass
-// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]
diff --git a/tests/ui/hygiene/no_implicit_prelude.stderr b/tests/ui/hygiene/no_implicit_prelude.stderr
index c48c84035..96187b1c5 100644
--- a/tests/ui/hygiene/no_implicit_prelude.stderr
+++ b/tests/ui/hygiene/no_implicit_prelude.stderr
@@ -10,7 +10,7 @@ LL | Vec::new();
= note: this error originates in the macro `::bar::m` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this struct
|
-LL | use std::vec::Vec;
+LL + use std::vec::Vec;
|
error[E0599]: no method named `clone` found for unit type `()` in the current scope
@@ -26,7 +26,7 @@ LL | ().clone()
= note: this error originates in the macro `::bar::m` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use std::clone::Clone;
+LL + use std::clone::Clone;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/hygiene/panic-location.run.stderr b/tests/ui/hygiene/panic-location.run.stderr
index 1c6a7b02f..a7252a400 100644
--- a/tests/ui/hygiene/panic-location.run.stderr
+++ b/tests/ui/hygiene/panic-location.run.stderr
@@ -1,2 +1,2 @@
-thread 'main' panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:525:5
+thread 'main' panicked at 'capacity overflow', library/alloc/src/raw_vec.rs:524:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/tests/ui/hygiene/specialization.rs b/tests/ui/hygiene/specialization.rs
index 656aa880a..b8c4c1b0d 100644
--- a/tests/ui/hygiene/specialization.rs
+++ b/tests/ui/hygiene/specialization.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]
diff --git a/tests/ui/hygiene/trait_items-2.rs b/tests/ui/hygiene/trait_items-2.rs
index 39edfc37d..cd9122656 100644
--- a/tests/ui/hygiene/trait_items-2.rs
+++ b/tests/ui/hygiene/trait_items-2.rs
@@ -1,5 +1,4 @@
// check-pass
-// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro)]
diff --git a/tests/ui/hygiene/trait_items.stderr b/tests/ui/hygiene/trait_items.stderr
index 80bdbe0e2..f303534c7 100644
--- a/tests/ui/hygiene/trait_items.stderr
+++ b/tests/ui/hygiene/trait_items.stderr
@@ -14,7 +14,7 @@ LL | pub macro m() { ().f() }
= note: this error originates in the macro `::baz::m` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use foo::T;
+LL + use foo::T;
|
error: aborting due to previous error
diff --git a/tests/ui/hygiene/wrap_unhygienic_example.rs b/tests/ui/hygiene/wrap_unhygienic_example.rs
index 50c6b35ab..f6b481568 100644
--- a/tests/ui/hygiene/wrap_unhygienic_example.rs
+++ b/tests/ui/hygiene/wrap_unhygienic_example.rs
@@ -1,5 +1,4 @@
// check-pass
-// ignore-pretty pretty-printing is unhygienic
// aux-build:my_crate.rs
// aux-build:unhygienic_example.rs
diff --git a/tests/ui/hygiene/xcrate.rs b/tests/ui/hygiene/xcrate.rs
index 6981ce3f6..6366bebb5 100644
--- a/tests/ui/hygiene/xcrate.rs
+++ b/tests/ui/hygiene/xcrate.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty pretty-printing is unhygienic
// aux-build:xcrate.rs
diff --git a/tests/ui/impl-trait/associated-impl-trait-type-generic-trait.rs b/tests/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
index 6c7c46b0e..0908a0bf3 100644
--- a/tests/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
+++ b/tests/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
// build-pass (FIXME(62277): could be check-pass?)
trait Bar {}
diff --git a/tests/ui/impl-trait/associated-impl-trait-type-trivial.rs b/tests/ui/impl-trait/associated-impl-trait-type-trivial.rs
index cdda341ca..b5ea90bb0 100644
--- a/tests/ui/impl-trait/associated-impl-trait-type-trivial.rs
+++ b/tests/ui/impl-trait/associated-impl-trait-type-trivial.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
// build-pass (FIXME(62277): could be check-pass?)
trait Bar {}
diff --git a/tests/ui/impl-trait/associated-impl-trait-type.rs b/tests/ui/impl-trait/associated-impl-trait-type.rs
index d0661d66f..f5981261c 100644
--- a/tests/ui/impl-trait/associated-impl-trait-type.rs
+++ b/tests/ui/impl-trait/associated-impl-trait-type.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
// build-pass (FIXME(62277): could be check-pass?)
trait Bar {}
diff --git a/tests/ui/impl-trait/auto-trait-leak.stderr b/tests/ui/impl-trait/auto-trait-leak.stderr
index fd0358421..e6c750d0e 100644
--- a/tests/ui/impl-trait/auto-trait-leak.stderr
+++ b/tests/ui/impl-trait/auto-trait-leak.stderr
@@ -29,6 +29,11 @@ note: ...which requires building MIR for `cycle1`...
|
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
|
@@ -70,6 +75,11 @@ note: ...which requires building MIR for `cycle2`...
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires match-checking `cycle2`...
+ --> $DIR/auto-trait-leak.rs:19:1
+ |
+LL | fn cycle2() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires building THIR for `cycle2`...
--> $DIR/auto-trait-leak.rs:19:1
|
diff --git a/tests/ui/impl-trait/impl-fn-hrtb-bounds-2.stderr b/tests/ui/impl-trait/impl-fn-hrtb-bounds-2.stderr
index d56e1273f..835f7f765 100644
--- a/tests/ui/impl-trait/impl-fn-hrtb-bounds-2.stderr
+++ b/tests/ui/impl-trait/impl-fn-hrtb-bounds-2.stderr
@@ -6,7 +6,7 @@ LL | fn a() -> impl Fn(&u8) -> impl Debug {
LL | |x| x
| --- ^
| |
- | hidden type `&u8` captures the anonymous lifetime #1 defined here
+ | hidden type `&u8` captures the anonymous lifetime as defined here
error: aborting due to previous error
diff --git a/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs b/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs
index 74df300f8..ffeabe5c2 100644
--- a/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs
+++ b/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs
@@ -1,11 +1,14 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+
#![feature(return_position_impl_trait_in_trait)]
+use std::ops::Deref;
+
pub trait Foo {
- fn bar() -> impl Sized;
+ fn bar() -> impl Deref<Target = impl Sized>;
}
pub struct Foreign;
-
impl Foo for Foreign {
- fn bar() {}
+ fn bar() -> &'static () { &() }
}
diff --git a/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.stderr b/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.current.stderr
index d681ecf25..05c025cc1 100644
--- a/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.stderr
+++ b/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/box-coerce-span-in-default.rs:3:12
+ --> $DIR/box-coerce-span-in-default.rs:5:12
|
LL | #![feature(return_position_impl_trait_in_trait)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.next.stderr b/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.next.stderr
new file mode 100644
index 000000000..05c025cc1
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.next.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/box-coerce-span-in-default.rs:5:12
+ |
+LL | #![feature(return_position_impl_trait_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs b/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs
index a4d483dee..163bb4fcf 100644
--- a/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs
+++ b/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.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)]
//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete
diff --git a/tests/ui/impl-trait/in-trait/deep-match-works.rs b/tests/ui/impl-trait/in-trait/deep-match-works.rs
index 772da845e..5c9d2e356 100644
--- a/tests/ui/impl-trait/in-trait/deep-match-works.rs
+++ b/tests/ui/impl-trait/in-trait/deep-match-works.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)]
#![allow(incomplete_features)]
@@ -10,7 +12,9 @@ trait Foo {
}
impl Foo for () {
- fn bar() -> Wrapper<i32> { Wrapper(0) }
+ fn bar() -> Wrapper<i32> {
+ Wrapper(0)
+ }
}
fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/deep-match.stderr b/tests/ui/impl-trait/in-trait/deep-match.current.stderr
index 3eba419c0..400db20c7 100644
--- a/tests/ui/impl-trait/in-trait/deep-match.stderr
+++ b/tests/ui/impl-trait/in-trait/deep-match.current.stderr
@@ -1,7 +1,7 @@
error[E0053]: method `bar` has an incompatible return type for trait
- --> $DIR/deep-match.rs:11:17
+ --> $DIR/deep-match.rs:14:17
|
-LL | fn bar() -> i32 { 0 }
+LL | fn bar() -> i32 {
| ^^^
| |
| expected `Wrapper<_>`, found `i32`
diff --git a/tests/ui/impl-trait/in-trait/deep-match.next.stderr b/tests/ui/impl-trait/in-trait/deep-match.next.stderr
new file mode 100644
index 000000000..400db20c7
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/deep-match.next.stderr
@@ -0,0 +1,15 @@
+error[E0053]: method `bar` has an incompatible return type for trait
+ --> $DIR/deep-match.rs:14:17
+ |
+LL | fn bar() -> i32 {
+ | ^^^
+ | |
+ | expected `Wrapper<_>`, found `i32`
+ | return type in trait
+ |
+ = note: expected struct `Wrapper<_>`
+ found type `i32`
+
+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/deep-match.rs b/tests/ui/impl-trait/in-trait/deep-match.rs
index a6385147c..413d054e1 100644
--- a/tests/ui/impl-trait/in-trait/deep-match.rs
+++ b/tests/ui/impl-trait/in-trait/deep-match.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
@@ -8,8 +11,10 @@ trait Foo {
}
impl Foo for () {
- fn bar() -> i32 { 0 }
- //~^ ERROR method `bar` has an incompatible return type for trait
+ fn bar() -> i32 {
+ //~^ ERROR method `bar` has an incompatible return type for trait
+ 0
+ }
}
fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr
index cc3bdf0e5..85450e3b0 100644
--- a/tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/default-body-type-err-2.rs:8:9
+ --> $DIR/default-body-type-err-2.rs:10:9
|
LL | 42
| ^^- help: try using a conversion method: `.to_string()`
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr
new file mode 100644
index 000000000..85450e3b0
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/default-body-type-err-2.rs:10:9
+ |
+LL | 42
+ | ^^- help: try using a conversion method: `.to_string()`
+ | |
+ | expected `String`, found integer
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.rs b/tests/ui/impl-trait/in-trait/default-body-type-err-2.rs
index 45ae2b8ad..623237763 100644
--- a/tests/ui/impl-trait/in-trait/default-body-type-err-2.rs
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err-2.rs
@@ -1,4 +1,6 @@
// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![allow(incomplete_features)]
#![feature(async_fn_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr
index 4742eb37d..c949168a3 100644
--- a/tests/ui/impl-trait/in-trait/default-body-type-err.stderr
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr
@@ -1,5 +1,5 @@
error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
- --> $DIR/default-body-type-err.rs:7:22
+ --> $DIR/default-body-type-err.rs:10:22
|
LL | fn lol(&self) -> impl Deref<Target = String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr
new file mode 100644
index 000000000..c949168a3
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr
@@ -0,0 +1,12 @@
+error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
+ --> $DIR/default-body-type-err.rs:10:22
+ |
+LL | fn lol(&self) -> impl Deref<Target = String> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
+LL |
+LL | &1i32
+ | ----- return type was inferred to be `&i32` here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0271`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.rs b/tests/ui/impl-trait/in-trait/default-body-type-err.rs
index ac9baf91c..9bd5b7779 100644
--- a/tests/ui/impl-trait/in-trait/default-body-type-err.rs
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![allow(incomplete_features)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr b/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr
new file mode 100644
index 000000000..3c24eff9a
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr
@@ -0,0 +1,24 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/default-body-with-rpit.rs:13:9
+ |
+LL | ""
+ | ^^ expected `impl Debug`, got `&'static str`
+ |
+note: previous use here
+ --> $DIR/default-body-with-rpit.rs:12:39
+ |
+LL | async fn baz(&self) -> impl Debug {
+ | _______________________________________^
+LL | | ""
+LL | | }
+ | |_____^
+
+error[E0720]: cannot resolve opaque type
+ --> $DIR/default-body-with-rpit.rs:12:28
+ |
+LL | async fn baz(&self) -> impl Debug {
+ | ^^^^^^^^^^ cannot resolve opaque type
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr b/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr
new file mode 100644
index 000000000..3c24eff9a
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr
@@ -0,0 +1,24 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/default-body-with-rpit.rs:13:9
+ |
+LL | ""
+ | ^^ expected `impl Debug`, got `&'static str`
+ |
+note: previous use here
+ --> $DIR/default-body-with-rpit.rs:12:39
+ |
+LL | async fn baz(&self) -> impl Debug {
+ | _______________________________________^
+LL | | ""
+LL | | }
+ | |_____^
+
+error[E0720]: cannot resolve opaque type
+ --> $DIR/default-body-with-rpit.rs:12:28
+ |
+LL | async fn baz(&self) -> impl Debug {
+ | ^^^^^^^^^^ cannot resolve opaque type
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs b/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
index ad3cc7c25..6bcc7b9ef 100644
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
+++ b/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
@@ -1,5 +1,7 @@
-// check-pass
// edition:2021
+// known-bug: #108304
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/default-body.rs b/tests/ui/impl-trait/in-trait/default-body.rs
index b0baf5bb1..ab6a51c6b 100644
--- a/tests/ui/impl-trait/in-trait/default-body.rs
+++ b/tests/ui/impl-trait/in-trait/default-body.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, return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/default-method-binder-shifting.current.stderr b/tests/ui/impl-trait/in-trait/default-method-binder-shifting.current.stderr
new file mode 100644
index 000000000..a0c0589b9
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-method-binder-shifting.current.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/default-method-binder-shifting.rs:5:12
+ |
+LL | #![feature(return_position_impl_trait_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/impl-trait/in-trait/default-method-binder-shifting.next.stderr b/tests/ui/impl-trait/in-trait/default-method-binder-shifting.next.stderr
new file mode 100644
index 000000000..a0c0589b9
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-method-binder-shifting.next.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/default-method-binder-shifting.rs:5:12
+ |
+LL | #![feature(return_position_impl_trait_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs b/tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs
new file mode 100644
index 000000000..de82544f2
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs
@@ -0,0 +1,22 @@
+// check-pass
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
+#![feature(return_position_impl_trait_in_trait)]
+//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete
+
+trait Trait {
+ type Type;
+
+ // Check that we're adjusting bound vars correctly when installing the default
+ // method projection assumptions.
+ fn method(&self) -> impl Trait<Type = impl Sized + '_>;
+}
+
+trait Trait2 {
+ type Type;
+
+ fn method(&self) -> impl Trait2<Type = impl Trait2<Type = impl Sized + '_> + '_>;
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/default-method-constraint.stderr b/tests/ui/impl-trait/in-trait/default-method-constraint.current.stderr
index 5e18605aa..7bb79911f 100644
--- a/tests/ui/impl-trait/in-trait/default-method-constraint.stderr
+++ b/tests/ui/impl-trait/in-trait/default-method-constraint.current.stderr
@@ -1,5 +1,5 @@
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/default-method-constraint.rs:5:12
+ --> $DIR/default-method-constraint.rs:7:12
|
LL | #![feature(return_position_impl_trait_in_trait)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/impl-trait/in-trait/default-method-constraint.next.stderr b/tests/ui/impl-trait/in-trait/default-method-constraint.next.stderr
new file mode 100644
index 000000000..7bb79911f
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-method-constraint.next.stderr
@@ -0,0 +1,11 @@
+warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/default-method-constraint.rs:7:12
+ |
+LL | #![feature(return_position_impl_trait_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/impl-trait/in-trait/default-method-constraint.rs b/tests/ui/impl-trait/in-trait/default-method-constraint.rs
index 8c50cc295..e85fe3c86 100644
--- a/tests/ui/impl-trait/in-trait/default-method-constraint.rs
+++ b/tests/ui/impl-trait/in-trait/default-method-constraint.rs
@@ -1,4 +1,6 @@
// check-pass
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
// This didn't work in the previous default RPITIT method hack attempt
diff --git a/tests/ui/impl-trait/in-trait/doesnt-satisfy.stderr b/tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr
index aa5492d28..653016cf0 100644
--- a/tests/ui/impl-trait/in-trait/doesnt-satisfy.stderr
+++ b/tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr
@@ -1,5 +1,5 @@
error[E0277]: `()` doesn't implement `std::fmt::Display`
- --> $DIR/doesnt-satisfy.rs:9:17
+ --> $DIR/doesnt-satisfy.rs:12:17
|
LL | fn bar() -> () {}
| ^^ `()` cannot be formatted with the default formatter
@@ -7,7 +7,7 @@ LL | fn bar() -> () {}
= help: the trait `std::fmt::Display` is not implemented for `()`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `Foo::bar::{opaque#0}`
- --> $DIR/doesnt-satisfy.rs:5:22
+ --> $DIR/doesnt-satisfy.rs:8:22
|
LL | fn bar() -> impl std::fmt::Display;
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::bar::{opaque#0}`
diff --git a/tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr b/tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr
new file mode 100644
index 000000000..f0cd43bcf
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr
@@ -0,0 +1,17 @@
+error[E0277]: `()` doesn't implement `std::fmt::Display`
+ --> $DIR/doesnt-satisfy.rs:12:17
+ |
+LL | fn bar() -> () {}
+ | ^^ `()` cannot be formatted with the default formatter
+ |
+ = help: the trait `std::fmt::Display` is not implemented for `()`
+ = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+note: required by a bound in `Foo::{opaque#0}`
+ --> $DIR/doesnt-satisfy.rs:8:22
+ |
+LL | fn bar() -> impl std::fmt::Display;
+ | ^^^^^^^^^^^^^^^^^ 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/doesnt-satisfy.rs b/tests/ui/impl-trait/in-trait/doesnt-satisfy.rs
index bb4e0d44f..fcd0b51ee 100644
--- a/tests/ui/impl-trait/in-trait/doesnt-satisfy.rs
+++ b/tests/ui/impl-trait/in-trait/doesnt-satisfy.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr
new file mode 100644
index 000000000..b8a793e1a
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr
@@ -0,0 +1,21 @@
+warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:4:12
+ |
+LL | #![feature(return_position_impl_trait_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:12:1
+ |
+LL | fn foo(&self) -> impl Sized;
+ | ---------------------------- `foo` from trait
+...
+LL | impl MyTrait for i32 {
+ | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr
new file mode 100644
index 000000000..b8a793e1a
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr
@@ -0,0 +1,21 @@
+warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:4:12
+ |
+LL | #![feature(return_position_impl_trait_in_trait)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+error[E0046]: not all trait items implemented, missing: `foo`
+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:12:1
+ |
+LL | fn foo(&self) -> impl Sized;
+ | ---------------------------- `foo` from trait
+...
+LL | impl MyTrait for i32 {
+ | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs
new file mode 100644
index 000000000..8329ce1f8
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.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)]
+//~^ WARN the feature `return_position_impl_trait_in_trait` is incomplete
+
+trait MyTrait {
+ fn foo(&self) -> impl Sized;
+ fn bar(&self) -> impl Sized;
+}
+
+impl MyTrait for i32 {
+ //~^ ERROR not all trait items implemented, missing: `foo`
+ fn bar(&self) -> impl Sized {
+ self.foo()
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/early.rs b/tests/ui/impl-trait/in-trait/early.rs
index 9c1c2b503..831033a58 100644
--- a/tests/ui/impl-trait/in-trait/early.rs
+++ b/tests/ui/impl-trait/in-trait/early.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, return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/encode.rs b/tests/ui/impl-trait/in-trait/encode.rs
index efb9f6498..98aaf4a65 100644
--- a/tests/ui/impl-trait/in-trait/encode.rs
+++ b/tests/ui/impl-trait/in-trait/encode.rs
@@ -1,5 +1,7 @@
// build-pass
// compile-flags: --crate-type=lib
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/foreign.rs b/tests/ui/impl-trait/in-trait/foreign.rs
index 6341f5b42..f4972d948 100644
--- a/tests/ui/impl-trait/in-trait/foreign.rs
+++ b/tests/ui/impl-trait/in-trait/foreign.rs
@@ -1,9 +1,21 @@
// check-pass
// aux-build: rpitit.rs
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
extern crate rpitit;
+use std::sync::Arc;
+
+// Implement an RPITIT from another crate.
+struct Local;
+impl rpitit::Foo for Local {
+ fn bar() -> Arc<String> { Arc::new(String::new()) }
+}
+
fn main() {
- // Witness an RPITIT from another crate
- let () = <rpitit::Foreign as rpitit::Foo>::bar();
+ // Witness an RPITIT from another crate.
+ let &() = <rpitit::Foreign as rpitit::Foo>::bar();
+
+ let x: Arc<String> = <Local as rpitit::Foo>::bar();
}
diff --git a/tests/ui/impl-trait/in-trait/generics-mismatch.stderr b/tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr
index cd42683e0..310edbcb6 100644
--- a/tests/ui/impl-trait/in-trait/generics-mismatch.stderr
+++ b/tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr
@@ -1,5 +1,5 @@
error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
- --> $DIR/generics-mismatch.rs:11:12
+ --> $DIR/generics-mismatch.rs:14:12
|
LL | fn bar(&self) -> impl Sized;
| - expected 0 type parameters
diff --git a/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr b/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr
new file mode 100644
index 000000000..310edbcb6
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr
@@ -0,0 +1,12 @@
+error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
+ --> $DIR/generics-mismatch.rs:14:12
+ |
+LL | fn bar(&self) -> impl Sized;
+ | - expected 0 type parameters
+...
+LL | fn bar<T>(&self) {}
+ | ^ found 1 type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/impl-trait/in-trait/generics-mismatch.rs b/tests/ui/impl-trait/in-trait/generics-mismatch.rs
index cc0fc720e..9259ca193 100644
--- a/tests/ui/impl-trait/in-trait/generics-mismatch.rs
+++ b/tests/ui/impl-trait/in-trait/generics-mismatch.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.stderr b/tests/ui/impl-trait/in-trait/issue-102140.current.stderr
index 18bb63745..7aa7880e2 100644
--- a/tests/ui/impl-trait/in-trait/issue-102140.stderr
+++ b/tests/ui/impl-trait/in-trait/issue-102140.current.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
- --> $DIR/issue-102140.rs:23:22
+ --> $DIR/issue-102140.rs:26:22
|
LL | MyTrait::foo(&self)
| ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
@@ -13,7 +13,7 @@ LL + MyTrait::foo(self)
|
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
- --> $DIR/issue-102140.rs:23:9
+ --> $DIR/issue-102140.rs:26:9
|
LL | MyTrait::foo(&self)
| ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
@@ -21,7 +21,7 @@ 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:23:9
+ --> $DIR/issue-102140.rs:26:9
|
LL | MyTrait::foo(&self)
| ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.next.stderr b/tests/ui/impl-trait/in-trait/issue-102140.next.stderr
new file mode 100644
index 000000000..7aa7880e2
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/issue-102140.next.stderr
@@ -0,0 +1,33 @@
+error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
+ --> $DIR/issue-102140.rs:26:22
+ |
+LL | MyTrait::foo(&self)
+ | ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
+ | |
+ | required by a bound introduced by this call
+ |
+help: consider removing the leading `&`-reference
+ |
+LL - MyTrait::foo(&self)
+LL + MyTrait::foo(self)
+ |
+
+error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
+ --> $DIR/issue-102140.rs:26:9
+ |
+LL | MyTrait::foo(&self)
+ | ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
+ |
+ = 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
+ |
+LL | MyTrait::foo(&self)
+ | ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
+ |
+ = help: the trait `MyTrait` is implemented for `Outer`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.rs b/tests/ui/impl-trait/in-trait/issue-102140.rs
index be1e012ac..4dcac4f5b 100644
--- a/tests/ui/impl-trait/in-trait/issue-102140.rs
+++ b/tests/ui/impl-trait/in-trait/issue-102140.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/issue-102301.rs b/tests/ui/impl-trait/in-trait/issue-102301.rs
index a93714a65..1329ca29d 100644
--- a/tests/ui/impl-trait/in-trait/issue-102301.rs
+++ b/tests/ui/impl-trait/in-trait/issue-102301.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)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.stderr b/tests/ui/impl-trait/in-trait/issue-102571.current.stderr
index 87219941d..cac9a29f6 100644
--- a/tests/ui/impl-trait/in-trait/issue-102571.stderr
+++ b/tests/ui/impl-trait/in-trait/issue-102571.current.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/issue-102571.rs:20:9
+ --> $DIR/issue-102571.rs:23:9
|
LL | let () = t.bar();
| ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.next.stderr b/tests/ui/impl-trait/in-trait/issue-102571.next.stderr
new file mode 100644
index 000000000..cac9a29f6
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/issue-102571.next.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-102571.rs:23:9
+ |
+LL | let () = t.bar();
+ | ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
+ | |
+ | expected associated type, found `()`
+ |
+ = note: expected associated type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
+ found unit type `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.rs b/tests/ui/impl-trait/in-trait/issue-102571.rs
index 61c91e644..f0ddab5e7 100644
--- a/tests/ui/impl-trait/in-trait/issue-102571.rs
+++ b/tests/ui/impl-trait/in-trait/issue-102571.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/nested-rpitit.rs b/tests/ui/impl-trait/in-trait/nested-rpitit.rs
index 65285e3a3..360207537 100644
--- a/tests/ui/impl-trait/in-trait/nested-rpitit.rs
+++ b/tests/ui/impl-trait/in-trait/nested-rpitit.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)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/new-lowering-strategy/simple-trait.rs b/tests/ui/impl-trait/in-trait/new-lowering-strategy/simple-trait.rs
deleted file mode 100644
index dfce973d7..000000000
--- a/tests/ui/impl-trait/in-trait/new-lowering-strategy/simple-trait.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// check-pass
-// compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-
-#![feature(return_position_impl_trait_in_trait)]
-#![allow(incomplete_features)]
-
-trait Foo {
- fn foo() -> impl Sized;
-}
-
-fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/object-safety.stderr b/tests/ui/impl-trait/in-trait/object-safety.current.stderr
index ca0e760ff..b7f2b019a 100644
--- a/tests/ui/impl-trait/in-trait/object-safety.stderr
+++ b/tests/ui/impl-trait/in-trait/object-safety.current.stderr
@@ -1,11 +1,11 @@
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:17:33
+ --> $DIR/object-safety.rs:20:33
|
LL | let i = Box::new(42_u32) as Box<dyn Foo>;
| ^^^^^^^^^^^^ `Foo` cannot be made into an object
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:7:22
+ --> $DIR/object-safety.rs:10:22
|
LL | trait Foo {
| --- this trait cannot be made into an object...
@@ -14,13 +14,13 @@ LL | fn baz(&self) -> impl Debug;
= help: consider moving `baz` to another trait
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:20:13
+ --> $DIR/object-safety.rs:23:13
|
LL | let s = i.baz();
| ^^^^^^^ `Foo` cannot be made into an object
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:7:22
+ --> $DIR/object-safety.rs:10:22
|
LL | trait Foo {
| --- this trait cannot be made into an object...
@@ -29,13 +29,13 @@ LL | fn baz(&self) -> impl Debug;
= help: consider moving `baz` to another trait
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:17:13
+ --> $DIR/object-safety.rs:20:13
|
LL | let i = Box::new(42_u32) as Box<dyn Foo>;
| ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:7:22
+ --> $DIR/object-safety.rs:10:22
|
LL | trait Foo {
| --- this trait cannot be made into an object...
diff --git a/tests/ui/impl-trait/in-trait/object-safety.next.stderr b/tests/ui/impl-trait/in-trait/object-safety.next.stderr
new file mode 100644
index 000000000..b7f2b019a
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/object-safety.next.stderr
@@ -0,0 +1,50 @@
+error[E0038]: the trait `Foo` cannot be made into an object
+ --> $DIR/object-safety.rs:20:33
+ |
+LL | let i = Box::new(42_u32) as Box<dyn Foo>;
+ | ^^^^^^^^^^^^ `Foo` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/object-safety.rs:10:22
+ |
+LL | trait Foo {
+ | --- this trait cannot be made into an object...
+LL | fn baz(&self) -> impl Debug;
+ | ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
+ = help: consider moving `baz` to another trait
+
+error[E0038]: the trait `Foo` cannot be made into an object
+ --> $DIR/object-safety.rs:23:13
+ |
+LL | let s = i.baz();
+ | ^^^^^^^ `Foo` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/object-safety.rs:10:22
+ |
+LL | trait Foo {
+ | --- this trait cannot be made into an object...
+LL | fn baz(&self) -> impl Debug;
+ | ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
+ = help: consider moving `baz` to another trait
+
+error[E0038]: the trait `Foo` cannot be made into an object
+ --> $DIR/object-safety.rs:20:13
+ |
+LL | let i = Box::new(42_u32) as Box<dyn Foo>;
+ | ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/object-safety.rs:10:22
+ |
+LL | trait Foo {
+ | --- this trait cannot be made into an object...
+LL | fn baz(&self) -> impl Debug;
+ | ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
+ = help: consider moving `baz` to another trait
+ = note: required for `Box<u32>` to implement `CoerceUnsized<Box<dyn Foo>>`
+ = note: required by cast to type `Box<dyn Foo>`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/impl-trait/in-trait/object-safety.rs b/tests/ui/impl-trait/in-trait/object-safety.rs
index dd35b9a2d..016a0aaae 100644
--- a/tests/ui/impl-trait/in-trait/object-safety.rs
+++ b/tests/ui/impl-trait/in-trait/object-safety.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr
index 15edda483..a57653b2c 100644
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr
+++ b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/opaque-in-impl-is-opaque.rs:17:19
+ --> $DIR/opaque-in-impl-is-opaque.rs:20:19
|
LL | fn bar(&self) -> impl Display {
| ------------ the found opaque type
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr
new file mode 100644
index 000000000..a57653b2c
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr
@@ -0,0 +1,17 @@
+error[E0308]: mismatched types
+ --> $DIR/opaque-in-impl-is-opaque.rs:20:19
+ |
+LL | fn bar(&self) -> impl Display {
+ | ------------ the found opaque type
+...
+LL | let x: &str = ().bar();
+ | ---- ^^^^^^^^ expected `&str`, found opaque type
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&str`
+ found opaque type `impl std::fmt::Display`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
index 3ac264e8e..c07ece15a 100644
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
+++ b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl.rs b/tests/ui/impl-trait/in-trait/opaque-in-impl.rs
index 2e0662969..f48d9fa26 100644
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl.rs
+++ b/tests/ui/impl-trait/in-trait/opaque-in-impl.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)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/reveal.rs b/tests/ui/impl-trait/in-trait/reveal.rs
index d6ede1cc4..1f42ec744 100644
--- a/tests/ui/impl-trait/in-trait/reveal.rs
+++ b/tests/ui/impl-trait/in-trait/reveal.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)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
index c4fcaabe4..eba270af7 100644
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.stderr
+++ b/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
@@ -1,5 +1,5 @@
error: `impl` item signature doesn't match `trait` item signature
- --> $DIR/signature-mismatch.rs:15:5
+ --> $DIR/signature-mismatch.rs:17:5
|
LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
| ----------------------------------------------------------------- expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '3`
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
new file mode 100644
index 000000000..eba270af7
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
@@ -0,0 +1,16 @@
+error: `impl` item signature doesn't match `trait` item signature
+ --> $DIR/signature-mismatch.rs:17:5
+ |
+LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
+ | ----------------------------------------------------------------- expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '3`
+...
+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`
+ |
+ = 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
+
+error: aborting due to previous error
+
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.rs b/tests/ui/impl-trait/in-trait/signature-mismatch.rs
index 90682631a..38c902a97 100644
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.rs
+++ b/tests/ui/impl-trait/in-trait/signature-mismatch.rs
@@ -1,4 +1,6 @@
// edition:2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.stderr b/tests/ui/impl-trait/in-trait/specialization-broken.current.stderr
index dc621d6b8..f48e7a1ed 100644
--- a/tests/ui/impl-trait/in-trait/specialization-broken.stderr
+++ b/tests/ui/impl-trait/in-trait/specialization-broken.current.stderr
@@ -1,5 +1,5 @@
error[E0053]: method `bar` has an incompatible type for trait
- --> $DIR/specialization-broken.rs:16:22
+ --> $DIR/specialization-broken.rs:19:22
|
LL | default impl<U> Foo for U
| - this type parameter
@@ -11,7 +11,7 @@ LL | fn bar(&self) -> U {
| help: change the output type to match the trait: `impl Sized`
|
note: type in trait
- --> $DIR/specialization-broken.rs:9:22
+ --> $DIR/specialization-broken.rs:12:22
|
LL | fn bar(&self) -> impl Sized;
| ^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | fn bar(&self) -> impl Sized;
found signature `fn(&U) -> U`
error: method with return-position `impl Trait` in trait cannot be specialized
- --> $DIR/specialization-broken.rs:16:5
+ --> $DIR/specialization-broken.rs:19:5
|
LL | fn bar(&self) -> U {
| ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr b/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr
new file mode 100644
index 000000000..f48e7a1ed
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr
@@ -0,0 +1,31 @@
+error[E0053]: method `bar` has an incompatible type for trait
+ --> $DIR/specialization-broken.rs:19:22
+ |
+LL | default impl<U> Foo for U
+ | - this type parameter
+...
+LL | fn bar(&self) -> U {
+ | ^
+ | |
+ | expected associated type, found type parameter `U`
+ | help: change the output type to match the trait: `impl Sized`
+ |
+note: type in trait
+ --> $DIR/specialization-broken.rs:12:22
+ |
+LL | fn bar(&self) -> impl Sized;
+ | ^^^^^^^^^^
+ = note: expected signature `fn(&U) -> impl Sized`
+ found signature `fn(&U) -> U`
+
+error: method with return-position `impl Trait` in trait cannot be specialized
+ --> $DIR/specialization-broken.rs:19:5
+ |
+LL | fn bar(&self) -> U {
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = note: specialization behaves in inconsistent and surprising ways with `#![feature(return_position_impl_trait_in_trait)]`, and for now is disallowed
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.rs b/tests/ui/impl-trait/in-trait/specialization-broken.rs
index 2fcffdf3f..658d07097 100644
--- a/tests/ui/impl-trait/in-trait/specialization-broken.rs
+++ b/tests/ui/impl-trait/in-trait/specialization-broken.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
// FIXME(compiler-errors): I'm not exactly sure if this is expected to pass or not.
// But we fixed an ICE anyways.
diff --git a/tests/ui/impl-trait/in-trait/specialization-substs-remap.rs b/tests/ui/impl-trait/in-trait/specialization-substs-remap.rs
index c9ee877db..dbc5d38f1 100644
--- a/tests/ui/impl-trait/in-trait/specialization-substs-remap.rs
+++ b/tests/ui/impl-trait/in-trait/specialization-substs-remap.rs
@@ -1,4 +1,6 @@
// check-pass
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(specialization)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/success.rs b/tests/ui/impl-trait/in-trait/success.rs
index 4cbe682b4..0e69e0490 100644
--- a/tests/ui/impl-trait/in-trait/success.rs
+++ b/tests/ui/impl-trait/in-trait/success.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)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr
index 8ff54cad9..64c942705 100644
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr
+++ b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr
@@ -1,5 +1,5 @@
error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter
- --> $DIR/trait-more-generics-than-impl.rs:11:11
+ --> $DIR/trait-more-generics-than-impl.rs:14:11
|
LL | fn bar<T>() -> impl Sized;
| - expected 1 type parameter
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr
new file mode 100644
index 000000000..64c942705
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr
@@ -0,0 +1,12 @@
+error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter
+ --> $DIR/trait-more-generics-than-impl.rs:14:11
+ |
+LL | fn bar<T>() -> impl Sized;
+ | - expected 1 type parameter
+...
+LL | fn bar() -> impl Sized {}
+ | ^ found 0 type parameters
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
index 0bbe50ea6..c2e394a1f 100644
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
+++ b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.stderr b/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr
index 03cc4c2b9..1a7071612 100644
--- a/tests/ui/impl-trait/in-trait/wf-bounds.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:9:22
+ --> $DIR/wf-bounds.rs:13:22
|
LL | fn nya() -> impl Wf<Vec<[u8]>>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -9,22 +9,32 @@ 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:12:23
+ --> $DIR/wf-bounds.rs:16: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:6:10
+ --> $DIR/wf-bounds.rs:8:10
|
-LL | trait Wf<T> {}
+LL | trait Wf<T> {
| ^ required by this bound in `Wf`
help: consider relaxing the implicit `Sized` restriction
|
-LL | trait Wf<T: ?Sized> {}
+LL | trait Wf<T: ?Sized> {
| ++++++++
-error: aborting due to 2 previous errors
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/wf-bounds.rs:19:44
+ |
+LL | fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[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 `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+
+error: aborting due to 3 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
new file mode 100644
index 000000000..1a7071612
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr
@@ -0,0 +1,40 @@
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/wf-bounds.rs:13:22
+ |
+LL | fn nya() -> impl Wf<Vec<[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 `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
+ |
+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
+ |
+LL | trait Wf<T> {
+ | ^ required by this bound in `Wf`
+help: consider relaxing the implicit `Sized` restriction
+ |
+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
+ |
+LL | fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[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 `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+
+error: aborting due to 3 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 2c71583b3..1c9590bd8 100644
--- a/tests/ui/impl-trait/in-trait/wf-bounds.rs
+++ b/tests/ui/impl-trait/in-trait/wf-bounds.rs
@@ -1,9 +1,13 @@
// issue #101663
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
-trait Wf<T> {}
+trait Wf<T> {
+ type Output;
+}
trait Uwu {
fn nya() -> impl Wf<Vec<[u8]>>;
@@ -11,6 +15,9 @@ trait Uwu {
fn nya2() -> impl Wf<[u8]>;
//~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+
+ fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
+ //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
}
fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/where-clause.rs b/tests/ui/impl-trait/in-trait/where-clause.rs
index 87bac519c..88d86e2b5 100644
--- a/tests/ui/impl-trait/in-trait/where-clause.rs
+++ b/tests/ui/impl-trait/in-trait/where-clause.rs
@@ -1,5 +1,7 @@
// check-pass
// edition: 2021
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/issue-55872-1.rs b/tests/ui/impl-trait/issue-55872-1.rs
index 22ff7ffa2..f36a310dd 100644
--- a/tests/ui/impl-trait/issue-55872-1.rs
+++ b/tests/ui/impl-trait/issue-55872-1.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Bar {
type E: Copy;
diff --git a/tests/ui/impl-trait/issue-55872-2.rs b/tests/ui/impl-trait/issue-55872-2.rs
index cbc7b5d62..7a5cb3b3d 100644
--- a/tests/ui/impl-trait/issue-55872-2.rs
+++ b/tests/ui/impl-trait/issue-55872-2.rs
@@ -3,7 +3,7 @@
// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
// edition:2018
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Bar {
type E: Send;
diff --git a/tests/ui/impl-trait/issue-55872-2.stderr b/tests/ui/impl-trait/issue-55872-2.stderr
deleted file mode 100644
index 477c964bd..000000000
--- a/tests/ui/impl-trait/issue-55872-2.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872-2.rs:17:9
- |
-LL | async {}
- | ^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/tests/ui/impl-trait/issue-55872-3.rs b/tests/ui/impl-trait/issue-55872-3.rs
index 91811df93..d031271ac 100644
--- a/tests/ui/impl-trait/issue-55872-3.rs
+++ b/tests/ui/impl-trait/issue-55872-3.rs
@@ -1,7 +1,7 @@
// edition:2018
// ignore-compare-mode-chalk
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Bar {
type E: Copy;
diff --git a/tests/ui/impl-trait/issue-55872.rs b/tests/ui/impl-trait/issue-55872.rs
index c4e6f6436..10850f0a9 100644
--- a/tests/ui/impl-trait/issue-55872.rs
+++ b/tests/ui/impl-trait/issue-55872.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Bar {
type E: Copy;
diff --git a/tests/ui/impl-trait/issues/issue-78722.rs b/tests/ui/impl-trait/issues/issue-78722.rs
index 78233f300..7b5ab5f22 100644
--- a/tests/ui/impl-trait/issues/issue-78722.rs
+++ b/tests/ui/impl-trait/issues/issue-78722.rs
@@ -12,7 +12,6 @@ struct Bug {
}
let f: F = async { 1 };
//~^ ERROR `async` blocks are not allowed in constants
- //~| ERROR destructor of
1
}],
}
diff --git a/tests/ui/impl-trait/issues/issue-78722.stderr b/tests/ui/impl-trait/issues/issue-78722.stderr
index c00df8087..05a2c135c 100644
--- a/tests/ui/impl-trait/issues/issue-78722.stderr
+++ b/tests/ui/impl-trait/issues/issue-78722.stderr
@@ -7,22 +7,13 @@ 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[E0493]: destructor of `F` cannot be evaluated at compile-time
- --> $DIR/issue-78722.rs:13:13
- |
-LL | let f: F = async { 1 };
- | ^ the destructor for this type cannot be evaluated in constants
-...
-LL | }],
- | - value is dropped here
-
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
|
LL | fn concrete_use() -> F {
| ^ expected `()`, found `u8`
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0271, E0493, E0658.
+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-82139.rs b/tests/ui/impl-trait/issues/issue-82139.rs
index cc9167b34..3f0b0f1a8 100644
--- a/tests/ui/impl-trait/issues/issue-82139.rs
+++ b/tests/ui/impl-trait/issues/issue-82139.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Trait {
type Associated;
diff --git a/tests/ui/impl-trait/issues/issue-83919.rs b/tests/ui/impl-trait/issues/issue-83919.rs
index e76443a65..4e699e7f3 100644
--- a/tests/ui/impl-trait/issues/issue-83919.rs
+++ b/tests/ui/impl-trait/issues/issue-83919.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
// edition:2021
@@ -6,8 +6,8 @@ use std::future::Future;
trait Foo {
type T;
- type Fut2: Future<Output=Self::T>; // ICE got triggered with traits other than Future here
- type Fut: Future<Output=Self::Fut2>;
+ type Fut2: Future<Output = Self::T>; // ICE got triggered with traits other than Future here
+ type Fut: Future<Output = Self::Fut2>;
fn get_fut(&self) -> Self::Fut;
}
@@ -15,11 +15,11 @@ struct Implementor;
impl Foo for Implementor {
type T = u64;
- type Fut2 = impl Future<Output=u64>;
- type Fut = impl Future<Output=Self::Fut2>;
+ type Fut2 = impl Future<Output = u64>;
+ type Fut = impl Future<Output = Self::Fut2>;
fn get_fut(&self) -> Self::Fut {
- //~^ ERROR `{integer}` is not a future
+ //~^ ERROR `{integer}` is not a future
async move {
42
// 42 does not impl Future and rustc does actually point out the error,
diff --git a/tests/ui/impl-trait/issues/issue-86719.rs b/tests/ui/impl-trait/issues/issue-86719.rs
index f4b0b3f33..7abab5bfb 100644
--- a/tests/ui/impl-trait/issues/issue-86719.rs
+++ b/tests/ui/impl-trait/issues/issue-86719.rs
@@ -1,11 +1,12 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Bar {
type E;
}
impl<S> Bar for S {
type E = impl ; //~ ERROR at least one trait must be specified
- fn foo() -> Self::E { //~ ERROR `foo` is not a member
+ fn foo() -> Self::E {
+ //~^ ERROR `foo` is not a member
|_| true //~ ERROR type annotations needed
}
}
diff --git a/tests/ui/impl-trait/issues/issue-86719.stderr b/tests/ui/impl-trait/issues/issue-86719.stderr
index 7592418fd..15893df5f 100644
--- a/tests/ui/impl-trait/issues/issue-86719.stderr
+++ b/tests/ui/impl-trait/issues/issue-86719.stderr
@@ -8,12 +8,13 @@ error[E0407]: method `foo` is not a member of trait `Bar`
--> $DIR/issue-86719.rs:8:5
|
LL | / fn foo() -> Self::E {
+LL | |
LL | | |_| true
LL | | }
| |_____^ not a member of trait `Bar`
error[E0282]: type annotations needed
- --> $DIR/issue-86719.rs:9:10
+ --> $DIR/issue-86719.rs:10:10
|
LL | |_| true
| ^
diff --git a/tests/ui/impl-trait/issues/issue-87340.rs b/tests/ui/impl-trait/issues/issue-87340.rs
index f0f6d2bb6..705a4addc 100644
--- a/tests/ui/impl-trait/issues/issue-87340.rs
+++ b/tests/ui/impl-trait/issues/issue-87340.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait X {
type I;
@@ -6,7 +6,7 @@ trait X {
}
impl<T> X for () {
-//~^ ERROR `T` is not constrained by the impl trait, self type, or predicates
+ //~^ ERROR `T` is not constrained by the impl trait, self type, or predicates
type I = impl Sized;
fn f() -> Self::I {}
}
diff --git a/tests/ui/impl-trait/multiple-lifetimes.rs b/tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs
index 5407fb6dd..5407fb6dd 100644
--- a/tests/ui/impl-trait/multiple-lifetimes.rs
+++ b/tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs
diff --git a/tests/ui/impl-trait/nested-return-type2.rs b/tests/ui/impl-trait/nested-return-type2.rs
index fe883ce6f..e1d551137 100644
--- a/tests/ui/impl-trait/nested-return-type2.rs
+++ b/tests/ui/impl-trait/nested-return-type2.rs
@@ -26,7 +26,6 @@ impl<R: Duh, F: FnMut() -> R> Trait for F {
// Lazy TAIT would error out, but we inserted a hack to make it work again,
// keeping backwards compatibility.
fn foo() -> impl Trait<Assoc = impl Send> {
- //~^ WARN opaque type `impl Trait<Assoc = impl Send>` does not satisfy its associated type bounds
|| 42
}
diff --git a/tests/ui/impl-trait/nested-return-type2.stderr b/tests/ui/impl-trait/nested-return-type2.stderr
deleted file mode 100644
index 09ad3bd05..000000000
--- a/tests/ui/impl-trait/nested-return-type2.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: opaque type `impl Trait<Assoc = impl Send>` does not satisfy its associated type bounds
- --> $DIR/nested-return-type2.rs:28:24
- |
-LL | type Assoc: Duh;
- | --- this associated type bound is unsatisfied for `impl Send`
-...
-LL | fn foo() -> impl Trait<Assoc = impl Send> {
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(opaque_hidden_inferred_bound)]` on by default
-help: add this bound
- |
-LL | fn foo() -> impl Trait<Assoc = impl Send + Duh> {
- | +++++
-
-warning: 1 warning emitted
-
diff --git a/tests/ui/impl-trait/nested-return-type3.rs b/tests/ui/impl-trait/nested-return-type3.rs
index 5a764fc4c..74b4dae22 100644
--- a/tests/ui/impl-trait/nested-return-type3.rs
+++ b/tests/ui/impl-trait/nested-return-type3.rs
@@ -13,7 +13,6 @@ impl<F: Duh> Trait for F {
}
fn foo() -> impl Trait<Assoc = impl Send> {
- //~^ WARN opaque type `impl Trait<Assoc = impl Send>` does not satisfy its associated type bounds
42
}
diff --git a/tests/ui/impl-trait/nested-return-type3.stderr b/tests/ui/impl-trait/nested-return-type3.stderr
deleted file mode 100644
index 632de71aa..000000000
--- a/tests/ui/impl-trait/nested-return-type3.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: opaque type `impl Trait<Assoc = impl Send>` does not satisfy its associated type bounds
- --> $DIR/nested-return-type3.rs:15:24
- |
-LL | type Assoc: Duh;
- | --- this associated type bound is unsatisfied for `impl Send`
-...
-LL | fn foo() -> impl Trait<Assoc = impl Send> {
- | ^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(opaque_hidden_inferred_bound)]` on by default
-help: add this bound
- |
-LL | fn foo() -> impl Trait<Assoc = impl Send + Duh> {
- | +++++
-
-warning: 1 warning emitted
-
diff --git a/tests/ui/impl-trait/no-method-suggested-traits.stderr b/tests/ui/impl-trait/no-method-suggested-traits.stderr
index 3c2c01dc2..160cc0440 100644
--- a/tests/ui/impl-trait/no-method-suggested-traits.stderr
+++ b/tests/ui/impl-trait/no-method-suggested-traits.stderr
@@ -7,13 +7,13 @@ LL | 1u32.method();
= help: items from traits can only be used if the trait is in scope
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
|
-LL | use foo::Bar;
+LL + use foo::Bar;
|
-LL | use no_method_suggested_traits::Reexported;
+LL + use no_method_suggested_traits::Reexported;
|
-LL | use no_method_suggested_traits::foo::PubPub;
+LL + use no_method_suggested_traits::foo::PubPub;
|
-LL | use no_method_suggested_traits::qux::PrivPub;
+LL + use no_method_suggested_traits::qux::PrivPub;
|
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&u32>>` in the current scope
@@ -25,13 +25,13 @@ LL | std::rc::Rc::new(&mut Box::new(&1u32)).method();
= help: items from traits can only be used if the trait is in scope
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
|
-LL | use foo::Bar;
+LL + use foo::Bar;
|
-LL | use no_method_suggested_traits::Reexported;
+LL + use no_method_suggested_traits::Reexported;
|
-LL | use no_method_suggested_traits::foo::PubPub;
+LL + use no_method_suggested_traits::foo::PubPub;
|
-LL | use no_method_suggested_traits::qux::PrivPub;
+LL + use no_method_suggested_traits::qux::PrivPub;
|
error[E0599]: no method named `method` found for type `char` in the current scope
@@ -46,7 +46,7 @@ LL | 'a'.method();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use foo::Bar;
+LL + use foo::Bar;
|
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&char>>` in the current scope
@@ -58,7 +58,7 @@ LL | std::rc::Rc::new(&mut Box::new(&'a')).method();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use foo::Bar;
+LL + use foo::Bar;
|
error[E0599]: no method named `method` found for type `i32` in the current scope
@@ -75,7 +75,7 @@ LL | fn method(&self) {}
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use no_method_suggested_traits::foo::PubPub;
+LL + use no_method_suggested_traits::foo::PubPub;
|
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&i32>>` in the current scope
@@ -87,7 +87,7 @@ LL | std::rc::Rc::new(&mut Box::new(&1i32)).method();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use no_method_suggested_traits::foo::PubPub;
+LL + use no_method_suggested_traits::foo::PubPub;
|
error[E0599]: no method named `method` found for struct `Foo` in the current scope
diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr
index 662c74bcd..9c67f17e9 100644
--- a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr
+++ b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr
@@ -114,6 +114,9 @@ error[E0720]: cannot resolve opaque type
|
LL | fn generator_hold() -> impl Sized {
| ^^^^^^^^^^ recursive opaque type
+...
+LL | let x = generator_hold();
+ | - generator captures itself here
error[E0720]: cannot resolve opaque type
--> $DIR/recursive-impl-trait-type-indirect.rs:90:26
diff --git a/tests/ui/impl-trait/type-alias-generic-param.rs b/tests/ui/impl-trait/type-alias-generic-param.rs
index 3499b2859..1211625da 100644
--- a/tests/ui/impl-trait/type-alias-generic-param.rs
+++ b/tests/ui/impl-trait/type-alias-generic-param.rs
@@ -3,7 +3,7 @@
// types in 'item' position when generic parameters are involved
//
// run-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Meow {
type MeowType;
diff --git a/tests/ui/impl-trait/universal_wrong_bounds.stderr b/tests/ui/impl-trait/universal_wrong_bounds.stderr
index 3b1a5e5f4..464d68958 100644
--- a/tests/ui/impl-trait/universal_wrong_bounds.stderr
+++ b/tests/ui/impl-trait/universal_wrong_bounds.stderr
@@ -6,7 +6,7 @@ LL | fn wants_debug(g: impl Debug) { }
|
help: consider importing this trait instead
|
-LL | use std::fmt::Debug;
+LL + use std::fmt::Debug;
|
error[E0404]: expected trait, found derive macro `Debug`
@@ -17,7 +17,7 @@ LL | fn wants_display(g: impl Debug) { }
|
help: consider importing this trait instead
|
-LL | use std::fmt::Debug;
+LL + use std::fmt::Debug;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/impl-trait/where-allowed.rs b/tests/ui/impl-trait/where-allowed.rs
index ff63b04c2..509d27166 100644
--- a/tests/ui/impl-trait/where-allowed.rs
+++ b/tests/ui/impl-trait/where-allowed.rs
@@ -1,6 +1,8 @@
//! A simple test for testing many permutations of allowedness of
//! impl Trait
#![feature(impl_trait_in_fn_trait_return)]
+#![feature(custom_inner_attributes)]
+#![rustfmt::skip]
use std::fmt::Debug;
// Allowed
@@ -116,7 +118,7 @@ trait DummyTrait {
}
impl DummyTrait for () {
type Out = impl Debug;
- //~^ ERROR `impl Trait` in type aliases is unstable
+ //~^ ERROR `impl Trait` in associated types is unstable
fn in_trait_impl_parameter(_: impl Debug) { }
// Allowed
diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr
index 1cae3f77c..3e2934379 100644
--- a/tests/ui/impl-trait/where-allowed.stderr
+++ b/tests/ui/impl-trait/where-allowed.stderr
@@ -1,5 +1,5 @@
error[E0666]: nested `impl Trait` is not allowed
- --> $DIR/where-allowed.rs:47:51
+ --> $DIR/where-allowed.rs:49:51
|
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
| --------^^^^^^^^^^-
@@ -8,7 +8,7 @@ LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
| outer `impl Trait`
error[E0666]: nested `impl Trait` is not allowed
- --> $DIR/where-allowed.rs:56:57
+ --> $DIR/where-allowed.rs:58:57
|
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
| --------^^^^^^^^^^-
@@ -16,17 +16,17 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic
| | nested `impl Trait` here
| outer `impl Trait`
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/where-allowed.rs:118:16
+error[E0658]: `impl Trait` in associated types is unstable
+ --> $DIR/where-allowed.rs:120:16
|
LL | type Out = impl Debug;
| ^^^^^^^^^^
|
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
+ = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/where-allowed.rs:153:23
+ --> $DIR/where-allowed.rs:155:23
|
LL | type InTypeAlias<R> = impl Debug;
| ^^^^^^^^^^
@@ -35,7 +35,7 @@ LL | type InTypeAlias<R> = impl Debug;
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/where-allowed.rs:156:39
+ --> $DIR/where-allowed.rs:158:39
|
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
| ^^^^^^^^^^
@@ -44,109 +44,109 @@ LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer params
- --> $DIR/where-allowed.rs:16:40
+ --> $DIR/where-allowed.rs:18:40
|
LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return types
- --> $DIR/where-allowed.rs:20:42
+ --> $DIR/where-allowed.rs:22:42
|
LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer params
- --> $DIR/where-allowed.rs:24:38
+ --> $DIR/where-allowed.rs:26:38
|
LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return types
- --> $DIR/where-allowed.rs:28:40
+ --> $DIR/where-allowed.rs:30:40
|
LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
- --> $DIR/where-allowed.rs:32:49
+ --> $DIR/where-allowed.rs:34:49
|
LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return types
- --> $DIR/where-allowed.rs:36:51
+ --> $DIR/where-allowed.rs:38:51
|
LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
- --> $DIR/where-allowed.rs:40:55
+ --> $DIR/where-allowed.rs:42:55
|
LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
- --> $DIR/where-allowed.rs:47:51
+ --> $DIR/where-allowed.rs:49:51
|
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return types
- --> $DIR/where-allowed.rs:52:53
+ --> $DIR/where-allowed.rs:54:53
|
LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
- --> $DIR/where-allowed.rs:56:57
+ --> $DIR/where-allowed.rs:58:57
|
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
- --> $DIR/where-allowed.rs:64:38
+ --> $DIR/where-allowed.rs:66:38
|
LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return types
- --> $DIR/where-allowed.rs:68:40
+ --> $DIR/where-allowed.rs:70:40
|
LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
- --> $DIR/where-allowed.rs:81:32
+ --> $DIR/where-allowed.rs:83:32
|
LL | struct InBraceStructField { x: impl Debug }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
- --> $DIR/where-allowed.rs:85:41
+ --> $DIR/where-allowed.rs:87:41
|
LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
- --> $DIR/where-allowed.rs:89:27
+ --> $DIR/where-allowed.rs:91:27
|
LL | struct InTupleStructField(impl Debug);
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
- --> $DIR/where-allowed.rs:94:25
+ --> $DIR/where-allowed.rs:96:25
|
LL | InBraceVariant { x: impl Debug },
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
- --> $DIR/where-allowed.rs:96:20
+ --> $DIR/where-allowed.rs:98:20
|
LL | InTupleVariant(impl Debug),
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return types
- --> $DIR/where-allowed.rs:107:23
+ --> $DIR/where-allowed.rs:109:23
|
LL | fn in_return() -> impl Debug;
| ^^^^^^^^^^
@@ -155,7 +155,7 @@ LL | fn in_return() -> impl Debug;
= help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
- --> $DIR/where-allowed.rs:124:34
+ --> $DIR/where-allowed.rs:126:34
|
LL | fn in_trait_impl_return() -> impl Debug { () }
| ^^^^^^^^^^
@@ -164,127 +164,127 @@ LL | fn in_trait_impl_return() -> impl Debug { () }
= help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `extern fn` params
- --> $DIR/where-allowed.rs:137:33
+ --> $DIR/where-allowed.rs:139:33
|
LL | fn in_foreign_parameters(_: impl Debug);
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `extern fn` return types
- --> $DIR/where-allowed.rs:140:31
+ --> $DIR/where-allowed.rs:142:31
|
LL | fn in_foreign_return() -> impl Debug;
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return types
- --> $DIR/where-allowed.rs:156:39
+ --> $DIR/where-allowed.rs:158:39
|
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in traits
- --> $DIR/where-allowed.rs:161:16
+ --> $DIR/where-allowed.rs:163:16
|
LL | impl PartialEq<impl Debug> for () {
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in impl headers
- --> $DIR/where-allowed.rs:166:24
+ --> $DIR/where-allowed.rs:168:24
|
LL | impl PartialEq<()> for impl Debug {
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in impl headers
- --> $DIR/where-allowed.rs:171:6
+ --> $DIR/where-allowed.rs:173:6
|
LL | impl impl Debug {
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in impl headers
- --> $DIR/where-allowed.rs:177:24
+ --> $DIR/where-allowed.rs:179:24
|
LL | impl InInherentImplAdt<impl Debug> {
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in bounds
- --> $DIR/where-allowed.rs:183:11
+ --> $DIR/where-allowed.rs:185:11
|
LL | where impl Debug: Debug
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in bounds
- --> $DIR/where-allowed.rs:190:15
+ --> $DIR/where-allowed.rs:192:15
|
LL | where Vec<impl Debug>: Debug
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in bounds
- --> $DIR/where-allowed.rs:197:24
+ --> $DIR/where-allowed.rs:199:24
|
LL | where T: PartialEq<impl Debug>
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
- --> $DIR/where-allowed.rs:204:17
+ --> $DIR/where-allowed.rs:206:17
|
LL | where T: Fn(impl Debug)
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return types
- --> $DIR/where-allowed.rs:211:22
+ --> $DIR/where-allowed.rs:213:22
|
LL | where T: Fn() -> impl Debug
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
- --> $DIR/where-allowed.rs:217:40
+ --> $DIR/where-allowed.rs:219:40
|
LL | struct InStructGenericParamDefault<T = impl Debug>(T);
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
- --> $DIR/where-allowed.rs:221:36
+ --> $DIR/where-allowed.rs:223:36
|
LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
- --> $DIR/where-allowed.rs:225:38
+ --> $DIR/where-allowed.rs:227:38
|
LL | trait InTraitGenericParamDefault<T = impl Debug> {}
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
- --> $DIR/where-allowed.rs:229:41
+ --> $DIR/where-allowed.rs:231:41
|
LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
- --> $DIR/where-allowed.rs:233:11
+ --> $DIR/where-allowed.rs:235:11
|
LL | impl <T = impl Debug> T {}
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
- --> $DIR/where-allowed.rs:240:40
+ --> $DIR/where-allowed.rs:242:40
|
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
| ^^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in variable bindings
- --> $DIR/where-allowed.rs:246:29
+ --> $DIR/where-allowed.rs:248:29
|
LL | let _in_local_variable: impl Fn() = || {};
| ^^^^^^^^^
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in closure return types
- --> $DIR/where-allowed.rs:248:46
+ --> $DIR/where-allowed.rs:250:46
|
LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
| ^^^^^^^^^
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
- --> $DIR/where-allowed.rs:233:7
+ --> $DIR/where-allowed.rs:235:7
|
LL | impl <T = impl Debug> T {}
| ^^^^^^^^^^^^^^
@@ -294,7 +294,7 @@ LL | impl <T = impl Debug> T {}
= note: `#[deny(invalid_type_param_default)]` on by default
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
- --> $DIR/where-allowed.rs:240:36
+ --> $DIR/where-allowed.rs:242:36
|
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
| ^^^^^^^^^^^^^^
@@ -303,7 +303,7 @@ LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
error[E0118]: no nominal type found for inherent implementation
- --> $DIR/where-allowed.rs:233:1
+ --> $DIR/where-allowed.rs:235:1
|
LL | impl <T = impl Debug> T {}
| ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
diff --git a/tests/ui/implied-bounds/ice-unbound-region-vars.rs b/tests/ui/implied-bounds/ice-unbound-region-vars.rs
new file mode 100644
index 000000000..9e1e3feae
--- /dev/null
+++ b/tests/ui/implied-bounds/ice-unbound-region-vars.rs
@@ -0,0 +1,24 @@
+// Because of #109628, we can have unbounded region vars in implied bounds.
+// Make sure we don't ICE in this case!
+//
+// check-pass
+
+pub trait MapAccess {
+ type Error;
+ fn next_key_seed(&mut self) -> Option<Self::Error>;
+}
+
+struct Access<'a> {
+ _marker: std::marker::PhantomData<&'a ()>,
+}
+
+// implied_bounds(Option<Self::Error>) = ['?1: 'a, ]
+// where '?1 is a fresh region var.
+impl<'a, 'b: 'a> MapAccess for Access<'a> {
+ type Error = ();
+ fn next_key_seed(&mut self) -> Option<Self::Error> {
+ unimplemented!()
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/implied-bounds/normalization-nested.lifetime.stderr b/tests/ui/implied-bounds/normalization-nested.lifetime.stderr
new file mode 100644
index 000000000..898e5e951
--- /dev/null
+++ b/tests/ui/implied-bounds/normalization-nested.lifetime.stderr
@@ -0,0 +1,18 @@
+error[E0759]: `fn` parameter has lifetime `'x` but it needs to satisfy a `'static` lifetime requirement
+ --> $DIR/normalization-nested.rs:35:20
+ |
+LL | pub fn test<'x>(_: Map<Vec<&'x ()>>, s: &'x str) -> &'static str {
+ | ^^^^^^^^^^^^^^^^
+ | |
+ | this data with lifetime `'x`...
+ | ...is used and required to live as long as `'static` here
+ |
+note: `'static` lifetime requirement introduced by this bound
+ --> $DIR/normalization-nested.rs:33:14
+ |
+LL | I::Item: 'static;
+ | ^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0759`.
diff --git a/tests/ui/implied-bounds/normalization-nested.rs b/tests/ui/implied-bounds/normalization-nested.rs
new file mode 100644
index 000000000..5f1cbb3f6
--- /dev/null
+++ b/tests/ui/implied-bounds/normalization-nested.rs
@@ -0,0 +1,39 @@
+// Test for normalization of projections that appear in the item bounds
+// (versus those that appear directly in the input types).
+// Both revisions should pass. `lifetime` revision is a bug.
+//
+// revisions: param_ty lifetime
+// [param_ty] check-pass
+// [lifetime] check-fail
+// [lifetime] known-bug: #109799
+
+pub trait Iter {
+ type Item;
+}
+
+#[cfg(param_ty)]
+impl<X, I> Iter for I
+where
+ I: IntoIterator<Item = X>,
+{
+ type Item = X;
+}
+
+#[cfg(lifetime)]
+impl<'x, I> Iter for I
+where
+ I: IntoIterator<Item = &'x ()>,
+{
+ type Item = &'x ();
+}
+
+pub struct Map<I>(I)
+where
+ I: Iter,
+ I::Item: 'static;
+
+pub fn test<'x>(_: Map<Vec<&'x ()>>, s: &'x str) -> &'static str {
+ s
+}
+
+fn main() {}
diff --git a/tests/ui/implied-bounds/normalization.rs b/tests/ui/implied-bounds/normalization.rs
new file mode 100644
index 000000000..f776fc98a
--- /dev/null
+++ b/tests/ui/implied-bounds/normalization.rs
@@ -0,0 +1,58 @@
+// Test that we get implied bounds from complex projections after normalization.
+
+// check-pass
+
+// implementations wil ensure that
+// WF(<T as Combine<'a>>::Ty) implies T: 'a
+trait Combine<'a> {
+ type Ty;
+}
+
+impl<'a, T: 'a> Combine<'a> for Box<T> {
+ type Ty = &'a T;
+}
+
+// ======= Wrappers ======
+
+// normalizes to a projection
+struct WrapA<T>(T);
+impl<'a, T> Combine<'a> for WrapA<T>
+where
+ T: Combine<'a>,
+{
+ type Ty = T::Ty;
+}
+
+// <WrapB<T> as Combine<'a>>::Ty normalizes to a type variable ?X
+// with constraint `<T as Combine<'a>>::Ty == ?X`
+struct WrapB<T>(T);
+impl<'a, X, T> Combine<'a> for WrapB<T>
+where
+ T: Combine<'a, Ty = X>,
+{
+ type Ty = X;
+}
+
+// <WrapC<T> as Combine<'a>>::Ty normalizes to `&'a &'?x ()`
+// with constraint `<T as Combine<'a>>::Ty == &'a &'?x ()`
+struct WrapC<T>(T);
+impl<'a, 'x: 'a, T> Combine<'a> for WrapC<T>
+where
+ T: Combine<'a, Ty = &'a &'x ()>,
+{
+ type Ty = &'a &'x ();
+}
+
+//==== Test implied bounds ======
+
+fn test_wrap<'a, 'b, 'c1, 'c2, A, B>(
+ _: <WrapA<Box<A>> as Combine<'a>>::Ty, // normalized: &'a A
+ _: <WrapB<Box<B>> as Combine<'b>>::Ty, // normalized: &'b B
+ _: <WrapC<Box<&'c1 ()>> as Combine<'c2>>::Ty, // normalized: &'c2 &'c1 ()
+) {
+ None::<&'a A>;
+ None::<&'b B>;
+ None::<&'c2 &'c1 ()>;
+}
+
+fn main() {}
diff --git a/tests/ui/imports/auxiliary/glob-conflict.rs b/tests/ui/imports/auxiliary/glob-conflict.rs
index c83db64c6..8a146378b 100644
--- a/tests/ui/imports/auxiliary/glob-conflict.rs
+++ b/tests/ui/imports/auxiliary/glob-conflict.rs
@@ -1,3 +1,5 @@
+#![allow(ambiguous_glob_reexports)]
+
mod m1 {
pub fn f() {}
}
diff --git a/tests/ui/imports/glob-resolve1.stderr b/tests/ui/imports/glob-resolve1.stderr
index 3b66a5e31..4401ef587 100644
--- a/tests/ui/imports/glob-resolve1.stderr
+++ b/tests/ui/imports/glob-resolve1.stderr
@@ -60,7 +60,7 @@ LL | import();
|
help: consider importing this function
|
-LL | use other::import;
+LL + use other::import;
|
error[E0412]: cannot find type `A` in this scope
diff --git a/tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs b/tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs
index da2acf6c9..d369f1e71 100644
--- a/tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs
+++ b/tests/ui/imports/issue-26873-multifile/issue-26873-multifile.rs
@@ -3,7 +3,6 @@
#![allow(unused_imports)]
#![allow(non_snake_case)]
-// ignore-pretty issue #37195
#[path = "issue-26873-multifile/mod.rs"]
mod multifile;
diff --git a/tests/ui/imports/issue-38293.stderr b/tests/ui/imports/issue-38293.stderr
index d2450ab12..1bb7ae29e 100644
--- a/tests/ui/imports/issue-38293.stderr
+++ b/tests/ui/imports/issue-38293.stderr
@@ -12,7 +12,7 @@ LL | baz();
|
help: consider importing this function instead
|
-LL | use bar::baz;
+LL + use bar::baz;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/imports/issue-4366-2.stderr b/tests/ui/imports/issue-4366-2.stderr
index 4c94634ee..412423f4d 100644
--- a/tests/ui/imports/issue-4366-2.stderr
+++ b/tests/ui/imports/issue-4366-2.stderr
@@ -18,7 +18,7 @@ LL | foo();
|
help: consider importing this function instead
|
-LL | use foo::foo;
+LL + use foo::foo;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/imports/issue-4366.stderr b/tests/ui/imports/issue-4366.stderr
index 469ea93e9..4d5b392a7 100644
--- a/tests/ui/imports/issue-4366.stderr
+++ b/tests/ui/imports/issue-4366.stderr
@@ -6,7 +6,7 @@ LL | fn sub() -> isize { foo(); 1 }
|
help: consider importing this function
|
-LL | use foo::foo;
+LL + use foo::foo;
|
error: aborting due to previous error
diff --git a/tests/ui/imports/local-modularized-tricky-fail-1.rs b/tests/ui/imports/local-modularized-tricky-fail-1.rs
index 29e9b8ec8..ce700ae0d 100644
--- a/tests/ui/imports/local-modularized-tricky-fail-1.rs
+++ b/tests/ui/imports/local-modularized-tricky-fail-1.rs
@@ -1,4 +1,5 @@
#![feature(decl_macro)]
+#![allow(ambiguous_glob_reexports)]
macro_rules! define_exported { () => {
#[macro_export]
diff --git a/tests/ui/imports/local-modularized-tricky-fail-1.stderr b/tests/ui/imports/local-modularized-tricky-fail-1.stderr
index 20eadaaaa..52a01e8bc 100644
--- a/tests/ui/imports/local-modularized-tricky-fail-1.stderr
+++ b/tests/ui/imports/local-modularized-tricky-fail-1.stderr
@@ -1,12 +1,12 @@
error[E0659]: `exported` is ambiguous
- --> $DIR/local-modularized-tricky-fail-1.rs:28:1
+ --> $DIR/local-modularized-tricky-fail-1.rs:29:1
|
LL | exported!();
| ^^^^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
note: `exported` could refer to the macro defined here
- --> $DIR/local-modularized-tricky-fail-1.rs:5:5
+ --> $DIR/local-modularized-tricky-fail-1.rs:6:5
|
LL | / macro_rules! exported {
LL | | () => ()
@@ -16,7 +16,7 @@ LL | | }
LL | define_exported!();
| ------------------ in this macro invocation
note: `exported` could also refer to the macro imported here
- --> $DIR/local-modularized-tricky-fail-1.rs:22:5
+ --> $DIR/local-modularized-tricky-fail-1.rs:23:5
|
LL | use inner1::*;
| ^^^^^^^^^
@@ -24,7 +24,7 @@ LL | use inner1::*;
= note: this error originates in the macro `define_exported` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `panic` is ambiguous
- --> $DIR/local-modularized-tricky-fail-1.rs:35:5
+ --> $DIR/local-modularized-tricky-fail-1.rs:36:5
|
LL | panic!();
| ^^^^^ ambiguous name
@@ -32,7 +32,7 @@ LL | panic!();
= 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: `panic` could refer to a macro from prelude
note: `panic` could also refer to the macro defined here
- --> $DIR/local-modularized-tricky-fail-1.rs:11:5
+ --> $DIR/local-modularized-tricky-fail-1.rs:12:5
|
LL | / macro_rules! panic {
LL | | () => ()
@@ -45,7 +45,7 @@ LL | define_panic!();
= note: this error originates in the macro `define_panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `include` is ambiguous
- --> $DIR/local-modularized-tricky-fail-1.rs:46:1
+ --> $DIR/local-modularized-tricky-fail-1.rs:47:1
|
LL | include!();
| ^^^^^^^ ambiguous name
@@ -53,7 +53,7 @@ LL | include!();
= 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: `include` could refer to a macro from prelude
note: `include` could also refer to the macro defined here
- --> $DIR/local-modularized-tricky-fail-1.rs:17:5
+ --> $DIR/local-modularized-tricky-fail-1.rs:18:5
|
LL | / macro_rules! include {
LL | | () => ()
diff --git a/tests/ui/imports/overlapping_pub_trait.stderr b/tests/ui/imports/overlapping_pub_trait.stderr
index d0c845a5e..490dccd3e 100644
--- a/tests/ui/imports/overlapping_pub_trait.stderr
+++ b/tests/ui/imports/overlapping_pub_trait.stderr
@@ -12,7 +12,7 @@ LL | pub trait Tr { fn method(&self); }
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use overlapping_pub_trait_source::m::Tr;
+LL + use overlapping_pub_trait_source::m::Tr;
|
error: aborting due to previous error
diff --git a/tests/ui/imports/unnamed_pub_trait.stderr b/tests/ui/imports/unnamed_pub_trait.stderr
index 319dfd7e1..5133273c2 100644
--- a/tests/ui/imports/unnamed_pub_trait.stderr
+++ b/tests/ui/imports/unnamed_pub_trait.stderr
@@ -12,7 +12,7 @@ LL | pub trait Tr { fn method(&self); }
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use unnamed_pub_trait_source::prelude::*; // trait Tr
+LL + use unnamed_pub_trait_source::prelude::*; // trait Tr
|
error: aborting due to previous error
diff --git a/tests/ui/index_message.rs b/tests/ui/index_message.rs
index 87e0cde59..88b848d6f 100644
--- a/tests/ui/index_message.rs
+++ b/tests/ui/index_message.rs
@@ -1,4 +1,4 @@
fn main() {
- let z = ();
- let _ = z[0]; //~ ERROR cannot index into a value of type `()`
+ let z = (10,);
+ let _ = z[0]; //~ ERROR cannot index into a value of type `({integer},)`
}
diff --git a/tests/ui/index_message.stderr b/tests/ui/index_message.stderr
index 6c2b12673..56d1d7080 100644
--- a/tests/ui/index_message.stderr
+++ b/tests/ui/index_message.stderr
@@ -1,4 +1,4 @@
-error[E0608]: cannot index into a value of type `()`
+error[E0608]: cannot index into a value of type `({integer},)`
--> $DIR/index_message.rs:3:13
|
LL | let _ = z[0];
diff --git a/tests/ui/inference/char-as-str-single.fixed b/tests/ui/inference/char-as-str-single.fixed
index bab1854dc..1621a279f 100644
--- a/tests/ui/inference/char-as-str-single.fixed
+++ b/tests/ui/inference/char-as-str-single.fixed
@@ -10,3 +10,12 @@ fn main() {
let _: char = '人'; //~ ERROR mismatched types
let _: char = '\''; //~ ERROR mismatched types
}
+
+// regression test for https://github.com/rust-lang/rust/issues/109586
+#[allow(dead_code)]
+fn convert_c_to_str(c: char) {
+ match c {
+ 'A' => {} //~ ERROR mismatched types
+ _ => {}
+ }
+}
diff --git a/tests/ui/inference/char-as-str-single.rs b/tests/ui/inference/char-as-str-single.rs
index 736920643..2903142f1 100644
--- a/tests/ui/inference/char-as-str-single.rs
+++ b/tests/ui/inference/char-as-str-single.rs
@@ -10,3 +10,12 @@ fn main() {
let _: char = "人"; //~ ERROR mismatched types
let _: char = "'"; //~ ERROR mismatched types
}
+
+// regression test for https://github.com/rust-lang/rust/issues/109586
+#[allow(dead_code)]
+fn convert_c_to_str(c: char) {
+ match c {
+ "A" => {} //~ ERROR mismatched types
+ _ => {}
+ }
+}
diff --git a/tests/ui/inference/char-as-str-single.stderr b/tests/ui/inference/char-as-str-single.stderr
index 3375ec6ac..9149efe32 100644
--- a/tests/ui/inference/char-as-str-single.stderr
+++ b/tests/ui/inference/char-as-str-single.stderr
@@ -37,6 +37,19 @@ help: if you meant to write a `char` literal, use single quotes
LL | let _: char = '\'';
| ~~~~
-error: aborting due to 3 previous errors
+error[E0308]: mismatched types
+ --> $DIR/char-as-str-single.rs:18:9
+ |
+LL | match c {
+ | - this expression has type `char`
+LL | "A" => {}
+ | ^^^ expected `char`, found `&str`
+ |
+help: if you meant to write a `char` literal, use single quotes
+ |
+LL | 'A' => {}
+ | ~~~
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/inference/issue-80409.rs b/tests/ui/inference/issue-80409.rs
new file mode 100644
index 000000000..80cad6dfc
--- /dev/null
+++ b/tests/ui/inference/issue-80409.rs
@@ -0,0 +1,36 @@
+// check-pass
+
+#![allow(unreachable_code, unused)]
+
+use std::marker::PhantomData;
+
+struct FsmBuilder<TFsm> {
+ _fsm: PhantomData<TFsm>,
+}
+
+impl<TFsm> FsmBuilder<TFsm> {
+ fn state(&mut self) -> FsmStateBuilder<TFsm> {
+ todo!()
+ }
+}
+
+struct FsmStateBuilder<TFsm> {
+ _state: PhantomData<TFsm>,
+}
+
+impl<TFsm> FsmStateBuilder<TFsm> {
+ fn on_entry<TAction: Fn(&mut StateContext<'_, TFsm>)>(&self, _action: TAction) {}
+}
+
+trait Fsm {
+ type Context;
+}
+
+struct StateContext<'a, TFsm: Fsm> {
+ context: &'a mut TFsm::Context,
+}
+
+fn main() {
+ let mut builder: FsmBuilder<usize> = todo!();
+ builder.state().on_entry(|_| {});
+}
diff --git a/tests/ui/inference/issue-83606.stderr b/tests/ui/inference/issue-83606.stderr
index f2ee8692e..97ed53fb3 100644
--- a/tests/ui/inference/issue-83606.stderr
+++ b/tests/ui/inference/issue-83606.stderr
@@ -4,7 +4,7 @@ error[E0282]: type annotations needed for `[usize; N]`
LL | let _ = foo("foo");
| ^
|
-help: consider giving this pattern a type, where the the value of const parameter `N` is specified
+help: consider giving this pattern a type, where the value of const parameter `N` is specified
|
LL | let _: [usize; N] = foo("foo");
| ++++++++++++
diff --git a/tests/ui/inference/need_type_info/concrete-impl.rs b/tests/ui/inference/need_type_info/concrete-impl.rs
index 72e0e74f3..fc79e6201 100644
--- a/tests/ui/inference/need_type_info/concrete-impl.rs
+++ b/tests/ui/inference/need_type_info/concrete-impl.rs
@@ -7,10 +7,13 @@ struct Two;
struct Struct;
impl Ambiguous<One> for Struct {}
+//~^ NOTE multiple `impl`s satisfying `Struct: Ambiguous<_>` found
impl Ambiguous<Two> for Struct {}
fn main() {
<Struct as Ambiguous<_>>::method();
//~^ ERROR type annotations needed
+ //~| NOTE cannot infer type of the type parameter `A`
//~| ERROR type annotations needed
+ //~| NOTE infer type of the type parameter `A`
}
diff --git a/tests/ui/inference/need_type_info/concrete-impl.stderr b/tests/ui/inference/need_type_info/concrete-impl.stderr
index aa3296995..74c3f6cd5 100644
--- a/tests/ui/inference/need_type_info/concrete-impl.stderr
+++ b/tests/ui/inference/need_type_info/concrete-impl.stderr
@@ -1,20 +1,21 @@
error[E0282]: type annotations needed
- --> $DIR/concrete-impl.rs:13:5
+ --> $DIR/concrete-impl.rs:14:5
|
LL | <Struct as Ambiguous<_>>::method();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `Self` declared on the trait `Ambiguous`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `A` declared on the trait `Ambiguous`
error[E0283]: type annotations needed
- --> $DIR/concrete-impl.rs:13:5
+ --> $DIR/concrete-impl.rs:14:5
|
LL | <Struct as Ambiguous<_>>::method();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `Self` declared on the trait `Ambiguous`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `A` declared on the trait `Ambiguous`
|
note: multiple `impl`s satisfying `Struct: Ambiguous<_>` found
--> $DIR/concrete-impl.rs:9:1
|
LL | impl Ambiguous<One> for Struct {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
LL | impl Ambiguous<Two> for Struct {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/inference/need_type_info/issue-109905.rs b/tests/ui/inference/need_type_info/issue-109905.rs
new file mode 100644
index 000000000..99d10a5ea
--- /dev/null
+++ b/tests/ui/inference/need_type_info/issue-109905.rs
@@ -0,0 +1,25 @@
+// Test that we show the correct type parameter that couldn't be inferred and that we don't
+// end up stating nonsense like "type parameter `'a`" which we used to do.
+
+trait Trait<'a, T> {
+ fn m(self);
+}
+
+impl<'a, A> Trait<'a, A> for () {
+ fn m(self) {}
+}
+
+fn qualified() {
+ <() as Trait<'static, _>>::m(());
+ //~^ ERROR type annotations needed
+ //~| NOTE cannot infer type of the type parameter `T`
+
+}
+
+fn unqualified() {
+ Trait::<'static, _>::m(());
+ //~^ ERROR type annotations needed
+ //~| NOTE cannot infer type of the type parameter `T`
+}
+
+fn main() {}
diff --git a/tests/ui/inference/need_type_info/issue-109905.stderr b/tests/ui/inference/need_type_info/issue-109905.stderr
new file mode 100644
index 000000000..fcdd50f14
--- /dev/null
+++ b/tests/ui/inference/need_type_info/issue-109905.stderr
@@ -0,0 +1,15 @@
+error[E0282]: type annotations needed
+ --> $DIR/issue-109905.rs:13:5
+ |
+LL | <() as Trait<'static, _>>::m(());
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the trait `Trait`
+
+error[E0282]: type annotations needed
+ --> $DIR/issue-109905.rs:20:5
+ |
+LL | Trait::<'static, _>::m(());
+ | ^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the trait `Trait`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/infinite/infinite-trait-alias-recursion.stderr b/tests/ui/infinite/infinite-trait-alias-recursion.stderr
index b925b3b01..683987b49 100644
--- a/tests/ui/infinite/infinite-trait-alias-recursion.stderr
+++ b/tests/ui/infinite/infinite-trait-alias-recursion.stderr
@@ -1,30 +1,15 @@
error[E0391]: cycle detected when computing the super predicates of `T1`
- --> $DIR/infinite-trait-alias-recursion.rs:3:1
- |
-LL | trait T1 = T2;
- | ^^^^^^^^
- |
-note: ...which requires computing the super traits of `T1`...
--> $DIR/infinite-trait-alias-recursion.rs:3:12
|
LL | trait T1 = T2;
| ^^
-note: ...which requires computing the super predicates of `T2`...
- --> $DIR/infinite-trait-alias-recursion.rs:6:1
|
-LL | trait T2 = T3;
- | ^^^^^^^^
-note: ...which requires computing the super traits of `T2`...
+note: ...which requires computing the super predicates of `T2`...
--> $DIR/infinite-trait-alias-recursion.rs:6:12
|
LL | trait T2 = T3;
| ^^
note: ...which requires computing the super predicates of `T3`...
- --> $DIR/infinite-trait-alias-recursion.rs:8:1
- |
-LL | trait T3 = T1 + T3;
- | ^^^^^^^^
-note: ...which requires computing the super traits of `T3`...
--> $DIR/infinite-trait-alias-recursion.rs:8:12
|
LL | trait T3 = T1 + T3;
diff --git a/tests/ui/inline-const/const-match-pat-generic.rs b/tests/ui/inline-const/const-match-pat-generic.rs
index 7c0d83516..46e501abf 100644
--- a/tests/ui/inline-const/const-match-pat-generic.rs
+++ b/tests/ui/inline-const/const-match-pat-generic.rs
@@ -7,7 +7,6 @@ fn foo<const V: usize>() {
match 0 {
const { V } => {},
//~^ ERROR constant pattern depends on a generic parameter
- //~| ERROR constant pattern depends on a generic parameter
_ => {},
}
}
@@ -20,7 +19,6 @@ fn bar<const V: usize>() {
match 0 {
const { f(V) } => {},
//~^ ERROR constant pattern depends on a generic parameter
- //~| ERROR constant pattern depends on a generic parameter
_ => {},
}
}
diff --git a/tests/ui/inline-const/const-match-pat-generic.stderr b/tests/ui/inline-const/const-match-pat-generic.stderr
index 77267f12f..4ffbde410 100644
--- a/tests/ui/inline-const/const-match-pat-generic.stderr
+++ b/tests/ui/inline-const/const-match-pat-generic.stderr
@@ -5,22 +5,10 @@ LL | const { V } => {},
| ^^^^^^^^^^^
error: constant pattern depends on a generic parameter
- --> $DIR/const-match-pat-generic.rs:21:9
+ --> $DIR/const-match-pat-generic.rs:20:9
|
LL | const { f(V) } => {},
| ^^^^^^^^^^^^^^
-error: constant pattern depends on a generic parameter
- --> $DIR/const-match-pat-generic.rs:8:9
- |
-LL | const { V } => {},
- | ^^^^^^^^^^^
-
-error: constant pattern depends on a generic parameter
- --> $DIR/const-match-pat-generic.rs:21:9
- |
-LL | const { f(V) } => {},
- | ^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
diff --git a/tests/ui-fulldeps/internal-lints/diagnostics_incorrect.rs b/tests/ui/internal-lints/diagnostics_incorrect.rs
index 99f99ffcd..99f99ffcd 100644
--- a/tests/ui-fulldeps/internal-lints/diagnostics_incorrect.rs
+++ b/tests/ui/internal-lints/diagnostics_incorrect.rs
diff --git a/tests/ui-fulldeps/internal-lints/diagnostics_incorrect.stderr b/tests/ui/internal-lints/diagnostics_incorrect.stderr
index e849ca282..e849ca282 100644
--- a/tests/ui-fulldeps/internal-lints/diagnostics_incorrect.stderr
+++ b/tests/ui/internal-lints/diagnostics_incorrect.stderr
diff --git a/tests/ui-fulldeps/internal-lints/existing_doc_keyword.rs b/tests/ui/internal-lints/existing_doc_keyword.rs
index 7783dc40f..7783dc40f 100644
--- a/tests/ui-fulldeps/internal-lints/existing_doc_keyword.rs
+++ b/tests/ui/internal-lints/existing_doc_keyword.rs
diff --git a/tests/ui-fulldeps/internal-lints/existing_doc_keyword.stderr b/tests/ui/internal-lints/existing_doc_keyword.stderr
index 4e296fff6..5110b9be0 100644
--- a/tests/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
+++ b/tests/ui/internal-lints/existing_doc_keyword.stderr
@@ -1,4 +1,4 @@
-error: found non-existing keyword `tadam` used in `#[doc(keyword = \"...\")]`
+error: found non-existing keyword `tadam` used in `#[doc(keyword = "...")]`
--> $DIR/existing_doc_keyword.rs:10:1
|
LL | #[doc(keyword = "tadam")]
diff --git a/tests/ui-fulldeps/internal-lints/query_stability_incorrect.rs b/tests/ui/internal-lints/query_stability_incorrect.rs
index f478b7332..f478b7332 100644
--- a/tests/ui-fulldeps/internal-lints/query_stability_incorrect.rs
+++ b/tests/ui/internal-lints/query_stability_incorrect.rs
diff --git a/tests/ui-fulldeps/internal-lints/query_stability_incorrect.stderr b/tests/ui/internal-lints/query_stability_incorrect.stderr
index 3f78b39ed..3f78b39ed 100644
--- a/tests/ui-fulldeps/internal-lints/query_stability_incorrect.stderr
+++ b/tests/ui/internal-lints/query_stability_incorrect.stderr
diff --git a/tests/ui-fulldeps/internal-lints/rustc_pass_by_value_self.rs b/tests/ui/internal-lints/rustc_pass_by_value_self.rs
index 6ce67dcaf..6ce67dcaf 100644
--- a/tests/ui-fulldeps/internal-lints/rustc_pass_by_value_self.rs
+++ b/tests/ui/internal-lints/rustc_pass_by_value_self.rs
diff --git a/tests/ui-fulldeps/internal-lints/rustc_pass_by_value_self.stderr b/tests/ui/internal-lints/rustc_pass_by_value_self.stderr
index fb39ed60b..fb39ed60b 100644
--- a/tests/ui-fulldeps/internal-lints/rustc_pass_by_value_self.stderr
+++ b/tests/ui/internal-lints/rustc_pass_by_value_self.stderr
diff --git a/tests/ui/internal/internal-unstable-const.stderr b/tests/ui/internal/internal-unstable-const.stderr
index 37d2ea6d2..5c63992d8 100644
--- a/tests/ui/internal/internal-unstable-const.stderr
+++ b/tests/ui/internal/internal-unstable-const.stderr
@@ -6,11 +6,13 @@ LL | 1.0 + 1.0
|
help: if it is not part of the public API, make this function unstably const
|
-LL | #[rustc_const_unstable(feature = "...", issue = "...")]
+LL + #[rustc_const_unstable(feature = "...", issue = "...")]
+LL | pub const fn foo() -> f32 {
|
help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
|
-LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
+LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
+LL | pub const fn foo() -> f32 {
|
error: aborting due to previous error
diff --git a/tests/ui-fulldeps/issue-11881.rs b/tests/ui/issue-11881.rs
index f6360db9b..f6360db9b 100644
--- a/tests/ui-fulldeps/issue-11881.rs
+++ b/tests/ui/issue-11881.rs
diff --git a/tests/ui-fulldeps/issue-13560.rs b/tests/ui/issue-13560.rs
index 5f7d647e2..3397202be 100644
--- a/tests/ui-fulldeps/issue-13560.rs
+++ b/tests/ui/issue-13560.rs
@@ -1,4 +1,5 @@
// run-pass
+// ignore-cross-compile (needs dylibs and compiletest doesn't have a more specific header)
// aux-build:issue-13560-1.rs
// aux-build:issue-13560-2.rs
// aux-build:issue-13560-3.rs
diff --git a/tests/ui-fulldeps/issue-15924.rs b/tests/ui/issue-15924.rs
index d8b3914d0..d8b3914d0 100644
--- a/tests/ui-fulldeps/issue-15924.rs
+++ b/tests/ui/issue-15924.rs
diff --git a/tests/ui-fulldeps/issue-16822.rs b/tests/ui/issue-16822.rs
index c611c33af..c611c33af 100644
--- a/tests/ui-fulldeps/issue-16822.rs
+++ b/tests/ui/issue-16822.rs
diff --git a/tests/ui-fulldeps/issue-18502.rs b/tests/ui/issue-18502.rs
index 2082ae7a9..2082ae7a9 100644
--- a/tests/ui-fulldeps/issue-18502.rs
+++ b/tests/ui/issue-18502.rs
diff --git a/tests/ui-fulldeps/issue-24106.rs b/tests/ui/issue-24106.rs
index 45f0bd5b6..45f0bd5b6 100644
--- a/tests/ui-fulldeps/issue-24106.rs
+++ b/tests/ui/issue-24106.rs
diff --git a/tests/ui-fulldeps/issue-2804.rs b/tests/ui/issue-2804.rs
index 571028c5e..571028c5e 100644
--- a/tests/ui-fulldeps/issue-2804.rs
+++ b/tests/ui/issue-2804.rs
diff --git a/tests/ui/issues/issue-10465.stderr b/tests/ui/issues/issue-10465.stderr
index 0ccf69dc0..1b7b9d590 100644
--- a/tests/ui/issues/issue-10465.stderr
+++ b/tests/ui/issues/issue-10465.stderr
@@ -7,7 +7,7 @@ LL | b.foo();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use a::A;
+LL + use a::A;
|
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-106755.rs b/tests/ui/issues/issue-106755.rs
index 46ece725f..5eabc3bfb 100644
--- a/tests/ui/issues/issue-106755.rs
+++ b/tests/ui/issues/issue-106755.rs
@@ -15,5 +15,7 @@ impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR found both positive and nega
unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
impl !Send for TestType<i32> {}
+//~^ WARNING
+//~| WARNING this will change its meaning
fn main() {}
diff --git a/tests/ui/issues/issue-106755.stderr b/tests/ui/issues/issue-106755.stderr
index 543970340..6b3a8427e 100644
--- a/tests/ui/issues/issue-106755.stderr
+++ b/tests/ui/issues/issue-106755.stderr
@@ -16,7 +16,23 @@ LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
LL | unsafe impl<T: 'static> Send for TestType<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
-error: aborting due to 2 previous errors
+warning: cross-crate traits with a default impl, like `Send`, should not be specialized
+ --> $DIR/issue-106755.rs:17:1
+ |
+LL | impl !Send for TestType<i32> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this will change its meaning in a future release!
+ = note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
+ = note: `i32` is not a generic parameter
+note: try using the same sequence of generic parameters as the struct definition
+ --> $DIR/issue-106755.rs:9:1
+ |
+LL | struct TestType<T>(::std::marker::PhantomData<T>);
+ | ^^^^^^^^^^^^^^^^^^
+ = note: `#[warn(suspicious_auto_trait_impls)]` on by default
+
+error: aborting due to 2 previous errors; 1 warning emitted
Some errors have detailed explanations: E0119, E0751.
For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/issues/issue-11709.rs b/tests/ui/issues/issue-11709.rs
index cb5e3dff3..58424f9e4 100644
--- a/tests/ui/issues/issue-11709.rs
+++ b/tests/ui/issues/issue-11709.rs
@@ -1,6 +1,5 @@
// run-pass
#![allow(dead_code)]
-// ignore-pretty issue #37199
// Don't panic on blocks without results
// There are several tests in this run-pass that raised
diff --git a/tests/ui/issues/issue-12511.stderr b/tests/ui/issues/issue-12511.stderr
index 789a1141c..558aad109 100644
--- a/tests/ui/issues/issue-12511.stderr
+++ b/tests/ui/issues/issue-12511.stderr
@@ -1,20 +1,10 @@
error[E0391]: cycle detected when computing the super predicates of `T1`
- --> $DIR/issue-12511.rs:1:1
- |
-LL | trait T1 : T2 {
- | ^^^^^^^^^^^^^
- |
-note: ...which requires computing the super traits of `T1`...
--> $DIR/issue-12511.rs:1:12
|
LL | trait T1 : T2 {
| ^^
-note: ...which requires computing the super predicates of `T2`...
- --> $DIR/issue-12511.rs:5:1
|
-LL | trait T2 : T1 {
- | ^^^^^^^^^^^^^
-note: ...which requires computing the super traits of `T2`...
+note: ...which requires computing the super predicates of `T2`...
--> $DIR/issue-12511.rs:5:12
|
LL | trait T2 : T1 {
diff --git a/tests/ui/issues/issue-17546.stderr b/tests/ui/issues/issue-17546.stderr
index 81592320a..cf7ed1bbd 100644
--- a/tests/ui/issues/issue-17546.stderr
+++ b/tests/ui/issues/issue-17546.stderr
@@ -24,13 +24,13 @@ LL | fn new() -> Result<foo::MyEnum, String> {
|
help: consider importing one of these items instead
|
-LL | use std::fmt::Result;
+LL + use std::fmt::Result;
|
-LL | use std::io::Result;
+LL + use std::io::Result;
|
-LL | use std::result::Result;
+LL + use std::result::Result;
|
-LL | use std::thread::Result;
+LL + use std::thread::Result;
|
error[E0573]: expected type, found variant `Result`
@@ -41,13 +41,13 @@ LL | fn new() -> Result<foo::MyEnum, String> {
|
help: consider importing one of these items instead
|
-LL | use std::fmt::Result;
+LL + use std::fmt::Result;
|
-LL | use std::io::Result;
+LL + use std::io::Result;
|
-LL | use std::result::Result;
+LL + use std::result::Result;
|
-LL | use std::thread::Result;
+LL + use std::thread::Result;
|
error[E0573]: expected type, found variant `NoResult`
diff --git a/tests/ui/issues/issue-19086.stderr b/tests/ui/issues/issue-19086.stderr
index a3c06a725..90d0bb406 100644
--- a/tests/ui/issues/issue-19086.stderr
+++ b/tests/ui/issues/issue-19086.stderr
@@ -5,7 +5,7 @@ LL | FooB { x: i32, y: i32 }
| ----------------------- `FooB` defined here
...
LL | FooB(a, b) => println!("{} {}", a, b),
- | ^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x, y }`
+ | ^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x: a, y: b }`
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-20162.stderr b/tests/ui/issues/issue-20162.stderr
index 1c5b76fbf..ebdf2528f 100644
--- a/tests/ui/issues/issue-20162.stderr
+++ b/tests/ui/issues/issue-20162.stderr
@@ -8,7 +8,8 @@ note: required by a bound in `slice::<impl [T]>::sort`
--> $SRC_DIR/alloc/src/slice.rs:LL:COL
help: consider annotating `X` with `#[derive(Ord)]`
|
-LL | #[derive(Ord)]
+LL + #[derive(Ord)]
+LL | struct X { x: i32 }
|
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-20413.stderr b/tests/ui/issues/issue-20413.stderr
index 202e84631..8891a2678 100644
--- a/tests/ui/issues/issue-20413.stderr
+++ b/tests/ui/issues/issue-20413.stderr
@@ -20,51 +20,51 @@ note: required for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoDa
LL | impl<T> Foo for T where NoData<T>: Foo {
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
- = note: 127 redundant requirements hidden
+ = note: 126 redundant requirements hidden
= note: required for `NoData<T>` to implement `Foo`
-error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<...>>>>>>>: Baz`
+error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<...>>>>>>>: Bar`
--> $DIR/issue-20413.rs:28:42
|
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
-note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<...>>>>>>>` to implement `Bar`
- --> $DIR/issue-20413.rs:28:9
- |
-LL | impl<T> Bar for T where EvenLessData<T>: Baz {
- | ^^^ ^ --- unsatisfied trait bound introduced here
- = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<...>>>>>>>` to implement `Baz`
--> $DIR/issue-20413.rs:35:9
|
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
- = note: 126 redundant requirements hidden
+note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<...>>>>>>>` to implement `Bar`
+ --> $DIR/issue-20413.rs:28:9
+ |
+LL | impl<T> Bar for T where EvenLessData<T>: Baz {
+ | ^^^ ^ --- unsatisfied trait bound introduced here
+ = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
+ = note: 125 redundant requirements hidden
= note: required for `EvenLessData<T>` to implement `Baz`
-error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<...>>>>>>>: Bar`
+error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<...>>>>>>>: Baz`
--> $DIR/issue-20413.rs:35:42
|
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
-note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<...>>>>>>>` to implement `Baz`
- --> $DIR/issue-20413.rs:35:9
- |
-LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
- | ^^^ ^ --- unsatisfied trait bound introduced here
- = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<...>>>>>>>` to implement `Bar`
--> $DIR/issue-20413.rs:28:9
|
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
- = note: 126 redundant requirements hidden
+note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<...>>>>>>>` to implement `Baz`
+ --> $DIR/issue-20413.rs:35:9
+ |
+LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
+ | ^^^ ^ --- unsatisfied trait bound introduced here
+ = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
+ = note: 125 redundant requirements hidden
= note: required for `AlmostNoData<T>` to implement `Bar`
error: aborting due to 4 previous errors
diff --git a/tests/ui/issues/issue-20772.stderr b/tests/ui/issues/issue-20772.stderr
index 22b9f5bd4..416fd8c06 100644
--- a/tests/ui/issues/issue-20772.stderr
+++ b/tests/ui/issues/issue-20772.stderr
@@ -5,7 +5,7 @@ LL | trait T : Iterator<Item=Self::Item>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which immediately requires computing the super traits of `T` with associated type name `Item` again
-note: cycle used when computing the super traits of `T`
+note: cycle used when computing the super predicates of `T`
--> $DIR/issue-20772.rs:1:1
|
LL | trait T : Iterator<Item=Self::Item>
diff --git a/tests/ui/issues/issue-21160.stderr b/tests/ui/issues/issue-21160.stderr
index 266749376..b39a3aad3 100644
--- a/tests/ui/issues/issue-21160.stderr
+++ b/tests/ui/issues/issue-21160.stderr
@@ -9,7 +9,8 @@ LL | struct Foo(Bar);
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Bar` with `#[derive(Hash)]`
|
-LL | #[derive(Hash)]
+LL + #[derive(Hash)]
+LL | struct Bar;
|
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-27340.rs b/tests/ui/issues/issue-27340.rs
index 61c77cc1f..aff37d95a 100644
--- a/tests/ui/issues/issue-27340.rs
+++ b/tests/ui/issues/issue-27340.rs
@@ -1,6 +1,6 @@
struct Foo;
#[derive(Copy, Clone)]
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
struct Bar(Foo);
fn main() {}
diff --git a/tests/ui/issues/issue-27340.stderr b/tests/ui/issues/issue-27340.stderr
index 40889b866..9caaffd9c 100644
--- a/tests/ui/issues/issue-27340.stderr
+++ b/tests/ui/issues/issue-27340.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/issue-27340.rs:2:10
|
LL | #[derive(Copy, Clone)]
diff --git a/tests/ui/issues/issue-27842.rs b/tests/ui/issues/issue-27842.rs
index 3bcfa1330..060d3b34e 100644
--- a/tests/ui/issues/issue-27842.rs
+++ b/tests/ui/issues/issue-27842.rs
@@ -8,4 +8,9 @@ fn main() {
let i = 0_usize;
let _ = tup[i];
//~^ ERROR cannot index into a value of type
+
+ // the case where the index is out of bounds
+ let tup = (10,);
+ let _ = tup[3];
+ //~^ ERROR cannot index into a value of type
}
diff --git a/tests/ui/issues/issue-27842.stderr b/tests/ui/issues/issue-27842.stderr
index 784666a63..83333aa0c 100644
--- a/tests/ui/issues/issue-27842.stderr
+++ b/tests/ui/issues/issue-27842.stderr
@@ -8,10 +8,20 @@ error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer
--> $DIR/issue-27842.rs:9:13
|
LL | let _ = tup[i];
+ | ^^^^-^
+ | |
+ | cannot access tuple elements at a variable index
+ |
+ = help: to access tuple elements, use tuple indexing syntax (e.g., `tuple.0`)
+
+error[E0608]: cannot index into a value of type `({integer},)`
+ --> $DIR/issue-27842.rs:14:13
+ |
+LL | let _ = tup[3];
| ^^^^^^
|
= help: to access tuple elements, use tuple indexing syntax (e.g., `tuple.0`)
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0608`.
diff --git a/tests/ui/issues/issue-28433.rs b/tests/ui/issues/issue-28433.rs
index 8d05c32d5..2298ad240 100644
--- a/tests/ui/issues/issue-28433.rs
+++ b/tests/ui/issues/issue-28433.rs
@@ -1,9 +1,9 @@
enum Bird {
pub Duck,
- //~^ ERROR unnecessary visibility qualifier
+ //~^ ERROR visibility qualifiers are not permitted here
Goose,
pub(crate) Dove
- //~^ ERROR unnecessary visibility qualifier
+ //~^ ERROR visibility qualifiers are not permitted here
}
diff --git a/tests/ui/issues/issue-28433.stderr b/tests/ui/issues/issue-28433.stderr
index 9f5f63336..5fb8a8962 100644
--- a/tests/ui/issues/issue-28433.stderr
+++ b/tests/ui/issues/issue-28433.stderr
@@ -1,14 +1,18 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/issue-28433.rs:2:5
|
LL | pub Duck,
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: enum variants and their fields always share the visibility of the enum they are in
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/issue-28433.rs:5:5
|
LL | pub(crate) Dove
| ^^^^^^^^^^
+ |
+ = note: enum variants and their fields always share the visibility of the enum they are in
error: aborting due to 2 previous errors
diff --git a/tests/ui/issues/issue-28839.rs b/tests/ui/issues/issue-28839.rs
index 73be87a0c..c086f412a 100644
--- a/tests/ui/issues/issue-28839.rs
+++ b/tests/ui/issues/issue-28839.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37199
pub struct Foo;
diff --git a/tests/ui/issues/issue-3029.rs b/tests/ui/issues/issue-3029.rs
index a5d30960a..43c8a0a23 100644
--- a/tests/ui/issues/issue-3029.rs
+++ b/tests/ui/issues/issue-3029.rs
@@ -2,9 +2,7 @@
// error-pattern:so long
// ignore-emscripten no processes
-#![allow(unused_allocation)]
#![allow(unreachable_code)]
-#![allow(unused_variables)]
fn main() {
let mut x = Vec::new();
diff --git a/tests/ui/issues/issue-35976.unimported.stderr b/tests/ui/issues/issue-35976.unimported.stderr
index 5d61bb8ea..b31d2a315 100644
--- a/tests/ui/issues/issue-35976.unimported.stderr
+++ b/tests/ui/issues/issue-35976.unimported.stderr
@@ -9,7 +9,7 @@ LL | arg.wait();
|
help: another candidate was found in the following trait, perhaps add a `use` for it:
|
-LL | use private::Future;
+LL + use private::Future;
|
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-37534.stderr b/tests/ui/issues/issue-37534.stderr
index 895479986..7d3dd8800 100644
--- a/tests/ui/issues/issue-37534.stderr
+++ b/tests/ui/issues/issue-37534.stderr
@@ -6,7 +6,7 @@ LL | struct Foo<T: ?Hash> { }
|
help: consider importing this trait instead
|
-LL | use std::hash::Hash;
+LL + use std::hash::Hash;
|
warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported
diff --git a/tests/ui/issues/issue-38190.rs b/tests/ui/issues/issue-38190.rs
index cfa0420c8..3bb4c7b98 100644
--- a/tests/ui/issues/issue-38190.rs
+++ b/tests/ui/issues/issue-38190.rs
@@ -1,6 +1,5 @@
// run-pass
// aux-build:issue-38190.rs
-// ignore-pretty issue #37195
#[macro_use]
extern crate issue_38190;
diff --git a/tests/ui/issues/issue-39175.stderr b/tests/ui/issues/issue-39175.stderr
index afceae82e..3a1476ac0 100644
--- a/tests/ui/issues/issue-39175.stderr
+++ b/tests/ui/issues/issue-39175.stderr
@@ -7,7 +7,7 @@ LL | Command::new("echo").arg("hello").exec();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use std::os::unix::process::CommandExt;
+LL + use std::os::unix::process::CommandExt;
|
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-50403.rs b/tests/ui/issues/issue-50403.rs
index 012057fc2..ab22aff26 100644
--- a/tests/ui/issues/issue-50403.rs
+++ b/tests/ui/issues/issue-50403.rs
@@ -1,5 +1,5 @@
#![feature(concat_idents)]
fn main() {
- let x = concat_idents!(); //~ ERROR concat_idents! takes 1 or more arguments
+ let x = concat_idents!(); //~ ERROR `concat_idents!()` takes 1 or more arguments
}
diff --git a/tests/ui/issues/issue-50403.stderr b/tests/ui/issues/issue-50403.stderr
index a3a2ed044..d50befa5e 100644
--- a/tests/ui/issues/issue-50403.stderr
+++ b/tests/ui/issues/issue-50403.stderr
@@ -1,4 +1,4 @@
-error: concat_idents! takes 1 or more arguments
+error: `concat_idents!()` takes 1 or more arguments
--> $DIR/issue-50403.rs:4:13
|
LL | let x = concat_idents!();
diff --git a/tests/ui/issues/issue-56175.stderr b/tests/ui/issues/issue-56175.stderr
index 013a440ed..1ddee1f48 100644
--- a/tests/ui/issues/issue-56175.stderr
+++ b/tests/ui/issues/issue-56175.stderr
@@ -12,7 +12,7 @@ LL | fn trait_method(&self) {
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use reexported_trait::Trait;
+LL + use reexported_trait::Trait;
|
error[E0599]: no method named `trait_method_b` found for struct `FooStruct` in the current scope
@@ -29,7 +29,7 @@ LL | fn trait_method_b(&self) {
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use reexported_trait::TraitBRename;
+LL + use reexported_trait::TraitBRename;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/issues/issue-59488.stderr b/tests/ui/issues/issue-59488.stderr
index d45beefa4..ac8862716 100644
--- a/tests/ui/issues/issue-59488.stderr
+++ b/tests/ui/issues/issue-59488.stderr
@@ -90,16 +90,6 @@ LL | assert_eq!(Foo::Bar, i);
| ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
= help: the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
- = help: the following other types implement trait `Debug`:
- extern "C" fn() -> Ret
- extern "C" fn(A, B) -> Ret
- extern "C" fn(A, B, ...) -> Ret
- extern "C" fn(A, B, C) -> Ret
- extern "C" fn(A, B, C, ...) -> Ret
- extern "C" fn(A, B, C, D) -> Ret
- extern "C" fn(A, B, C, D, ...) -> Ret
- extern "C" fn(A, B, C, D, E) -> Ret
- and 118 others
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
@@ -109,16 +99,6 @@ LL | assert_eq!(Foo::Bar, i);
| ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
= help: the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
- = help: the following other types implement trait `Debug`:
- extern "C" fn() -> Ret
- extern "C" fn(A, B) -> Ret
- extern "C" fn(A, B, ...) -> Ret
- extern "C" fn(A, B, C) -> Ret
- extern "C" fn(A, B, C, ...) -> Ret
- extern "C" fn(A, B, C, D) -> Ret
- extern "C" fn(A, B, C, D, ...) -> Ret
- extern "C" fn(A, B, C, D, E) -> Ret
- and 118 others
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 10 previous errors
diff --git a/tests/ui/issues/issue-62375.stderr b/tests/ui/issues/issue-62375.stderr
index 478e025be..a6fd3700e 100644
--- a/tests/ui/issues/issue-62375.stderr
+++ b/tests/ui/issues/issue-62375.stderr
@@ -13,7 +13,8 @@ LL | enum A {
| ^^^^^^ must implement `PartialEq<_>`
help: consider annotating `A` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | enum A {
|
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-66667-function-cmp-cycle.rs b/tests/ui/issues/issue-66667-function-cmp-cycle.rs
index 7b025be11..b4f09fbbb 100644
--- a/tests/ui/issues/issue-66667-function-cmp-cycle.rs
+++ b/tests/ui/issues/issue-66667-function-cmp-cycle.rs
@@ -1,16 +1,19 @@
fn first() {
second == 1 //~ ERROR binary operation
//~^ ERROR mismatched types
+ //~| ERROR mismatched types
}
fn second() {
first == 1 //~ ERROR binary operation
//~^ ERROR mismatched types
+ //~| ERROR mismatched types
}
fn bar() {
bar == 1 //~ ERROR binary operation
//~^ ERROR mismatched types
+ //~| ERROR mismatched types
}
fn main() {}
diff --git a/tests/ui/issues/issue-66667-function-cmp-cycle.stderr b/tests/ui/issues/issue-66667-function-cmp-cycle.stderr
index 887699ef5..d9a960ce1 100644
--- a/tests/ui/issues/issue-66667-function-cmp-cycle.stderr
+++ b/tests/ui/issues/issue-66667-function-cmp-cycle.stderr
@@ -15,8 +15,16 @@ LL | second == 1
= note: expected fn item `fn() {second}`
found type `{integer}`
+error[E0308]: mismatched types
+ --> $DIR/issue-66667-function-cmp-cycle.rs:2:5
+ |
+LL | fn first() {
+ | - help: try adding a return type: `-> bool`
+LL | second == 1
+ | ^^^^^^^^^^^ expected `()`, found `bool`
+
error[E0369]: binary operation `==` cannot be applied to type `fn() {first}`
- --> $DIR/issue-66667-function-cmp-cycle.rs:7:11
+ --> $DIR/issue-66667-function-cmp-cycle.rs:8:11
|
LL | first == 1
| ----- ^^ - {integer}
@@ -24,7 +32,7 @@ LL | first == 1
| fn() {first}
error[E0308]: mismatched types
- --> $DIR/issue-66667-function-cmp-cycle.rs:7:14
+ --> $DIR/issue-66667-function-cmp-cycle.rs:8:14
|
LL | first == 1
| ^ expected fn item, found integer
@@ -32,8 +40,16 @@ LL | first == 1
= note: expected fn item `fn() {first}`
found type `{integer}`
+error[E0308]: mismatched types
+ --> $DIR/issue-66667-function-cmp-cycle.rs:8:5
+ |
+LL | fn second() {
+ | - help: try adding a return type: `-> bool`
+LL | first == 1
+ | ^^^^^^^^^^ expected `()`, found `bool`
+
error[E0369]: binary operation `==` cannot be applied to type `fn() {bar}`
- --> $DIR/issue-66667-function-cmp-cycle.rs:12:9
+ --> $DIR/issue-66667-function-cmp-cycle.rs:14:9
|
LL | bar == 1
| --- ^^ - {integer}
@@ -41,7 +57,7 @@ LL | bar == 1
| fn() {bar}
error[E0308]: mismatched types
- --> $DIR/issue-66667-function-cmp-cycle.rs:12:12
+ --> $DIR/issue-66667-function-cmp-cycle.rs:14:12
|
LL | bar == 1
| ^ expected fn item, found integer
@@ -49,7 +65,15 @@ LL | bar == 1
= note: expected fn item `fn() {bar}`
found type `{integer}`
-error: aborting due to 6 previous errors
+error[E0308]: mismatched types
+ --> $DIR/issue-66667-function-cmp-cycle.rs:14:5
+ |
+LL | fn bar() {
+ | - help: try adding a return type: `-> bool`
+LL | bar == 1
+ | ^^^^^^^^ expected `()`, found `bool`
+
+error: aborting due to 9 previous errors
Some errors have detailed explanations: E0308, E0369.
For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/issues/issue-77919.stderr b/tests/ui/issues/issue-77919.stderr
index d154bfe0c..d6dcc8997 100644
--- a/tests/ui/issues/issue-77919.stderr
+++ b/tests/ui/issues/issue-77919.stderr
@@ -6,7 +6,7 @@ LL | _n: PhantomData,
|
help: consider importing this struct
|
-LL | use std::marker::PhantomData;
+LL + use std::marker::PhantomData;
|
error[E0412]: cannot find type `VAL` in this scope
diff --git a/tests/ui/issues/issue-9129.rs b/tests/ui/issues/issue-9129.rs
index 04110b3ae..5d623ed54 100644
--- a/tests/ui/issues/issue-9129.rs
+++ b/tests/ui/issues/issue-9129.rs
@@ -2,7 +2,6 @@
#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
-// ignore-pretty unreported
pub trait bomb { fn boom(&self, _: Ident); }
pub struct S;
diff --git a/tests/ui/issues/issue-98299.stderr b/tests/ui/issues/issue-98299.stderr
index fd905392a..4fd9f3030 100644
--- a/tests/ui/issues/issue-98299.stderr
+++ b/tests/ui/issues/issue-98299.stderr
@@ -4,7 +4,7 @@ error[E0282]: type annotations needed for `SmallCString<N>`
LL | SmallCString::try_from(p).map(|cstr| cstr);
| ^^^^
|
-help: consider giving this closure parameter an explicit type, where the the value of const parameter `N` is specified
+help: consider giving this closure parameter an explicit type, where the value of const parameter `N` is specified
|
LL | SmallCString::try_from(p).map(|cstr: SmallCString<N>| cstr);
| +++++++++++++++++
diff --git a/tests/ui/iterators/into-iter-on-arrays-lint.fixed b/tests/ui/iterators/into-iter-on-arrays-lint.fixed
index 6e02a7024..5b91aaf9e 100644
--- a/tests/ui/iterators/into-iter-on-arrays-lint.fixed
+++ b/tests/ui/iterators/into-iter-on-arrays-lint.fixed
@@ -2,7 +2,7 @@
// run-rustfix
// rustfix-only-machine-applicable
-#[allow(unused_must_use)]
+#[allow(unused_must_use, unused_allocation)]
fn main() {
let small = [1, 2];
let big = [0u8; 33];
diff --git a/tests/ui/iterators/into-iter-on-arrays-lint.rs b/tests/ui/iterators/into-iter-on-arrays-lint.rs
index 582d5cadd..25b0cef73 100644
--- a/tests/ui/iterators/into-iter-on-arrays-lint.rs
+++ b/tests/ui/iterators/into-iter-on-arrays-lint.rs
@@ -2,7 +2,7 @@
// run-rustfix
// rustfix-only-machine-applicable
-#[allow(unused_must_use)]
+#[allow(unused_must_use, unused_allocation)]
fn main() {
let small = [1, 2];
let big = [0u8; 33];
diff --git a/tests/ui/kindck/kindck-impl-type-params.stderr b/tests/ui/kindck/kindck-impl-type-params.stderr
index 6fd1fc3f7..efb25bf83 100644
--- a/tests/ui/kindck/kindck-impl-type-params.stderr
+++ b/tests/ui/kindck/kindck-impl-type-params.stderr
@@ -107,7 +107,8 @@ LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
= note: required for the cast from `S<Foo>` to the object type `dyn Gettable<Foo>`
help: consider annotating `Foo` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct Foo; // does not impl Copy
|
error: aborting due to 6 previous errors
diff --git a/tests/ui/lang-items/no_owned_box_lang_item.rs b/tests/ui/lang-items/no_owned_box_lang_item.rs
deleted file mode 100644
index c22b44ffc..000000000
--- a/tests/ui/lang-items/no_owned_box_lang_item.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test that we don't ICE when we are missing the owned_box lang item.
-
-// error-pattern: requires `owned_box` lang_item
-
-#![feature(lang_items, box_syntax)]
-#![no_std]
-
-use core::panic::PanicInfo;
-
-fn main() {
- let x = box 1i32;
-}
-
-#[lang = "eh_personality"] extern "C" fn eh_personality() {}
-#[lang = "eh_catch_typeinfo"] static EH_CATCH_TYPEINFO: u8 = 0;
-#[lang = "panic_impl"] fn panic_impl(panic: &PanicInfo) -> ! { loop {} }
diff --git a/tests/ui/lang-items/no_owned_box_lang_item.stderr b/tests/ui/lang-items/no_owned_box_lang_item.stderr
deleted file mode 100644
index c55c246b5..000000000
--- a/tests/ui/lang-items/no_owned_box_lang_item.stderr
+++ /dev/null
@@ -1,4 +0,0 @@
-error: requires `owned_box` lang_item
-
-error: aborting due to previous error
-
diff --git a/tests/ui/late-bound-lifetimes/issue-80618.rs b/tests/ui/late-bound-lifetimes/issue-80618.rs
new file mode 100644
index 000000000..6aa8ff461
--- /dev/null
+++ b/tests/ui/late-bound-lifetimes/issue-80618.rs
@@ -0,0 +1,8 @@
+fn foo<'a>(x: &'a str) -> &'a str {
+ x
+}
+
+fn main() {
+ let _ = foo::<'static>;
+//~^ ERROR cannot specify lifetime arguments explicitly if late bound lifetime parameters are present [E0794]
+}
diff --git a/tests/ui/late-bound-lifetimes/issue-80618.stderr b/tests/ui/late-bound-lifetimes/issue-80618.stderr
new file mode 100644
index 000000000..cf7423fc1
--- /dev/null
+++ b/tests/ui/late-bound-lifetimes/issue-80618.stderr
@@ -0,0 +1,15 @@
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+ --> $DIR/issue-80618.rs:6:19
+ |
+LL | let _ = foo::<'static>;
+ | ^^^^^^^
+ |
+note: the late bound lifetime parameter is introduced here
+ --> $DIR/issue-80618.rs:1:8
+ |
+LL | fn foo<'a>(x: &'a str) -> &'a str {
+ | ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0794`.
diff --git a/tests/ui/layout/issue-84108.stderr b/tests/ui/layout/issue-84108.stderr
index 36be64241..5ad450bed 100644
--- a/tests/ui/layout/issue-84108.stderr
+++ b/tests/ui/layout/issue-84108.stderr
@@ -6,7 +6,7 @@ LL | static FOO: (dyn AsRef<OsStr>, u8) = ("hello", 42);
|
help: consider importing this struct
|
-LL | use std::ffi::OsStr;
+LL + use std::ffi::OsStr;
|
error[E0412]: cannot find type `Path` in this scope
@@ -17,7 +17,7 @@ LL | const BAR: (&Path, [u8], usize) = ("hello", [], 42);
|
help: consider importing this struct
|
-LL | use std::path::Path;
+LL + use std::path::Path;
|
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
diff --git a/tests/ui/layout/transmute-to-tail-with-err.rs b/tests/ui/layout/transmute-to-tail-with-err.rs
new file mode 100644
index 000000000..6753ce15e
--- /dev/null
+++ b/tests/ui/layout/transmute-to-tail-with-err.rs
@@ -0,0 +1,8 @@
+trait Trait<T> {}
+
+struct Bar(Box<dyn Trait<T>>);
+//~^ ERROR cannot find type `T` in this scope
+
+fn main() {
+ let x: Bar = unsafe { std::mem::transmute(()) };
+}
diff --git a/tests/ui/layout/transmute-to-tail-with-err.stderr b/tests/ui/layout/transmute-to-tail-with-err.stderr
new file mode 100644
index 000000000..97ab59c39
--- /dev/null
+++ b/tests/ui/layout/transmute-to-tail-with-err.stderr
@@ -0,0 +1,14 @@
+error[E0412]: cannot find type `T` in this scope
+ --> $DIR/transmute-to-tail-with-err.rs:3:26
+ |
+LL | struct Bar(Box<dyn Trait<T>>);
+ | ^ not found in this scope
+ |
+help: you might be missing a type parameter
+ |
+LL | struct Bar<T>(Box<dyn Trait<T>>);
+ | +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs b/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs
index 802be7f5a..9ba01540a 100644
--- a/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs
+++ b/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs
@@ -6,7 +6,6 @@
// N.B., this file needs CRLF line endings. The .gitattributes file in
// this directory should enforce it.
-// ignore-pretty issue #37195
/// Doc comment that ends in CRLF
pub fn foo() {}
diff --git a/tests/ui/unterminated-comment.rs b/tests/ui/lexer/unterminated-comment.rs
index 1cfdfb1fb..1cfdfb1fb 100644
--- a/tests/ui/unterminated-comment.rs
+++ b/tests/ui/lexer/unterminated-comment.rs
diff --git a/tests/ui/unterminated-comment.stderr b/tests/ui/lexer/unterminated-comment.stderr
index c513fafee..c513fafee 100644
--- a/tests/ui/unterminated-comment.stderr
+++ b/tests/ui/lexer/unterminated-comment.stderr
diff --git a/tests/ui/unterminated-nested-comment.rs b/tests/ui/lexer/unterminated-nested-comment.rs
index db5f2f3ba..db5f2f3ba 100644
--- a/tests/ui/unterminated-nested-comment.rs
+++ b/tests/ui/lexer/unterminated-nested-comment.rs
diff --git a/tests/ui/unterminated-nested-comment.stderr b/tests/ui/lexer/unterminated-nested-comment.stderr
index 3653e76c9..3653e76c9 100644
--- a/tests/ui/unterminated-nested-comment.stderr
+++ b/tests/ui/lexer/unterminated-nested-comment.stderr
diff --git a/tests/ui/lifetimes/issue-93911.rs b/tests/ui/lifetimes/issue-93911.rs
new file mode 100644
index 000000000..b7ccac1ee
--- /dev/null
+++ b/tests/ui/lifetimes/issue-93911.rs
@@ -0,0 +1,18 @@
+// check-pass
+// edition:2021
+
+#![allow(dead_code)]
+
+struct Foo<'a>(&'a u32);
+
+impl<'a> Foo<'a> {
+ async fn foo() {
+ struct Bar<'b>(&'b u32);
+
+ impl<'b> Bar<'b> {
+ async fn bar() {}
+ }
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/lifetimes/issue-95023.stderr b/tests/ui/lifetimes/issue-95023.stderr
index 35c3797c7..5b93eff86 100644
--- a/tests/ui/lifetimes/issue-95023.stderr
+++ b/tests/ui/lifetimes/issue-95023.stderr
@@ -25,6 +25,12 @@ error[E0229]: associated type bindings are not allowed here
|
LL | impl Fn(&isize) for Error {
| ^^^^^^^^^^ associated type not allowed here
+ |
+help: parenthesized trait syntax expands to `Fn<(&isize,), Output=()>`
+ --> $DIR/issue-95023.rs:3:6
+ |
+LL | impl Fn(&isize) for Error {
+ | ^^^^^^^^^^
error[E0220]: associated type `B` not found for `Self`
--> $DIR/issue-95023.rs:6:44
diff --git a/tests/ui/lifetimes/unusual-rib-combinations.rs b/tests/ui/lifetimes/unusual-rib-combinations.rs
index 1c122f42e..0ae68ad04 100644
--- a/tests/ui/lifetimes/unusual-rib-combinations.rs
+++ b/tests/ui/lifetimes/unusual-rib-combinations.rs
@@ -25,4 +25,9 @@ fn d<const C: S>() {}
//~^ ERROR missing lifetime specifier
//~| ERROR `S<'_>` is forbidden as the type of a const generic parameter
+trait Foo<'a> {}
+struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
+//~^ ERROR use of non-static lifetime `'a` in const generic
+//~| ERROR `&dyn for<'a> Foo<'a>` is forbidden as the type of a const generic parameter
+
fn main() {}
diff --git a/tests/ui/lifetimes/unusual-rib-combinations.stderr b/tests/ui/lifetimes/unusual-rib-combinations.stderr
index 68f4fce01..20163d289 100644
--- a/tests/ui/lifetimes/unusual-rib-combinations.stderr
+++ b/tests/ui/lifetimes/unusual-rib-combinations.stderr
@@ -9,6 +9,14 @@ help: consider introducing a named lifetime parameter
LL | fn d<'a, const C: S<'a>>() {}
| +++ ++++
+error[E0771]: use of non-static lifetime `'a` in const generic
+ --> $DIR/unusual-rib-combinations.rs:29:22
+ |
+LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
+ | ^^
+ |
+ = note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
+
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/unusual-rib-combinations.rs:7:16
|
@@ -55,7 +63,16 @@ LL | fn d<const C: S>() {}
= note: the only supported types are integers, `bool` and `char`
= help: more complex types are supported with `#![feature(adt_const_params)]`
-error: aborting due to 7 previous errors
+error: `&dyn for<'a> Foo<'a>` is forbidden as the type of a const generic parameter
+ --> $DIR/unusual-rib-combinations.rs:29:21
+ |
+LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the only supported types are integers, `bool` and `char`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
+
+error: aborting due to 9 previous errors
-Some errors have detailed explanations: E0106, E0214, E0308.
+Some errors have detailed explanations: E0106, E0214, E0308, E0771.
For more information about an error, try `rustc --explain E0106`.
diff --git a/tests/ui/limits/issue-55878.stderr b/tests/ui/limits/issue-55878.stderr
index 99f1fdf75..510b36edd 100644
--- a/tests/ui/limits/issue-55878.stderr
+++ b/tests/ui/limits/issue-55878.stderr
@@ -25,14 +25,6 @@ LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
|
= note: this note 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)
-note: erroneous constant used
- --> $DIR/issue-55878.rs:7:26
- |
-LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: this note 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 previous error
For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/linkage-attr/issue-109144.rs b/tests/ui/linkage-attr/issue-109144.rs
new file mode 100644
index 000000000..2f740e553
--- /dev/null
+++ b/tests/ui/linkage-attr/issue-109144.rs
@@ -0,0 +1,4 @@
+#![crate_type = "lib"]
+#[link(kind = "static", modifiers = "+whole-archive,+bundle")]
+//~^ ERROR `#[link]` attribute requires a `name = "string"` argument
+extern {}
diff --git a/tests/ui/linkage-attr/issue-109144.stderr b/tests/ui/linkage-attr/issue-109144.stderr
new file mode 100644
index 000000000..33187cfdb
--- /dev/null
+++ b/tests/ui/linkage-attr/issue-109144.stderr
@@ -0,0 +1,9 @@
+error[E0459]: `#[link]` attribute requires a `name = "string"` argument
+ --> $DIR/issue-109144.rs:2:1
+ |
+LL | #[link(kind = "static", modifiers = "+whole-archive,+bundle")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `name` argument
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0459`.
diff --git a/tests/ui/lint/anonymous-reexport.rs b/tests/ui/lint/anonymous-reexport.rs
new file mode 100644
index 000000000..11ac5d071
--- /dev/null
+++ b/tests/ui/lint/anonymous-reexport.rs
@@ -0,0 +1,19 @@
+#![deny(unused_imports)]
+#![crate_type = "rlib"]
+
+mod my_mod {
+ pub trait Foo {}
+ pub type TyFoo = dyn Foo;
+ pub struct Bar;
+ pub type TyBar = Bar;
+}
+
+pub use self::my_mod::Foo as _;
+pub use self::my_mod::TyFoo as _; //~ ERROR unused import
+pub use self::my_mod::Bar as _; //~ ERROR unused import
+pub use self::my_mod::TyBar as _; //~ ERROR unused import
+pub use self::my_mod::{Bar as _}; //~ ERROR unused import
+pub use self::my_mod::{Bar as _, Foo as _}; //~ ERROR unused import
+pub use self::my_mod::{Bar as _, TyBar as _}; //~ ERROR unused imports
+#[allow(unused_imports)]
+use self::my_mod::TyBar as _;
diff --git a/tests/ui/lint/anonymous-reexport.stderr b/tests/ui/lint/anonymous-reexport.stderr
new file mode 100644
index 000000000..e3854a545
--- /dev/null
+++ b/tests/ui/lint/anonymous-reexport.stderr
@@ -0,0 +1,44 @@
+error: unused import: `self::my_mod::TyFoo as _`
+ --> $DIR/anonymous-reexport.rs:12:9
+ |
+LL | pub use self::my_mod::TyFoo as _;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/anonymous-reexport.rs:1:9
+ |
+LL | #![deny(unused_imports)]
+ | ^^^^^^^^^^^^^^
+
+error: unused import: `self::my_mod::Bar as _`
+ --> $DIR/anonymous-reexport.rs:13:9
+ |
+LL | pub use self::my_mod::Bar as _;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: unused import: `self::my_mod::TyBar as _`
+ --> $DIR/anonymous-reexport.rs:14:9
+ |
+LL | pub use self::my_mod::TyBar as _;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: unused import: `Bar as _`
+ --> $DIR/anonymous-reexport.rs:15:24
+ |
+LL | pub use self::my_mod::{Bar as _};
+ | ^^^^^^^^
+
+error: unused import: `Bar as _`
+ --> $DIR/anonymous-reexport.rs:16:24
+ |
+LL | pub use self::my_mod::{Bar as _, Foo as _};
+ | ^^^^^^^^
+
+error: unused imports: `Bar as _`, `TyBar as _`
+ --> $DIR/anonymous-reexport.rs:17:24
+ |
+LL | pub use self::my_mod::{Bar as _, TyBar as _};
+ | ^^^^^^^^ ^^^^^^^^^^
+
+error: aborting due to 6 previous errors
+
diff --git a/tests/ui/lint/clashing-extern-fn.rs b/tests/ui/lint/clashing-extern-fn.rs
index 809e06026..09fda33db 100644
--- a/tests/ui/lint/clashing-extern-fn.rs
+++ b/tests/ui/lint/clashing-extern-fn.rs
@@ -122,8 +122,8 @@ mod banana {
weight: u32,
length: u16,
} // note: distinct type
- // This should not trigger the lint because two::Banana is structurally equivalent to
- // one::Banana.
+ // This should not trigger the lint because two::Banana is structurally equivalent to
+ // one::Banana.
extern "C" {
fn weigh_banana(count: *const Banana) -> u64;
}
@@ -223,6 +223,27 @@ mod transparent {
}
}
+#[allow(improper_ctypes)]
+mod zst {
+ mod transparent {
+ #[repr(transparent)]
+ struct TransparentZst(());
+ extern "C" {
+ fn zst() -> ();
+ fn transparent_zst() -> TransparentZst;
+ }
+ }
+
+ mod not_transparent {
+ struct NotTransparentZst(());
+ extern "C" {
+ // These shouldn't warn since all return types are zero sized
+ fn zst() -> NotTransparentZst;
+ fn transparent_zst() -> NotTransparentZst;
+ }
+ }
+}
+
mod missing_return_type {
mod a {
extern "C" {
@@ -397,10 +418,14 @@ mod hidden_niche {
use std::num::NonZeroUsize;
#[repr(transparent)]
- struct Transparent { x: NonZeroUsize }
+ struct Transparent {
+ x: NonZeroUsize,
+ }
#[repr(transparent)]
- struct TransparentNoNiche { y: UnsafeCell<NonZeroUsize> }
+ struct TransparentNoNiche {
+ y: UnsafeCell<NonZeroUsize>,
+ }
extern "C" {
fn hidden_niche_transparent() -> Option<Transparent>;
diff --git a/tests/ui/lint/clashing-extern-fn.stderr b/tests/ui/lint/clashing-extern-fn.stderr
index 217eed6c9..5d457ba0e 100644
--- a/tests/ui/lint/clashing-extern-fn.stderr
+++ b/tests/ui/lint/clashing-extern-fn.stderr
@@ -130,7 +130,7 @@ LL | fn transparent_incorrect() -> isize;
found `unsafe extern "C" fn() -> isize`
warning: `missing_return_type` redeclared with a different signature
- --> $DIR/clashing-extern-fn.rs:238:13
+ --> $DIR/clashing-extern-fn.rs:259:13
|
LL | fn missing_return_type() -> usize;
| ---------------------------------- `missing_return_type` previously declared here
@@ -142,7 +142,7 @@ LL | fn missing_return_type();
found `unsafe extern "C" fn()`
warning: `non_zero_usize` redeclared with a different signature
- --> $DIR/clashing-extern-fn.rs:256:13
+ --> $DIR/clashing-extern-fn.rs:277:13
|
LL | fn non_zero_usize() -> core::num::NonZeroUsize;
| ----------------------------------------------- `non_zero_usize` previously declared here
@@ -154,7 +154,7 @@ LL | fn non_zero_usize() -> usize;
found `unsafe extern "C" fn() -> usize`
warning: `non_null_ptr` redeclared with a different signature
- --> $DIR/clashing-extern-fn.rs:258:13
+ --> $DIR/clashing-extern-fn.rs:279:13
|
LL | fn non_null_ptr() -> core::ptr::NonNull<usize>;
| ----------------------------------------------- `non_null_ptr` previously declared here
@@ -166,7 +166,7 @@ LL | fn non_null_ptr() -> *const usize;
found `unsafe extern "C" fn() -> *const usize`
warning: `option_non_zero_usize_incorrect` redeclared with a different signature
- --> $DIR/clashing-extern-fn.rs:356:13
+ --> $DIR/clashing-extern-fn.rs:377:13
|
LL | fn option_non_zero_usize_incorrect() -> usize;
| ---------------------------------------------- `option_non_zero_usize_incorrect` previously declared here
@@ -178,7 +178,7 @@ LL | fn option_non_zero_usize_incorrect() -> isize;
found `unsafe extern "C" fn() -> isize`
warning: `option_non_null_ptr_incorrect` redeclared with a different signature
- --> $DIR/clashing-extern-fn.rs:358:13
+ --> $DIR/clashing-extern-fn.rs:379:13
|
LL | fn option_non_null_ptr_incorrect() -> *const usize;
| --------------------------------------------------- `option_non_null_ptr_incorrect` previously declared here
@@ -190,7 +190,7 @@ LL | fn option_non_null_ptr_incorrect() -> *const isize;
found `unsafe extern "C" fn() -> *const isize`
warning: `hidden_niche_transparent_no_niche` redeclared with a different signature
- --> $DIR/clashing-extern-fn.rs:408:13
+ --> $DIR/clashing-extern-fn.rs:433:13
|
LL | fn hidden_niche_transparent_no_niche() -> usize;
| ------------------------------------------------ `hidden_niche_transparent_no_niche` previously declared here
@@ -202,7 +202,7 @@ LL | fn hidden_niche_transparent_no_niche() -> Option<TransparentNoN
found `unsafe extern "C" fn() -> Option<TransparentNoNiche>`
warning: `hidden_niche_unsafe_cell` redeclared with a different signature
- --> $DIR/clashing-extern-fn.rs:412:13
+ --> $DIR/clashing-extern-fn.rs:437:13
|
LL | fn hidden_niche_unsafe_cell() -> usize;
| --------------------------------------- `hidden_niche_unsafe_cell` previously declared here
@@ -214,7 +214,7 @@ LL | fn hidden_niche_unsafe_cell() -> Option<UnsafeCell<NonZeroUsize
found `unsafe extern "C" fn() -> Option<UnsafeCell<NonZeroUsize>>`
warning: `extern` block uses type `Option<TransparentNoNiche>`, which is not FFI-safe
- --> $DIR/clashing-extern-fn.rs:408:55
+ --> $DIR/clashing-extern-fn.rs:433:55
|
LL | fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -224,7 +224,7 @@ LL | fn hidden_niche_transparent_no_niche() -> Option<TransparentNoN
= note: `#[warn(improper_ctypes)]` on by default
warning: `extern` block uses type `Option<UnsafeCell<NonZeroUsize>>`, which is not FFI-safe
- --> $DIR/clashing-extern-fn.rs:412:46
+ --> $DIR/clashing-extern-fn.rs:437:46
|
LL | fn hidden_niche_unsafe_cell() -> Option<UnsafeCell<NonZeroUsize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
diff --git a/tests/ui/lint/dead-code/issue-59003.rs b/tests/ui/lint/dead-code/issue-59003.rs
new file mode 100644
index 000000000..966d64128
--- /dev/null
+++ b/tests/ui/lint/dead-code/issue-59003.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+// Make sure we don't have any false positives about the "struct is never constructed" lint.
+
+#![deny(dead_code)]
+
+struct Foo {
+ #[allow(dead_code)]
+ inner: u32,
+}
+
+impl From<u32> for Foo {
+ fn from(inner: u32) -> Self {
+ Self { inner }
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/lint/dead-code/issue-85255.rs b/tests/ui/lint/dead-code/issue-85255.rs
index 1978bd4e8..d75a8e2dd 100644
--- a/tests/ui/lint/dead-code/issue-85255.rs
+++ b/tests/ui/lint/dead-code/issue-85255.rs
@@ -11,8 +11,8 @@ struct Foo {
struct Bar;
impl Bar {
- fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
- pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
+ fn a(&self) -> i32 { 5 } //~ WARNING: methods `a` and `b` are never used [dead_code]
+ pub fn b(&self) -> i32 { 6 }
}
pub(crate) struct Foo1 {
@@ -23,8 +23,8 @@ pub(crate) struct Foo1 {
pub(crate) struct Bar1;
impl Bar1 {
- fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
- pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
+ fn a(&self) -> i32 { 5 } //~ WARNING: methods `a` and `b` are never used [dead_code]
+ pub fn b(&self) -> i32 { 6 }
}
pub(crate) struct Foo2 {
@@ -35,8 +35,8 @@ pub(crate) struct Foo2 {
pub(crate) struct Bar2;
impl Bar2 {
- fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
- pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
+ fn a(&self) -> i32 { 5 } //~ WARNING: methods `a` and `b` are never used [dead_code]
+ pub fn b(&self) -> i32 { 6 }
}
diff --git a/tests/ui/lint/dead-code/issue-85255.stderr b/tests/ui/lint/dead-code/issue-85255.stderr
index 58a19cf3c..d981085a4 100644
--- a/tests/ui/lint/dead-code/issue-85255.stderr
+++ b/tests/ui/lint/dead-code/issue-85255.stderr
@@ -14,6 +14,16 @@ note: the lint level is defined here
LL | #![warn(dead_code)]
| ^^^^^^^^^
+warning: methods `a` and `b` are never used
+ --> $DIR/issue-85255.rs:14:8
+ |
+LL | impl Bar {
+ | -------- methods in this implementation
+LL | fn a(&self) -> i32 { 5 }
+ | ^
+LL | pub fn b(&self) -> i32 { 6 }
+ | ^
+
warning: fields `a` and `b` are never read
--> $DIR/issue-85255.rs:19:5
|
@@ -24,6 +34,16 @@ LL | a: i32,
LL | pub b: i32,
| ^
+warning: methods `a` and `b` are never used
+ --> $DIR/issue-85255.rs:26:8
+ |
+LL | impl Bar1 {
+ | --------- methods in this implementation
+LL | fn a(&self) -> i32 { 5 }
+ | ^
+LL | pub fn b(&self) -> i32 { 6 }
+ | ^
+
warning: fields `a` and `b` are never read
--> $DIR/issue-85255.rs:31:5
|
@@ -34,41 +54,15 @@ LL | a: i32,
LL | pub b: i32,
| ^
-warning: method `a` is never used
- --> $DIR/issue-85255.rs:14:8
- |
-LL | fn a(&self) -> i32 { 5 }
- | ^
-
-warning: method `b` is never used
- --> $DIR/issue-85255.rs:15:12
- |
-LL | pub fn b(&self) -> i32 { 6 }
- | ^
-
-warning: method `a` is never used
- --> $DIR/issue-85255.rs:26:8
- |
-LL | fn a(&self) -> i32 { 5 }
- | ^
-
-warning: method `b` is never used
- --> $DIR/issue-85255.rs:27:12
- |
-LL | pub fn b(&self) -> i32 { 6 }
- | ^
-
-warning: method `a` is never used
+warning: methods `a` and `b` are never used
--> $DIR/issue-85255.rs:38:8
|
+LL | impl Bar2 {
+ | --------- methods in this implementation
LL | fn a(&self) -> i32 { 5 }
| ^
-
-warning: method `b` is never used
- --> $DIR/issue-85255.rs:39:12
- |
LL | pub fn b(&self) -> i32 { 6 }
| ^
-warning: 9 warnings emitted
+warning: 6 warnings emitted
diff --git a/tests/ui/lint/dead-code/lint-dead-code-3.stderr b/tests/ui/lint/dead-code/lint-dead-code-3.stderr
index 797b7559c..5c68cf0e1 100644
--- a/tests/ui/lint/dead-code/lint-dead-code-3.stderr
+++ b/tests/ui/lint/dead-code/lint-dead-code-3.stderr
@@ -10,6 +10,14 @@ note: the lint level is defined here
LL | #![deny(dead_code)]
| ^^^^^^^^^
+error: method `foo` is never used
+ --> $DIR/lint-dead-code-3.rs:16:8
+ |
+LL | impl Foo {
+ | -------- method in this implementation
+LL | fn foo(&self) {
+ | ^^^
+
error: function `bar` is never used
--> $DIR/lint-dead-code-3.rs:21:4
|
@@ -34,12 +42,6 @@ error: function `blah` is never used
LL | fn blah() {}
| ^^^^
-error: method `foo` is never used
- --> $DIR/lint-dead-code-3.rs:16:8
- |
-LL | fn foo(&self) {
- | ^^^
-
error: function `free` is never used
--> $DIR/lint-dead-code-3.rs:62:8
|
diff --git a/tests/ui/lint/dead-code/lint-dead-code-6.rs b/tests/ui/lint/dead-code/lint-dead-code-6.rs
index e3074acf1..5b2b76b76 100644
--- a/tests/ui/lint/dead-code/lint-dead-code-6.rs
+++ b/tests/ui/lint/dead-code/lint-dead-code-6.rs
@@ -2,17 +2,16 @@
struct UnusedStruct; //~ ERROR struct `UnusedStruct` is never constructed
impl UnusedStruct {
- fn unused_impl_fn_1() { //~ ERROR associated function `unused_impl_fn_1` is never used
+ fn unused_impl_fn_1() {
+ //~^ ERROR associated functions `unused_impl_fn_1`, `unused_impl_fn_2`, and `unused_impl_fn_3` are never used [dead_code]
println!("blah");
}
- fn unused_impl_fn_2(var: i32) { //~ ERROR associated function `unused_impl_fn_2` is never used
+ fn unused_impl_fn_2(var: i32) {
println!("foo {}", var);
}
- fn unused_impl_fn_3( //~ ERROR associated function `unused_impl_fn_3` is never used
- var: i32,
- ) {
+ fn unused_impl_fn_3(var: i32) {
println!("bar {}", var);
}
}
diff --git a/tests/ui/lint/dead-code/lint-dead-code-6.stderr b/tests/ui/lint/dead-code/lint-dead-code-6.stderr
index f9d83308a..ce4110086 100644
--- a/tests/ui/lint/dead-code/lint-dead-code-6.stderr
+++ b/tests/ui/lint/dead-code/lint-dead-code-6.stderr
@@ -10,23 +10,19 @@ note: the lint level is defined here
LL | #![deny(dead_code)]
| ^^^^^^^^^
-error: associated function `unused_impl_fn_1` is never used
+error: associated functions `unused_impl_fn_1`, `unused_impl_fn_2`, and `unused_impl_fn_3` are never used
--> $DIR/lint-dead-code-6.rs:5:8
|
+LL | impl UnusedStruct {
+ | ----------------- associated functions in this implementation
LL | fn unused_impl_fn_1() {
| ^^^^^^^^^^^^^^^^
-
-error: associated function `unused_impl_fn_2` is never used
- --> $DIR/lint-dead-code-6.rs:9:8
- |
+...
LL | fn unused_impl_fn_2(var: i32) {
| ^^^^^^^^^^^^^^^^
-
-error: associated function `unused_impl_fn_3` is never used
- --> $DIR/lint-dead-code-6.rs:13:8
- |
-LL | fn unused_impl_fn_3(
+...
+LL | fn unused_impl_fn_3(var: i32) {
| ^^^^^^^^^^^^^^^^
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
diff --git a/tests/ui/lint/dead-code/unused-assoc-fns.rs b/tests/ui/lint/dead-code/unused-assoc-fns.rs
new file mode 100644
index 000000000..b111f4b94
--- /dev/null
+++ b/tests/ui/lint/dead-code/unused-assoc-fns.rs
@@ -0,0 +1,35 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+#![deny(unused)]
+
+struct Foo;
+
+impl Foo {
+ fn one() {}
+ //~^ ERROR associated items `one`, `two`, `CONSTANT`, `Type`, and `three` are never used [dead_code]
+
+ fn two(&self) {}
+
+ // seperation between items
+ // ...
+ // ...
+
+ fn used() {}
+
+ const CONSTANT: usize = 5;
+
+ // more seperation
+ // ...
+ // ...
+
+ type Type = usize;
+
+ fn three(&self) {
+ Foo::one();
+ // ...
+ }
+}
+
+fn main() {
+ Foo::used();
+}
diff --git a/tests/ui/lint/dead-code/unused-assoc-fns.stderr b/tests/ui/lint/dead-code/unused-assoc-fns.stderr
new file mode 100644
index 000000000..6344a70ea
--- /dev/null
+++ b/tests/ui/lint/dead-code/unused-assoc-fns.stderr
@@ -0,0 +1,29 @@
+error: associated items `one`, `two`, `CONSTANT`, `Type`, and `three` are never used
+ --> $DIR/unused-assoc-fns.rs:8:8
+ |
+LL | impl Foo {
+ | -------- associated items in this implementation
+LL | fn one() {}
+ | ^^^
+...
+LL | fn two(&self) {}
+ | ^^^
+...
+LL | const CONSTANT: usize = 5;
+ | ^^^^^^^^
+...
+LL | type Type = usize;
+ | ^^^^
+LL |
+LL | fn three(&self) {
+ | ^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/unused-assoc-fns.rs:3:9
+ |
+LL | #![deny(unused)]
+ | ^^^^^^
+ = note: `#[deny(dead_code)]` implied by `#[deny(unused)]`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/fn_must_use.stderr b/tests/ui/lint/fn_must_use.stderr
index 657f23c60..e88c1a9b8 100644
--- a/tests/ui/lint/fn_must_use.stderr
+++ b/tests/ui/lint/fn_must_use.stderr
@@ -10,12 +10,21 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = need_to_use_this_value();
+ | +++++++
warning: unused return value of `MyStruct::need_to_use_this_method_value` that must be used
--> $DIR/fn_must_use.rs:60:5
|
LL | m.need_to_use_this_method_value();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = m.need_to_use_this_method_value();
+ | +++++++
warning: unused return value of `EvenNature::is_even` that must be used
--> $DIR/fn_must_use.rs:61:5
@@ -24,24 +33,43 @@ LL | m.is_even(); // trait method!
| ^^^^^^^^^^^
|
= note: no side effects
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = m.is_even(); // trait method!
+ | +++++++
warning: unused return value of `MyStruct::need_to_use_this_associated_function_value` that must be used
--> $DIR/fn_must_use.rs:64:5
|
LL | MyStruct::need_to_use_this_associated_function_value();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = MyStruct::need_to_use_this_associated_function_value();
+ | +++++++
warning: unused return value of `std::cmp::PartialEq::eq` that must be used
--> $DIR/fn_must_use.rs:70:5
|
LL | 2.eq(&3);
| ^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 2.eq(&3);
+ | +++++++
warning: unused return value of `std::cmp::PartialEq::eq` that must be used
--> $DIR/fn_must_use.rs:71:5
|
LL | m.eq(&n);
| ^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = m.eq(&n);
+ | +++++++
warning: unused comparison that must be used
--> $DIR/fn_must_use.rs:74:5
diff --git a/tests/ui/lint/inline-trait-and-foreign-items.rs b/tests/ui/lint/inline-trait-and-foreign-items.rs
index 13dab7ed9..39bc01f71 100644
--- a/tests/ui/lint/inline-trait-and-foreign-items.rs
+++ b/tests/ui/lint/inline-trait-and-foreign-items.rs
@@ -1,5 +1,5 @@
#![feature(extern_types)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
#![warn(unused_attributes)]
diff --git a/tests/ui/lint/issue-109152.rs b/tests/ui/lint/issue-109152.rs
new file mode 100644
index 000000000..daf530e6d
--- /dev/null
+++ b/tests/ui/lint/issue-109152.rs
@@ -0,0 +1,7 @@
+#![deny(map_unit_fn)]
+
+#![crate_type = "lib"]
+fn _y() {
+ vec![42].iter().map(drop);
+ //~^ ERROR `Iterator::map` call that discard the iterator's values
+}
diff --git a/tests/ui/lint/issue-109152.stderr b/tests/ui/lint/issue-109152.stderr
new file mode 100644
index 000000000..7db9e71a5
--- /dev/null
+++ b/tests/ui/lint/issue-109152.stderr
@@ -0,0 +1,23 @@
+error: `Iterator::map` call that discard the iterator's values
+ --> $DIR/issue-109152.rs:5:21
+ |
+LL | vec![42].iter().map(drop);
+ | ^^^^----^
+ | | |
+ | | this function returns `()`, which is likely not what you wanted
+ | | called `Iterator::map` with callable that returns `()`
+ | after this call to map, the resulting iterator is `impl Iterator<Item = ()>`, which means the only information carried by the iterator is the number of items
+ |
+ = note: `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated
+note: the lint level is defined here
+ --> $DIR/issue-109152.rs:1:9
+ |
+LL | #![deny(map_unit_fn)]
+ | ^^^^^^^^^^^
+help: you might have meant to use `Iterator::for_each`
+ |
+LL | vec![42].iter().for_each(drop);
+ | ~~~~~~~~
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/issue-109529.fixed b/tests/ui/lint/issue-109529.fixed
new file mode 100644
index 000000000..5ad489073
--- /dev/null
+++ b/tests/ui/lint/issue-109529.fixed
@@ -0,0 +1,6 @@
+// run-rustfix
+
+fn main() {
+ for _ in 0..=255 as u8 {} //~ ERROR range endpoint is out of range
+ for _ in 0..=(255 as u8) {} //~ ERROR range endpoint is out of range
+}
diff --git a/tests/ui/lint/issue-109529.rs b/tests/ui/lint/issue-109529.rs
new file mode 100644
index 000000000..383d7bc4c
--- /dev/null
+++ b/tests/ui/lint/issue-109529.rs
@@ -0,0 +1,6 @@
+// run-rustfix
+
+fn main() {
+ for _ in 0..256 as u8 {} //~ ERROR range endpoint is out of range
+ for _ in 0..(256 as u8) {} //~ ERROR range endpoint is out of range
+}
diff --git a/tests/ui/lint/issue-109529.stderr b/tests/ui/lint/issue-109529.stderr
new file mode 100644
index 000000000..9e857d1b0
--- /dev/null
+++ b/tests/ui/lint/issue-109529.stderr
@@ -0,0 +1,23 @@
+error: range endpoint is out of range for `u8`
+ --> $DIR/issue-109529.rs:4:14
+ |
+LL | for _ in 0..256 as u8 {}
+ | ------^^^^^^
+ | |
+ | help: use an inclusive range instead: `0..=255`
+ |
+ = note: `#[deny(overflowing_literals)]` on by default
+
+error: range endpoint is out of range for `u8`
+ --> $DIR/issue-109529.rs:5:14
+ |
+LL | for _ in 0..(256 as u8) {}
+ | ^^^^^^^^^^^^^^
+ |
+help: use an inclusive range instead
+ |
+LL | for _ in 0..=(255 as u8) {}
+ | + ~~~
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/lint-temporary-cstring-as-ptr.rs b/tests/ui/lint/lint-temporary-cstring-as-ptr.rs
index 7aa4f2e1e..fab792f12 100644
--- a/tests/ui/lint/lint-temporary-cstring-as-ptr.rs
+++ b/tests/ui/lint/lint-temporary-cstring-as-ptr.rs
@@ -3,7 +3,15 @@
use std::ffi::CString;
+macro_rules! mymacro {
+ () => {
+ let s = CString::new("some text").unwrap().as_ptr();
+ //~^ ERROR getting the inner pointer of a temporary `CString`
+ }
+}
+
fn main() {
let s = CString::new("some text").unwrap().as_ptr();
//~^ ERROR getting the inner pointer of a temporary `CString`
+ mymacro!();
}
diff --git a/tests/ui/lint/lint-temporary-cstring-as-ptr.stderr b/tests/ui/lint/lint-temporary-cstring-as-ptr.stderr
index 79ef57dd1..4e5c8aa06 100644
--- a/tests/ui/lint/lint-temporary-cstring-as-ptr.stderr
+++ b/tests/ui/lint/lint-temporary-cstring-as-ptr.stderr
@@ -1,5 +1,5 @@
error: getting the inner pointer of a temporary `CString`
- --> $DIR/lint-temporary-cstring-as-ptr.rs:7:48
+ --> $DIR/lint-temporary-cstring-as-ptr.rs:14:48
|
LL | let s = CString::new("some text").unwrap().as_ptr();
| ---------------------------------- ^^^^^^ this pointer will be invalid
@@ -14,5 +14,20 @@ note: the lint level is defined here
LL | #![deny(temporary_cstring_as_ptr)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: getting the inner pointer of a temporary `CString`
+ --> $DIR/lint-temporary-cstring-as-ptr.rs:8:52
+ |
+LL | let s = CString::new("some text").unwrap().as_ptr();
+ | ---------------------------------- ^^^^^^ this pointer will be invalid
+ | |
+ | this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
+...
+LL | mymacro!();
+ | ---------- in this macro invocation
+ |
+ = note: pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
+ = help: for more information, see https://doc.rust-lang.org/reference/destructors.html
+ = note: this error originates in the macro `mymacro` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
diff --git a/tests/ui/lint/no-coverage.rs b/tests/ui/lint/no-coverage.rs
index ff24c12b2..07906a434 100644
--- a/tests/ui/lint/no-coverage.rs
+++ b/tests/ui/lint/no-coverage.rs
@@ -1,6 +1,6 @@
#![feature(extern_types)]
#![feature(no_coverage)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
#![warn(unused_attributes)]
#![no_coverage]
//~^ WARN: `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
diff --git a/tests/ui/lint/unconditional_panic_98444.rs b/tests/ui/lint/unconditional_panic_98444.rs
new file mode 100644
index 000000000..011fabfbb
--- /dev/null
+++ b/tests/ui/lint/unconditional_panic_98444.rs
@@ -0,0 +1,7 @@
+// build-fail
+
+fn main() {
+ let xs: [i32; 5] = [1, 2, 3, 4, 5];
+ let _ = &xs;
+ let _ = xs[7]; //~ ERROR: this operation will panic at runtime [unconditional_panic]
+}
diff --git a/tests/ui/lint/unconditional_panic_98444.stderr b/tests/ui/lint/unconditional_panic_98444.stderr
new file mode 100644
index 000000000..a34745809
--- /dev/null
+++ b/tests/ui/lint/unconditional_panic_98444.stderr
@@ -0,0 +1,10 @@
+error: this operation will panic at runtime
+ --> $DIR/unconditional_panic_98444.rs:6:13
+ |
+LL | let _ = xs[7];
+ | ^^^^^ index out of bounds: the length is 5 but the index is 7
+ |
+ = note: `#[deny(unconditional_panic)]` on by default
+
+error: aborting due to previous error
+
diff --git a/tests/ui/lint/unused/auxiliary/must-use-foreign.rs b/tests/ui/lint/unused/auxiliary/must-use-foreign.rs
new file mode 100644
index 000000000..f773f09c3
--- /dev/null
+++ b/tests/ui/lint/unused/auxiliary/must-use-foreign.rs
@@ -0,0 +1,12 @@
+// edition:2021
+
+use std::future::Future;
+
+pub struct Manager;
+
+impl Manager {
+ #[must_use]
+ pub async fn new() -> (Self, impl Future<Output = ()>) {
+ (Manager, async {})
+ }
+}
diff --git a/tests/ui/lint/unused/must-use-box-from-raw.stderr b/tests/ui/lint/unused/must-use-box-from-raw.stderr
index 47ab613be..4898db7fe 100644
--- a/tests/ui/lint/unused/must-use-box-from-raw.stderr
+++ b/tests/ui/lint/unused/must-use-box-from-raw.stderr
@@ -10,6 +10,10 @@ note: the lint level is defined here
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = Box::from_raw(ptr);
+ | +++++++
warning: 1 warning emitted
diff --git a/tests/ui/lint/unused/must-use-foreign.rs b/tests/ui/lint/unused/must-use-foreign.rs
new file mode 100644
index 000000000..21a110585
--- /dev/null
+++ b/tests/ui/lint/unused/must-use-foreign.rs
@@ -0,0 +1,15 @@
+// edition:2021
+// aux-build:must-use-foreign.rs
+// check-pass
+
+extern crate must_use_foreign;
+
+use must_use_foreign::Manager;
+
+async fn async_main() {
+ Manager::new().await.1.await;
+}
+
+fn main() {
+ let _ = async_main();
+}
diff --git a/tests/ui/lint/unused/must_use-unit.stderr b/tests/ui/lint/unused/must_use-unit.stderr
index 9fcbc5074..993a19e5f 100644
--- a/tests/ui/lint/unused/must_use-unit.stderr
+++ b/tests/ui/lint/unused/must_use-unit.stderr
@@ -9,12 +9,21 @@ note: the lint level is defined here
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo();
+ | +++++++
error: unused return value of `bar` that must be used
--> $DIR/must_use-unit.rs:15:5
|
LL | bar();
| ^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = bar();
+ | +++++++
error: aborting due to 2 previous errors
diff --git a/tests/ui/lint/unused/trait-alias-supertrait.rs b/tests/ui/lint/unused/trait-alias-supertrait.rs
new file mode 100644
index 000000000..46f00c06b
--- /dev/null
+++ b/tests/ui/lint/unused/trait-alias-supertrait.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+// Make sure that we only consider *Self* supertrait predicates
+// in the `unused_must_use` lint.
+
+#![feature(trait_alias)]
+#![deny(unused_must_use)]
+
+trait Foo<T> = Sized where T: Iterator;
+
+fn test<T: Iterator>() -> impl Foo<T> {}
+
+fn main() {
+ test::<std::iter::Once<()>>();
+}
diff --git a/tests/ui/lint/unused/unused-allocation.rs b/tests/ui/lint/unused/unused-allocation.rs
new file mode 100644
index 000000000..c1a6f5cea
--- /dev/null
+++ b/tests/ui/lint/unused/unused-allocation.rs
@@ -0,0 +1,7 @@
+#![feature(rustc_attrs, stmt_expr_attributes)]
+#![deny(unused_allocation)]
+
+fn main() {
+ _ = (#[rustc_box] Box::new([1])).len(); //~ error: unnecessary allocation, use `&` instead
+ _ = Box::new([1]).len(); //~ error: unnecessary allocation, use `&` instead
+}
diff --git a/tests/ui/lint/unused/unused-allocation.stderr b/tests/ui/lint/unused/unused-allocation.stderr
new file mode 100644
index 000000000..c9ccfbd30
--- /dev/null
+++ b/tests/ui/lint/unused/unused-allocation.stderr
@@ -0,0 +1,20 @@
+error: unnecessary allocation, use `&` instead
+ --> $DIR/unused-allocation.rs:5:9
+ |
+LL | _ = (#[rustc_box] Box::new([1])).len();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/unused-allocation.rs:2:9
+ |
+LL | #![deny(unused_allocation)]
+ | ^^^^^^^^^^^^^^^^^
+
+error: unnecessary allocation, use `&` instead
+ --> $DIR/unused-allocation.rs:6:9
+ |
+LL | _ = Box::new([1]).len();
+ | ^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lint/unused/unused-async.rs b/tests/ui/lint/unused/unused-async.rs
index 4be93aa15..6355f47f0 100644
--- a/tests/ui/lint/unused/unused-async.rs
+++ b/tests/ui/lint/unused/unused-async.rs
@@ -33,7 +33,7 @@ async fn test() {
foo().await; //~ ERROR unused output of future returned by `foo` that must be used
bar(); //~ ERROR unused return value of `bar` that must be used
//~^ ERROR unused implementer of `Future` that must be used
- bar().await; //~ ERROR unused output of future returned by `bar` that must be used
+ bar().await; // ok, it's not an async fn
baz(); //~ ERROR unused implementer of `Future` that must be used
baz().await; // ok
}
diff --git a/tests/ui/lint/unused/unused-async.stderr b/tests/ui/lint/unused/unused-async.stderr
index 4bcb26dc1..e93a40658 100644
--- a/tests/ui/lint/unused/unused-async.stderr
+++ b/tests/ui/lint/unused/unused-async.stderr
@@ -16,12 +16,22 @@ error: unused return value of `foo` that must be used
|
LL | foo();
| ^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo();
+ | +++++++
error: unused output of future returned by `foo` that must be used
--> $DIR/unused-async.rs:33:5
|
LL | foo().await;
| ^^^^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo().await;
+ | +++++++
error: unused implementer of `Future` that must be used
--> $DIR/unused-async.rs:34:5
@@ -36,12 +46,11 @@ error: unused return value of `bar` that must be used
|
LL | bar();
| ^^^^^
-
-error: unused output of future returned by `bar` that must be used
- --> $DIR/unused-async.rs:36:5
|
-LL | bar().await;
- | ^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = bar();
+ | +++++++
error: unused implementer of `Future` that must be used
--> $DIR/unused-async.rs:37:5
@@ -51,5 +60,5 @@ LL | baz();
|
= note: futures do nothing unless you `.await` or poll them
-error: aborting due to 7 previous errors
+error: aborting due to 6 previous errors
diff --git a/tests/ui/lint/unused/unused-result.stderr b/tests/ui/lint/unused/unused-result.stderr
index 4e1ba1fd9..f42995a65 100644
--- a/tests/ui/lint/unused/unused-result.stderr
+++ b/tests/ui/lint/unused/unused-result.stderr
@@ -9,6 +9,10 @@ note: the lint level is defined here
|
LL | #![deny(unused_results, unused_must_use)]
| ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo::<MustUse>();
+ | +++++++
error: unused `MustUseMsg` that must be used
--> $DIR/unused-result.rs:22:5
@@ -17,6 +21,10 @@ LL | foo::<MustUseMsg>();
| ^^^^^^^^^^^^^^^^^^^
|
= note: some message
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo::<MustUseMsg>();
+ | +++++++
error: unused result of type `isize`
--> $DIR/unused-result.rs:34:5
@@ -35,6 +43,11 @@ error: unused `MustUse` that must be used
|
LL | foo::<MustUse>();
| ^^^^^^^^^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo::<MustUse>();
+ | +++++++
error: unused `MustUseMsg` that must be used
--> $DIR/unused-result.rs:36:5
@@ -43,6 +56,10 @@ LL | foo::<MustUseMsg>();
| ^^^^^^^^^^^^^^^^^^^
|
= note: some message
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo::<MustUseMsg>();
+ | +++++++
error: aborting due to 5 previous errors
diff --git a/tests/ui/lint/unused/unused_attributes-must_use.stderr b/tests/ui/lint/unused/unused_attributes-must_use.stderr
index 0f699429e..9633767c4 100644
--- a/tests/ui/lint/unused/unused_attributes-must_use.stderr
+++ b/tests/ui/lint/unused/unused_attributes-must_use.stderr
@@ -146,42 +146,76 @@ note: the lint level is defined here
|
LL | #![deny(unused_attributes, unused_must_use)]
| ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = X;
+ | +++++++
error: unused `Y` that must be used
--> $DIR/unused_attributes-must_use.rs:104:5
|
LL | Y::Z;
| ^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = Y::Z;
+ | +++++++
error: unused `U` that must be used
--> $DIR/unused_attributes-must_use.rs:105:5
|
LL | U { unit: () };
| ^^^^^^^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = U { unit: () };
+ | +++++++
error: unused return value of `U::method` that must be used
--> $DIR/unused_attributes-must_use.rs:106:5
|
LL | U::method();
| ^^^^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = U::method();
+ | +++++++
error: unused return value of `foo` that must be used
--> $DIR/unused_attributes-must_use.rs:107:5
|
LL | foo();
| ^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foo();
+ | +++++++
error: unused return value of `foreign_foo` that must be used
--> $DIR/unused_attributes-must_use.rs:110:9
|
LL | foreign_foo();
| ^^^^^^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = foreign_foo();
+ | +++++++
error: unused return value of `Use::get_four` that must be used
--> $DIR/unused_attributes-must_use.rs:118:5
|
LL | ().get_four();
| ^^^^^^^^^^^^^
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = ().get_four();
+ | +++++++
error: aborting due to 28 previous errors
diff --git a/tests/ui/lint/use-redundant/issue-92904.rs b/tests/ui/lint/use-redundant/issue-92904.rs
new file mode 100644
index 000000000..511d9d263
--- /dev/null
+++ b/tests/ui/lint/use-redundant/issue-92904.rs
@@ -0,0 +1,17 @@
+// check-pass
+
+pub struct Foo(bar::Bar);
+
+pub mod bar {
+ pub struct Foo(pub Bar);
+ pub struct Bar(pub char);
+}
+
+pub fn warning() -> Foo {
+ use bar::*;
+ #[deny(unused_imports)]
+ use self::Foo; // no error
+ Foo(Bar('a'))
+}
+
+fn main() {}
diff --git a/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs b/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs
new file mode 100644
index 000000000..6b1e018d2
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs
@@ -0,0 +1,16 @@
+// check-pass
+#![warn(unused_imports)]
+
+pub mod bar {
+ pub struct Foo(pub Bar);
+ pub struct Bar(pub char);
+}
+
+use bar::*;
+
+pub fn warning() -> Foo {
+ use bar::Foo; //~ WARNING imported redundantly
+ Foo(Bar('a'))
+}
+
+fn main() {}
diff --git a/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr b/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr
new file mode 100644
index 000000000..2c3b33452
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr
@@ -0,0 +1,17 @@
+warning: the item `Foo` is imported redundantly
+ --> $DIR/use-redundant-glob-parent.rs:12:9
+ |
+LL | use bar::*;
+ | ------ the item `Foo` is already imported here
+...
+LL | use bar::Foo;
+ | ^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/use-redundant-glob-parent.rs:2:9
+ |
+LL | #![warn(unused_imports)]
+ | ^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lint/use-redundant/use-redundant-glob.rs b/tests/ui/lint/use-redundant/use-redundant-glob.rs
new file mode 100644
index 000000000..bd9e51b6f
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-glob.rs
@@ -0,0 +1,15 @@
+// check-pass
+#![warn(unused_imports)]
+
+pub mod bar {
+ pub struct Foo(pub Bar);
+ pub struct Bar(pub char);
+}
+
+pub fn warning() -> bar::Foo {
+ use bar::*;
+ use bar::Foo; //~ WARNING imported redundantly
+ Foo(Bar('a'))
+}
+
+fn main() {}
diff --git a/tests/ui/lint/use-redundant/use-redundant-glob.stderr b/tests/ui/lint/use-redundant/use-redundant-glob.stderr
new file mode 100644
index 000000000..d3b406d82
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-glob.stderr
@@ -0,0 +1,16 @@
+warning: the item `Foo` is imported redundantly
+ --> $DIR/use-redundant-glob.rs:11:9
+ |
+LL | use bar::*;
+ | ------ the item `Foo` is already imported here
+LL | use bar::Foo;
+ | ^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/use-redundant-glob.rs:2:9
+ |
+LL | #![warn(unused_imports)]
+ | ^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lint/use-redundant/use-redundant-multiple-namespaces.rs b/tests/ui/lint/use-redundant/use-redundant-multiple-namespaces.rs
new file mode 100644
index 000000000..0fb60840f
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-multiple-namespaces.rs
@@ -0,0 +1,21 @@
+// check-pass
+#![allow(nonstandard_style)]
+
+pub mod bar {
+ pub struct Foo { pub bar: Bar }
+ pub struct Bar(pub char);
+}
+
+pub mod x {
+ use crate::bar;
+ pub const Foo: bar::Bar = bar::Bar('a');
+}
+
+pub fn warning() -> bar::Foo {
+ #![deny(unused_imports)] // no error
+ use bar::*;
+ use x::Foo;
+ Foo { bar: Foo }
+}
+
+fn main() {}
diff --git a/tests/ui/lint/use-redundant/use-redundant-not-parent.rs b/tests/ui/lint/use-redundant/use-redundant-not-parent.rs
new file mode 100644
index 000000000..c97a3d341
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-not-parent.rs
@@ -0,0 +1,19 @@
+// check-pass
+
+pub mod bar {
+ pub struct Foo(pub Bar);
+ pub struct Bar(pub char);
+}
+
+pub mod x {
+ pub struct Foo(pub crate::bar::Bar);
+}
+
+pub fn warning() -> x::Foo {
+ use bar::*;
+ #[deny(unused_imports)]
+ use x::Foo; // no error
+ Foo(Bar('a'))
+}
+
+fn main() {}
diff --git a/tests/ui/lint/use-redundant.rs b/tests/ui/lint/use-redundant/use-redundant.rs
index 53315dcf6..53315dcf6 100644
--- a/tests/ui/lint/use-redundant.rs
+++ b/tests/ui/lint/use-redundant/use-redundant.rs
diff --git a/tests/ui/lint/use-redundant.stderr b/tests/ui/lint/use-redundant/use-redundant.stderr
index c861a1956..c861a1956 100644
--- a/tests/ui/lint/use-redundant.stderr
+++ b/tests/ui/lint/use-redundant/use-redundant.stderr
diff --git a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs
index c9b16e439..293fdca1c 100644
--- a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs
+++ b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs
@@ -5,6 +5,7 @@ fn test() {
drop(b);
b = Box::new(2); //~ ERROR cannot assign twice to immutable variable `b`
//~| NOTE cannot assign twice to immutable
+ //~| NOTE in this expansion of desugaring of drop and replace
drop(b);
}
diff --git a/tests/ui/macros/bad-concat.stderr b/tests/ui/macros/bad-concat.stderr
index 4316fd312..d67f3c33d 100644
--- a/tests/ui/macros/bad-concat.stderr
+++ b/tests/ui/macros/bad-concat.stderr
@@ -4,7 +4,7 @@ error: expected a literal
LL | let _ = concat!(x, y, z, "bar");
| ^ ^ ^
|
- = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()`
+ = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()`
error: aborting due to previous error
diff --git a/tests/ui/macros/concat-bytes-error.stderr b/tests/ui/macros/concat-bytes-error.stderr
index d6cd1a3d1..3f2c64922 100644
--- a/tests/ui/macros/concat-bytes-error.stderr
+++ b/tests/ui/macros/concat-bytes-error.stderr
@@ -4,7 +4,7 @@ error: expected a byte literal
LL | concat_bytes!(pie);
| ^^^
|
- = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()`
+ = note: only byte literals (like `b"foo"`, `b's'` and `[3, 4, 5]`) can be passed to `concat_bytes!()`
error: expected a byte literal
--> $DIR/concat-bytes-error.rs:5:19
@@ -12,7 +12,7 @@ error: expected a byte literal
LL | concat_bytes!(pie, pie);
| ^^^ ^^^
|
- = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()`
+ = note: only byte literals (like `b"foo"`, `b's'` and `[3, 4, 5]`) can be passed to `concat_bytes!()`
error: cannot concatenate string literals
--> $DIR/concat-bytes-error.rs:6:19
@@ -98,7 +98,7 @@ error: expected a byte literal
LL | -33,
| ^^^
|
- = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()`
+ = note: only byte literals (like `b"foo"`, `b's'` and `[3, 4, 5]`) can be passed to `concat_bytes!()`
error: cannot concatenate doubly nested array
--> $DIR/concat-bytes-error.rs:35:9
@@ -151,7 +151,7 @@ error: expected a byte literal
LL | concat_bytes!([pie; 2]);
| ^^^
|
- = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()`
+ = note: only byte literals (like `b"foo"`, `b's'` and `[3, 4, 5]`) can be passed to `concat_bytes!()`
error: cannot concatenate float literals
--> $DIR/concat-bytes-error.rs:46:20
diff --git a/tests/ui/macros/concat.stderr b/tests/ui/macros/concat.stderr
index 61fb9de1e..d65d93544 100644
--- a/tests/ui/macros/concat.stderr
+++ b/tests/ui/macros/concat.stderr
@@ -16,7 +16,7 @@ error: expected a literal
LL | concat!(foo);
| ^^^
|
- = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()`
+ = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()`
error: expected a literal
--> $DIR/concat.rs:5:13
@@ -24,7 +24,7 @@ error: expected a literal
LL | concat!(foo());
| ^^^^^
|
- = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()`
+ = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()`
error: aborting due to 4 previous errors
diff --git a/tests/ui/macros/issue-100199.stderr b/tests/ui/macros/issue-100199.stderr
index 2cb45dc12..89a6f585c 100644
--- a/tests/ui/macros/issue-100199.stderr
+++ b/tests/ui/macros/issue-100199.stderr
@@ -7,7 +7,7 @@ LL | #[issue_100199::struct_with_bound]
= note: this error originates in the attribute macro `issue_100199::struct_with_bound` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this trait
|
-LL | use traits::MyTrait;
+LL + use traits::MyTrait;
|
error: aborting due to previous error
diff --git a/tests/ui/macros/issue-106837.rs b/tests/ui/macros/issue-106837.rs
new file mode 100644
index 000000000..7bbd3d68a
--- /dev/null
+++ b/tests/ui/macros/issue-106837.rs
@@ -0,0 +1,10 @@
+fn main() {
+ concat!(-42);
+ concat!(-3.14);
+
+ concat!(-"hello");
+ //~^ ERROR expected a literal
+
+ concat!(--1);
+ //~^ ERROR expected a literal
+}
diff --git a/tests/ui/macros/issue-106837.stderr b/tests/ui/macros/issue-106837.stderr
new file mode 100644
index 000000000..998d6c5eb
--- /dev/null
+++ b/tests/ui/macros/issue-106837.stderr
@@ -0,0 +1,18 @@
+error: expected a literal
+ --> $DIR/issue-106837.rs:5:13
+ |
+LL | concat!(-"hello");
+ | ^^^^^^^^
+ |
+ = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()`
+
+error: expected a literal
+ --> $DIR/issue-106837.rs:8:13
+ |
+LL | concat!(--1);
+ | ^^^
+ |
+ = note: only literals (like `"foo"`, `-42` and `3.14`) can be passed to `concat!()`
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/macros/issue-109237.rs b/tests/ui/macros/issue-109237.rs
new file mode 100644
index 000000000..86a193c9e
--- /dev/null
+++ b/tests/ui/macros/issue-109237.rs
@@ -0,0 +1,7 @@
+macro_rules! statement {
+ () => {;}; //~ ERROR expected expression
+}
+
+fn main() {
+ let _ = statement!();
+}
diff --git a/tests/ui/macros/issue-109237.stderr b/tests/ui/macros/issue-109237.stderr
new file mode 100644
index 000000000..d125cff63
--- /dev/null
+++ b/tests/ui/macros/issue-109237.stderr
@@ -0,0 +1,18 @@
+error: expected expression, found `;`
+ --> $DIR/issue-109237.rs:2:12
+ |
+LL | () => {;};
+ | ^ expected expression
+...
+LL | let _ = statement!();
+ | ------------ in this macro invocation
+ |
+ = note: the macro call doesn't expand to an expression, but it can expand to a statement
+ = note: this error originates in the macro `statement` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: surround the macro invocation with `{}` to interpret the expansion as a statement
+ |
+LL | let _ = { statement!(); };
+ | ~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
diff --git a/tests/ui/macros/issue-40469.rs b/tests/ui/macros/issue-40469.rs
index 25e08ef85..9b22aaef2 100644
--- a/tests/ui/macros/issue-40469.rs
+++ b/tests/ui/macros/issue-40469.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
#![allow(dead_code)]
diff --git a/tests/ui/macros/issue-98790.rs b/tests/ui/macros/issue-98790.rs
new file mode 100644
index 000000000..8fe6fc41d
--- /dev/null
+++ b/tests/ui/macros/issue-98790.rs
@@ -0,0 +1,24 @@
+// run-pass
+
+macro_rules! stringify_item {
+ ($item:item) => {
+ stringify!($item)
+ };
+}
+
+macro_rules! repro {
+ ($expr:expr) => {
+ stringify_item! {
+ pub fn repro() -> bool {
+ $expr
+ }
+ }
+ };
+}
+
+fn main() {
+ assert_eq!(
+ repro!(match () { () => true } | true),
+ "pub fn repro() -> bool { (match () { () => true, }) | true }"
+ );
+}
diff --git a/tests/ui/macros/macro-comma-support-rpass.rs b/tests/ui/macros/macro-comma-support-rpass.rs
index 25b8c3cc6..cb019792e 100644
--- a/tests/ui/macros/macro-comma-support-rpass.rs
+++ b/tests/ui/macros/macro-comma-support-rpass.rs
@@ -8,7 +8,6 @@
// implementations for some macro_rules! macros as an implementation
// detail.
-// ignore-pretty issue #37195
// compile-flags: --test -C debug_assertions=yes
// revisions: std core
diff --git a/tests/ui/macros/macro-include-items.rs b/tests/ui/macros/macro-include-items.rs
index 332bf59c9..ad6f04009 100644
--- a/tests/ui/macros/macro-include-items.rs
+++ b/tests/ui/macros/macro-include-items.rs
@@ -1,7 +1,6 @@
// run-pass
#![allow(non_camel_case_types)]
-// ignore-pretty issue #37195
fn bar() {}
diff --git a/tests/ui/macros/macro-outer-attributes.stderr b/tests/ui/macros/macro-outer-attributes.stderr
index 4ea760ab8..0bdc3416f 100644
--- a/tests/ui/macros/macro-outer-attributes.stderr
+++ b/tests/ui/macros/macro-outer-attributes.stderr
@@ -6,7 +6,7 @@ LL | a::bar();
|
help: consider importing this function
|
-LL | use b::bar;
+LL + use b::bar;
|
help: if you import `bar`, refer to it directly
|
diff --git a/tests/ui/macros/macro-path-prelude-fail-4.stderr b/tests/ui/macros/macro-path-prelude-fail-4.stderr
index dfd6818b6..81c6722b5 100644
--- a/tests/ui/macros/macro-path-prelude-fail-4.stderr
+++ b/tests/ui/macros/macro-path-prelude-fail-4.stderr
@@ -3,6 +3,14 @@ error: expected derive macro, found built-in attribute `inline`
|
LL | #[derive(inline)]
| ^^^^^^ not a derive macro
+ |
+help: remove from the surrounding `derive()`
+ --> $DIR/macro-path-prelude-fail-4.rs:1:10
+ |
+LL | #[derive(inline)]
+ | ^^^^^^
+ = help: add as non-Derive macro
+ `#[inline]`
error: aborting due to previous error
diff --git a/tests/ui/macros/macro-path-prelude-fail-5.rs b/tests/ui/macros/macro-path-prelude-fail-5.rs
new file mode 100644
index 000000000..b82b6bc78
--- /dev/null
+++ b/tests/ui/macros/macro-path-prelude-fail-5.rs
@@ -0,0 +1,10 @@
+#[derive(Clone, Debug)] // OK
+struct S;
+
+#[derive(Debug, inline)] //~ ERROR expected derive macro, found built-in attribute `inline`
+struct T;
+
+#[derive(inline, Debug)] //~ ERROR expected derive macro, found built-in attribute `inline`
+struct U;
+
+fn main() {}
diff --git a/tests/ui/macros/macro-path-prelude-fail-5.stderr b/tests/ui/macros/macro-path-prelude-fail-5.stderr
new file mode 100644
index 000000000..105c59db6
--- /dev/null
+++ b/tests/ui/macros/macro-path-prelude-fail-5.stderr
@@ -0,0 +1,30 @@
+error: expected derive macro, found built-in attribute `inline`
+ --> $DIR/macro-path-prelude-fail-5.rs:4:17
+ |
+LL | #[derive(Debug, inline)]
+ | ^^^^^^ not a derive macro
+ |
+help: remove from the surrounding `derive()`
+ --> $DIR/macro-path-prelude-fail-5.rs:4:17
+ |
+LL | #[derive(Debug, inline)]
+ | ^^^^^^
+ = help: add as non-Derive macro
+ `#[inline]`
+
+error: expected derive macro, found built-in attribute `inline`
+ --> $DIR/macro-path-prelude-fail-5.rs:7:10
+ |
+LL | #[derive(inline, Debug)]
+ | ^^^^^^ not a derive macro
+ |
+help: remove from the surrounding `derive()`
+ --> $DIR/macro-path-prelude-fail-5.rs:7:10
+ |
+LL | #[derive(inline, Debug)]
+ | ^^^^^^
+ = help: add as non-Derive macro
+ `#[inline]`
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/macros/macros-nonfatal-errors.stderr b/tests/ui/macros/macros-nonfatal-errors.stderr
index 93fbc9c8a..ca373ea6c 100644
--- a/tests/ui/macros/macros-nonfatal-errors.stderr
+++ b/tests/ui/macros/macros-nonfatal-errors.stderr
@@ -3,36 +3,48 @@ error: the `#[default]` attribute may only be used on unit enum variants
|
LL | #[default]
| ^^^^^^^^^^
+ |
+ = help: consider a manual implementation of `Default`
error: the `#[default]` attribute may only be used on unit enum variants
--> $DIR/macros-nonfatal-errors.rs:18:36
|
LL | struct DefaultInnerAttrTupleStruct(#[default] ());
| ^^^^^^^^^^
+ |
+ = help: consider a manual implementation of `Default`
error: the `#[default]` attribute may only be used on unit enum variants
--> $DIR/macros-nonfatal-errors.rs:22:1
|
LL | #[default]
| ^^^^^^^^^^
+ |
+ = help: consider a manual implementation of `Default`
error: the `#[default]` attribute may only be used on unit enum variants
--> $DIR/macros-nonfatal-errors.rs:26:1
|
LL | #[default]
| ^^^^^^^^^^
+ |
+ = help: consider a manual implementation of `Default`
error: the `#[default]` attribute may only be used on unit enum variants
--> $DIR/macros-nonfatal-errors.rs:36:11
|
LL | Foo = #[default] 0,
| ^^^^^^^^^^
+ |
+ = help: consider a manual implementation of `Default`
error: the `#[default]` attribute may only be used on unit enum variants
--> $DIR/macros-nonfatal-errors.rs:37:14
|
LL | Bar([u8; #[default] 1]),
| ^^^^^^^^^^
+ |
+ = help: consider a manual implementation of `Default`
error: no default declared
--> $DIR/macros-nonfatal-errors.rs:42:10
@@ -132,7 +144,7 @@ error: asm template must be a string literal
LL | asm!(invalid);
| ^^^^^^^
-error: concat_idents! requires ident args
+error: `concat_idents!()` requires ident args
--> $DIR/macros-nonfatal-errors.rs:101:5
|
LL | concat_idents!("not", "idents");
@@ -150,7 +162,7 @@ error: expected string literal
LL | env!(invalid);
| ^^^^^^^
-error: env! takes 1 or 2 arguments
+error: `env!()` takes 1 or 2 arguments
--> $DIR/macros-nonfatal-errors.rs:105:5
|
LL | env!(foo, abr, baz);
@@ -162,7 +174,7 @@ error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined at co
LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: Use `std::env::var("RUST_HOPEFULLY_THIS_DOESNT_EXIST")` to read the variable at run time
+ = help: use `std::env::var("RUST_HOPEFULLY_THIS_DOESNT_EXIST")` to read the variable at run time
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
error: format argument must be a string literal
diff --git a/tests/ui/macros/missing-writer.rs b/tests/ui/macros/missing-writer.rs
new file mode 100644
index 000000000..7df965c36
--- /dev/null
+++ b/tests/ui/macros/missing-writer.rs
@@ -0,0 +1,17 @@
+// Check error for missing writer in writeln! and write! macro
+fn main() {
+ let x = 1;
+ let y = 2;
+ write!("{}_{}", x, y);
+ //~^ ERROR format argument must be a string literal
+ //~| HELP you might be missing a string literal to format with
+ //~| ERROR cannot write into `&'static str`
+ //~| NOTE must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
+ //~| HELP a writer is needed before this format string
+ writeln!("{}_{}", x, y);
+ //~^ ERROR format argument must be a string literal
+ //~| HELP you might be missing a string literal to format with
+ //~| ERROR cannot write into `&'static str`
+ //~| NOTE must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
+ //~| HELP a writer is needed before this format string
+}
diff --git a/tests/ui/macros/missing-writer.stderr b/tests/ui/macros/missing-writer.stderr
new file mode 100644
index 000000000..86dfe7d65
--- /dev/null
+++ b/tests/ui/macros/missing-writer.stderr
@@ -0,0 +1,59 @@
+error: format argument must be a string literal
+ --> $DIR/missing-writer.rs:5:21
+ |
+LL | write!("{}_{}", x, y);
+ | ^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | write!("{}_{}", "{} {}", x, y);
+ | ++++++++
+
+error: format argument must be a string literal
+ --> $DIR/missing-writer.rs:11:23
+ |
+LL | writeln!("{}_{}", x, y);
+ | ^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | writeln!("{}_{}", "{} {}", x, y);
+ | ++++++++
+
+error[E0599]: cannot write into `&'static str`
+ --> $DIR/missing-writer.rs:5:12
+ |
+LL | write!("{}_{}", x, y);
+ | -------^^^^^^^------- method not found in `&str`
+ |
+note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
+ --> $DIR/missing-writer.rs:5:12
+ |
+LL | write!("{}_{}", x, y);
+ | ^^^^^^^
+help: a writer is needed before this format string
+ --> $DIR/missing-writer.rs:5:12
+ |
+LL | write!("{}_{}", x, y);
+ | ^
+
+error[E0599]: cannot write into `&'static str`
+ --> $DIR/missing-writer.rs:11:14
+ |
+LL | writeln!("{}_{}", x, y);
+ | ---------^^^^^^^------- method not found in `&str`
+ |
+note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
+ --> $DIR/missing-writer.rs:11:14
+ |
+LL | writeln!("{}_{}", x, y);
+ | ^^^^^^^
+help: a writer is needed before this format string
+ --> $DIR/missing-writer.rs:11:14
+ |
+LL | writeln!("{}_{}", x, y);
+ | ^
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/macros/nested-use-as.rs b/tests/ui/macros/nested-use-as.rs
new file mode 100644
index 000000000..21aa81e80
--- /dev/null
+++ b/tests/ui/macros/nested-use-as.rs
@@ -0,0 +1,83 @@
+// check-pass
+// edition:2018
+// issue: https://github.com/rust-lang/rust/issues/97534
+
+macro_rules! m {
+ () => {
+ macro_rules! foo {
+ () => {}
+ }
+ use foo as bar;
+ }
+}
+
+m!{}
+
+use bar as baz;
+
+baz!{}
+
+macro_rules! foo2 {
+ () => {};
+}
+
+macro_rules! m2 {
+ () => {
+ use foo2 as bar2;
+ };
+}
+
+m2! {}
+
+use bar2 as baz2;
+
+baz2! {}
+
+macro_rules! n1 {
+ () => {
+ macro_rules! n2 {
+ () => {
+ macro_rules! n3 {
+ () => {
+ macro_rules! n4 {
+ () => {}
+ }
+ use n4 as c4;
+ }
+ }
+ use n3 as c3;
+ }
+ }
+ use n2 as c2;
+ }
+}
+
+use n1 as c1;
+c1!{}
+use c2 as a2;
+a2!{}
+use c3 as a3;
+a3!{}
+use c4 as a4;
+a4!{}
+
+// https://github.com/rust-lang/rust/pull/108729#issuecomment-1474750675
+// reversed
+use d5 as d6;
+use d4 as d5;
+use d3 as d4;
+use d2 as d3;
+use d1 as d2;
+use foo2 as d1;
+d6! {}
+
+// mess
+use f3 as f4;
+f5! {}
+use f1 as f2;
+use f4 as f5;
+use f2 as f3;
+use foo2 as f1;
+
+fn main() {
+}
diff --git a/tests/ui/macros/nonterminal-matching.stderr b/tests/ui/macros/nonterminal-matching.stderr
index 5bbd54390..c2b047022 100644
--- a/tests/ui/macros/nonterminal-matching.stderr
+++ b/tests/ui/macros/nonterminal-matching.stderr
@@ -18,6 +18,9 @@ LL | macro n(a $nt_item b) {
...
LL | complex_nonterminal!(enum E {});
| ------------------------------- in this macro invocation
+ = note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
+ = note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
+ = help: try using `:tt` instead in the macro definition
= note: this error originates in the macro `complex_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs b/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs
index b8b6f0846..e88e24482 100644
--- a/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs
+++ b/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs
@@ -5,7 +5,7 @@
// needs-unwind Asserting on contents of error message
#![allow(path_statements, unused_allocation)]
-#![feature(box_syntax, core_intrinsics, generic_assert, generic_assert_internals)]
+#![feature(core_intrinsics, generic_assert, generic_assert_internals)]
macro_rules! test {
(
@@ -127,9 +127,6 @@ fn main() {
// block
[ { elem } == 3 ] => "Assertion failed: { elem } == 3"
- // box
- [ box elem == box 3 ] => "Assertion failed: box elem == box 3"
-
// break
[ loop { break elem; } == 3 ] => "Assertion failed: loop { break elem; } == 3"
@@ -164,7 +161,7 @@ fn main() {
// mac call
// match
- [ match elem { _ => elem } == 3 ] => "Assertion failed: match elem { _ => elem, } == 3"
+ [ match elem { _ => elem } == 3 ] => "Assertion failed: (match elem { _ => elem, }) == 3"
// ret
[ (|| { return elem; })() == 3 ] => "Assertion failed: (|| { return elem; })() == 3"
diff --git a/tests/ui/macros/stringify.rs b/tests/ui/macros/stringify.rs
index fdc2a7666..79d8cd757 100644
--- a/tests/ui/macros/stringify.rs
+++ b/tests/ui/macros/stringify.rs
@@ -4,7 +4,6 @@
#![feature(async_closure)]
#![feature(box_patterns)]
-#![feature(box_syntax)]
#![feature(const_trait_impl)]
#![feature(decl_macro)]
#![feature(generators)]
@@ -91,9 +90,6 @@ fn test_block() {
#[test]
fn test_expr() {
- // ExprKind::Box
- assert_eq!(stringify_expr!(box expr), "box expr");
-
// ExprKind::Array
assert_eq!(stringify_expr!([]), "[]");
assert_eq!(stringify_expr!([true]), "[true]");
diff --git a/tests/ui/macros/syntax-extension-source-utils.rs b/tests/ui/macros/syntax-extension-source-utils.rs
index 7e46260d5..f41fadddd 100644
--- a/tests/ui/macros/syntax-extension-source-utils.rs
+++ b/tests/ui/macros/syntax-extension-source-utils.rs
@@ -1,7 +1,6 @@
// run-pass
#![allow(stable_features)]
-// ignore-pretty issue #37195
pub mod m1 {
pub mod m2 {
@@ -14,9 +13,9 @@ pub mod m1 {
macro_rules! indirect_line { () => ( line!() ) }
pub fn main() {
- assert_eq!(line!(), 17);
+ assert_eq!(line!(), 16);
assert_eq!(column!(), 16);
- assert_eq!(indirect_line!(), 19);
+ assert_eq!(indirect_line!(), 18);
assert!((file!().ends_with("syntax-extension-source-utils.rs")));
assert_eq!(stringify!((2*3) + 5).to_string(), "(2 * 3) + 5".to_string());
assert!(include!("syntax-extension-source-utils-files/includeme.\
@@ -33,5 +32,5 @@ pub fn main() {
// The Windows tests are wrapped in an extra module for some reason
assert!((m1::m2::where_am_i().ends_with("m1::m2")));
- assert_eq!((36, "(2 * 3) + 5"), (line!(), stringify!((2*3) + 5)));
+ assert_eq!((35, "(2 * 3) + 5"), (line!(), stringify!((2*3) + 5)));
}
diff --git a/tests/ui/malformed/malformed-derive-entry.stderr b/tests/ui/malformed/malformed-derive-entry.stderr
index 6ff6fbabb..3059d75d7 100644
--- a/tests/ui/malformed/malformed-derive-entry.stderr
+++ b/tests/ui/malformed/malformed-derive-entry.stderr
@@ -27,7 +27,8 @@ note: required by a bound in `Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Test1` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct Test1;
|
error[E0277]: the trait bound `Test2: Clone` is not satisfied
@@ -41,7 +42,8 @@ note: required by a bound in `Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Test2` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct Test2;
|
error: aborting due to 5 previous errors
diff --git a/tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs b/tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs
index 62aa22d41..b9f1de7ec 100644
--- a/tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs
+++ b/tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs
@@ -1,4 +1,8 @@
-// check-pass
+// known-bug: #89515
+//
+// The trait solver cannot deal with ambiguous marker trait impls
+// if there are lifetimes involved. As we must not special-case any
+// regions this does not work, even with 'static
#![feature(marker_trait_attr)]
#[marker]
diff --git a/tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.stderr b/tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.stderr
new file mode 100644
index 000000000..fe4de540b
--- /dev/null
+++ b/tests/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.stderr
@@ -0,0 +1,31 @@
+error[E0283]: type annotations needed: cannot satisfy `&'static (): Marker`
+ --> $DIR/overlap-marker-trait-with-static-lifetime.rs:11:17
+ |
+LL | impl Marker for &'static () {}
+ | ^^^^^^^^^^^
+ |
+note: multiple `impl`s satisfying `&'static (): Marker` found
+ --> $DIR/overlap-marker-trait-with-static-lifetime.rs:11:1
+ |
+LL | impl Marker for &'static () {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | impl Marker for &'static () {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0283]: type annotations needed: cannot satisfy `&'static (): Marker`
+ --> $DIR/overlap-marker-trait-with-static-lifetime.rs:12:17
+ |
+LL | impl Marker for &'static () {}
+ | ^^^^^^^^^^^
+ |
+note: multiple `impl`s satisfying `&'static (): Marker` found
+ --> $DIR/overlap-marker-trait-with-static-lifetime.rs:11:1
+ |
+LL | impl Marker for &'static () {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | impl Marker for &'static () {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs b/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs
index a8f3db5f5..97a814f51 100644
--- a/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs
+++ b/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs
@@ -1,9 +1,17 @@
-// check-pass
+// known-bug: #109481
+//
+// While the `T: Copy` is always applicable when checking
+// that the impl `impl<T: Copy> F for T {}` is well formed,
+// the old trait solver can only approximate this by checking
+// that there are no inference variables in the obligation and
+// no region constraints in the evaluation result.
+//
+// Because of this we end up with ambiguity here.
#![feature(marker_trait_attr)]
#[marker]
pub trait F {}
-impl<T> F for T where T: Copy {}
-impl<T> F for T where T: 'static {}
+impl<T: Copy> F for T {}
+impl<T: 'static> F for T {}
fn main() {}
diff --git a/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.stderr b/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.stderr
new file mode 100644
index 000000000..e713d1451
--- /dev/null
+++ b/tests/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.stderr
@@ -0,0 +1,14 @@
+error[E0310]: the parameter type `T` may not live long enough
+ --> $DIR/overlapping-impl-1-modulo-regions.rs:14:21
+ |
+LL | impl<T: Copy> F for T {}
+ | ^ ...so that the type `T` will meet its required lifetime bounds
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | impl<T: Copy + 'static> F for T {}
+ | +++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0310`.
diff --git a/tests/ui/match/guards-parenthesized-and.rs b/tests/ui/match/guards-parenthesized-and.rs
new file mode 100644
index 000000000..3a1c341f3
--- /dev/null
+++ b/tests/ui/match/guards-parenthesized-and.rs
@@ -0,0 +1,10 @@
+// check-pass
+
+fn main() {
+ let c = 1;
+ let w = "T";
+ match Some(5) {
+ None if c == 1 && (w != "Y" && w != "E") => {}
+ _ => panic!(),
+ }
+}
diff --git a/tests/ui/match/match-range-fail-2.rs b/tests/ui/match/match-range-fail-2.rs
index 792664e1d..4489cf1ab 100644
--- a/tests/ui/match/match-range-fail-2.rs
+++ b/tests/ui/match/match-range-fail-2.rs
@@ -3,22 +3,19 @@
fn main() {
match 5 {
6 ..= 1 => { }
+ //~^ ERROR lower range bound must be less than or equal to upper
_ => { }
};
- //~^^^ ERROR lower range bound must be less than or equal to upper
- //~| ERROR lower range bound must be less than or equal to upper
match 5 {
0 .. 0 => { }
+ //~^ ERROR lower range bound must be less than upper
_ => { }
};
- //~^^^ ERROR lower range bound must be less than upper
- //~| ERROR lower range bound must be less than upper
match 5u64 {
0xFFFF_FFFF_FFFF_FFFF ..= 1 => { }
+ //~^ ERROR lower range bound must be less than or equal to upper
_ => { }
};
- //~^^^ ERROR lower range bound must be less than or equal to upper
- //~| ERROR lower range bound must be less than or equal to upper
}
diff --git a/tests/ui/match/match-range-fail-2.stderr b/tests/ui/match/match-range-fail-2.stderr
index 7a0852d7e..52a2bf2b3 100644
--- a/tests/ui/match/match-range-fail-2.stderr
+++ b/tests/ui/match/match-range-fail-2.stderr
@@ -5,36 +5,18 @@ LL | 6 ..= 1 => { }
| ^ lower bound larger than upper bound
error[E0579]: lower range bound must be less than upper
- --> $DIR/match-range-fail-2.rs:12:9
+ --> $DIR/match-range-fail-2.rs:11:9
|
LL | 0 .. 0 => { }
| ^
error[E0030]: lower range bound must be less than or equal to upper
- --> $DIR/match-range-fail-2.rs:19:9
+ --> $DIR/match-range-fail-2.rs:17:9
|
LL | 0xFFFF_FFFF_FFFF_FFFF ..= 1 => { }
| ^^^^^^^^^^^^^^^^^^^^^ lower bound larger than upper bound
-error[E0030]: lower range bound must be less than or equal to upper
- --> $DIR/match-range-fail-2.rs:5:9
- |
-LL | 6 ..= 1 => { }
- | ^ lower bound larger than upper bound
-
-error[E0579]: lower range bound must be less than upper
- --> $DIR/match-range-fail-2.rs:12:9
- |
-LL | 0 .. 0 => { }
- | ^
-
-error[E0030]: lower range bound must be less than or equal to upper
- --> $DIR/match-range-fail-2.rs:19:9
- |
-LL | 0xFFFF_FFFF_FFFF_FFFF ..= 1 => { }
- | ^^^^^^^^^^^^^^^^^^^^^ lower bound larger than upper bound
-
-error: aborting due to 6 previous errors
+error: aborting due to 3 previous errors
Some errors have detailed explanations: E0030, E0579.
For more information about an error, try `rustc --explain E0030`.
diff --git a/tests/ui/methods/inherent-bound-in-probe.rs b/tests/ui/methods/inherent-bound-in-probe.rs
new file mode 100644
index 000000000..81a99ca01
--- /dev/null
+++ b/tests/ui/methods/inherent-bound-in-probe.rs
@@ -0,0 +1,49 @@
+// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
+
+// Fixes #110131
+//
+// The issue is that we were constructing an `ImplDerived` cause code for the
+// `&'a T: IntoIterator<Item = &'a u8>` obligation for `Helper::new`, which is
+// incorrect because derived obligations are only expected to come from *traits*.
+
+struct SeqBuffer<'a, T>
+where
+ &'a T: IntoIterator<Item = &'a u8>,
+{
+ iter: <&'a T as IntoIterator>::IntoIter,
+}
+
+struct Helper<'a, T>
+where
+ &'a T: IntoIterator<Item = &'a u8>,
+{
+ buf: SeqBuffer<'a, T>,
+}
+
+impl<'a, T> Helper<'a, T>
+where
+ &'a T: IntoIterator<Item = &'a u8>,
+{
+ fn new(sq: &'a T) -> Self {
+ loop {}
+ }
+}
+
+struct BitReaderWrapper<T>(T);
+
+impl<'a, T> IntoIterator for &'a BitReaderWrapper<T>
+where
+ &'a T: IntoIterator<Item = &'a u8>,
+{
+ type Item = u32;
+
+ type IntoIter = Helper<'a, T>;
+ //~^ ERROR `Helper<'a, T>` is not an iterator
+
+ fn into_iter(self) -> Self::IntoIter {
+ Helper::new(&self.0)
+ //~^ ERROR overflow evaluating the requirement `&_: IntoIterator`
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/methods/inherent-bound-in-probe.stderr b/tests/ui/methods/inherent-bound-in-probe.stderr
new file mode 100644
index 000000000..ff03a7edb
--- /dev/null
+++ b/tests/ui/methods/inherent-bound-in-probe.stderr
@@ -0,0 +1,38 @@
+error[E0277]: `Helper<'a, T>` is not an iterator
+ --> $DIR/inherent-bound-in-probe.rs:40:21
+ |
+LL | type IntoIter = Helper<'a, T>;
+ | ^^^^^^^^^^^^^ `Helper<'a, T>` is not an iterator
+ |
+ = help: the trait `Iterator` is not implemented for `Helper<'a, T>`
+note: required by a bound in `std::iter::IntoIterator::IntoIter`
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+
+error[E0275]: overflow evaluating the requirement `&_: IntoIterator`
+ --> $DIR/inherent-bound-in-probe.rs:44:17
+ |
+LL | Helper::new(&self.0)
+ | ^^^
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`inherent_bound_in_probe`)
+note: required for `&BitReaderWrapper<_>` to implement `IntoIterator`
+ --> $DIR/inherent-bound-in-probe.rs:34:13
+ |
+LL | impl<'a, T> IntoIterator for &'a BitReaderWrapper<T>
+ | ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
+LL | where
+LL | &'a T: IntoIterator<Item = &'a u8>,
+ | ------------- unsatisfied trait bound introduced here
+ = note: 126 redundant requirements hidden
+ = note: required for `&BitReaderWrapper<BitReaderWrapper<BitReaderWrapper<BitReaderWrapper<BitReaderWrapper<...>>>>>` to implement `IntoIterator`
+ = note: the full type name has been written to '$TEST_BUILD_DIR/methods/inherent-bound-in-probe/inherent-bound-in-probe.long-type-hash.txt'
+note: required by a bound in `Helper<'a, T>`
+ --> $DIR/inherent-bound-in-probe.rs:25:25
+ |
+LL | &'a T: IntoIterator<Item = &'a u8>,
+ | ^^^^^^^^^^^^^ required by this bound in `Helper<'a, T>`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0275, E0277.
+For more information about an error, try `rustc --explain E0275`.
diff --git a/tests/ui/methods/method-call-lifetime-args-fail.stderr b/tests/ui/methods/method-call-lifetime-args-fail.stderr
index 34526256f..645d8b8d1 100644
--- a/tests/ui/methods/method-call-lifetime-args-fail.stderr
+++ b/tests/ui/methods/method-call-lifetime-args-fail.stderr
@@ -30,7 +30,7 @@ note: method defined here, with 2 lifetime parameters: `'a`, `'b`
LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} }
| ^^^^^ -- --
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:27:15
|
LL | S::late::<'static>(S, &0, &0);
@@ -42,7 +42,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {}
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:29:15
|
LL | S::late::<'static, 'static>(S, &0, &0);
@@ -54,7 +54,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {}
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:31:15
|
LL | S::late::<'static, 'static, 'static>(S, &0, &0);
@@ -66,7 +66,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {}
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:34:21
|
LL | S::late_early::<'static, 'static>(S, &0);
@@ -78,7 +78,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_early<'a, 'b>(self, _: &'a u8) -> &'b u8 { loop {} }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:36:21
|
LL | S::late_early::<'static, 'static, 'static>(S, &0);
@@ -90,7 +90,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_early<'a, 'b>(self, _: &'a u8) -> &'b u8 { loop {} }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:40:24
|
LL | S::late_implicit::<'static>(S, &0, &0);
@@ -102,7 +102,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_implicit(self, _: &u8, _: &u8) {}
| ^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:42:24
|
LL | S::late_implicit::<'static, 'static>(S, &0, &0);
@@ -114,7 +114,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_implicit(self, _: &u8, _: &u8) {}
| ^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:44:24
|
LL | S::late_implicit::<'static, 'static, 'static>(S, &0, &0);
@@ -126,7 +126,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_implicit(self, _: &u8, _: &u8) {}
| ^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:47:30
|
LL | S::late_implicit_early::<'static, 'static>(S, &0);
@@ -138,7 +138,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_implicit_early<'b>(self, _: &u8) -> &'b u8 { loop {} }
| ^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:49:30
|
LL | S::late_implicit_early::<'static, 'static, 'static>(S, &0);
@@ -150,7 +150,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_implicit_early<'b>(self, _: &u8) -> &'b u8 { loop {} }
| ^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:52:35
|
LL | S::late_implicit_self_early::<'static, 'static>(&S);
@@ -162,7 +162,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_implicit_self_early<'b>(&self) -> &'b u8 { loop {} }
| ^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:54:35
|
LL | S::late_implicit_self_early::<'static, 'static, 'static>(&S);
@@ -174,7 +174,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_implicit_self_early<'b>(&self) -> &'b u8 { loop {} }
| ^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:57:28
|
LL | S::late_unused_early::<'static, 'static>(S);
@@ -186,7 +186,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_unused_early<'a, 'b>(self) -> &'b u8 { loop {} }
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-fail.rs:59:28
|
LL | S::late_unused_early::<'static, 'static, 'static>(S);
@@ -232,4 +232,5 @@ LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} }
error: aborting due to 18 previous errors
-For more information about this error, try `rustc --explain E0107`.
+Some errors have detailed explanations: E0107, E0794.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/tests/ui/methods/method-call-lifetime-args.stderr b/tests/ui/methods/method-call-lifetime-args.stderr
index 64ae79e9b..b215d5832 100644
--- a/tests/ui/methods/method-call-lifetime-args.stderr
+++ b/tests/ui/methods/method-call-lifetime-args.stderr
@@ -1,4 +1,4 @@
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args.rs:9:15
|
LL | S::late::<'static>(S, &0, &0);
@@ -10,7 +10,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {}
| ^^
-error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args.rs:11:24
|
LL | S::late_implicit::<'static>(S, &0, &0);
@@ -24,3 +24,4 @@ LL | fn late_implicit(self, _: &u8, _: &u8) {}
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0794`.
diff --git a/tests/ui/mir/addrof_alignment.rs b/tests/ui/mir/addrof_alignment.rs
new file mode 100644
index 000000000..892638bfb
--- /dev/null
+++ b/tests/ui/mir/addrof_alignment.rs
@@ -0,0 +1,15 @@
+// run-pass
+// ignore-wasm32-bare: No panic messages
+// compile-flags: -C debug-assertions
+
+struct Misalignment {
+ a: u32,
+}
+
+fn main() {
+ let items: [Misalignment; 2] = [Misalignment { a: 0 }, Misalignment { a: 1 }];
+ unsafe {
+ let ptr: *const Misalignment = items.as_ptr().cast::<u8>().add(1).cast::<Misalignment>();
+ let _ptr = core::ptr::addr_of!((*ptr).a);
+ }
+}
diff --git a/tests/ui/mir/checks_without_panic_impl.rs b/tests/ui/mir/checks_without_panic_impl.rs
new file mode 100644
index 000000000..04f410b77
--- /dev/null
+++ b/tests/ui/mir/checks_without_panic_impl.rs
@@ -0,0 +1,17 @@
+// Ensures that the alignment check we insert for raw pointer dereferences
+// does not prevent crates without a panic_impl from compiling.
+// See rust-lang/rust#109996
+
+// build-pass
+// compile-flags: -Cdebug-assertions=yes
+
+#![crate_type = "lib"]
+
+#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+
+#[lang = "sized"]
+trait Foo {}
+
+pub unsafe fn foo(x: *const i32) -> &'static i32 { unsafe { &*x } }
diff --git a/tests/ui/mir/issue-109004-drop-large-array.rs b/tests/ui/mir/issue-109004-drop-large-array.rs
new file mode 100644
index 000000000..5e3361cef
--- /dev/null
+++ b/tests/ui/mir/issue-109004-drop-large-array.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+const SZ: usize = 64_000_000;
+type BigDrop = [String; SZ];
+
+fn f(_dropme: BigDrop) {}
+
+fn f2(_moveme: BigDrop) -> String {
+ let [a, ..] = _moveme;
+ a
+}
+
+fn main() {
+ f(std::array::from_fn(|_| String::new()));
+ f2(std::array::from_fn(|_| String::new()));
+}
diff --git a/tests/ui/mir/mir_alignment_check.rs b/tests/ui/mir/mir_alignment_check.rs
new file mode 100644
index 000000000..68a5384b3
--- /dev/null
+++ b/tests/ui/mir/mir_alignment_check.rs
@@ -0,0 +1,12 @@
+// run-fail
+// ignore-wasm32-bare: No panic messages
+// compile-flags: -C debug-assertions
+// error-pattern: misaligned pointer dereference: address must be a multiple of 0x4 but is
+
+fn main() {
+ let mut x = [0u32; 2];
+ let ptr: *mut u8 = x.as_mut_ptr().cast::<u8>();
+ unsafe {
+ *(ptr.add(1).cast::<u32>()) = 42;
+ }
+}
diff --git a/tests/ui/mir/mir_boxing.rs b/tests/ui/mir/mir_boxing.rs
deleted file mode 100644
index 83e1cfb64..000000000
--- a/tests/ui/mir/mir_boxing.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// run-pass
-#![feature(box_syntax)]
-
-fn test() -> Box<i32> {
- box 42
-}
-
-fn main() {
- assert_eq!(*test(), 42);
-}
diff --git a/tests/ui/mir/unsize-trait.rs b/tests/ui/mir/unsize-trait.rs
new file mode 100644
index 000000000..45b5308c0
--- /dev/null
+++ b/tests/ui/mir/unsize-trait.rs
@@ -0,0 +1,15 @@
+// Check that the interpreter does not ICE when trying to unsize `B` to `[u8]`.
+// This is a `build` test to ensure that const-prop-lint runs.
+// build-pass
+
+#![feature(unsize)]
+
+fn foo<B>(buffer: &mut [B; 2])
+ where B: std::marker::Unsize<[u8]>,
+{
+ let buffer: &[u8] = &buffer[0];
+}
+
+fn main() {
+ foo(&mut [[0], [5]]);
+}
diff --git a/tests/ui/mir/validate/transmute_cast_sized.rs b/tests/ui/mir/validate/transmute_cast_sized.rs
new file mode 100644
index 000000000..eaaf7eb3e
--- /dev/null
+++ b/tests/ui/mir/validate/transmute_cast_sized.rs
@@ -0,0 +1,17 @@
+// build-pass
+// compile-flags: -Zvalidate-mir
+// edition: 2021
+
+#![crate_type = "lib"]
+
+// Use `PhantomData` to get target-independent size
+async fn get(_r: std::marker::PhantomData<&i32>) {
+ loop {}
+}
+
+pub fn check() {
+ let mut v = get(loop {});
+ let _ = || unsafe {
+ v = std::mem::transmute([0_u8; 1]);
+ };
+}
diff --git a/tests/ui/mismatched_types/method-help-unsatisfied-bound.stderr b/tests/ui/mismatched_types/method-help-unsatisfied-bound.stderr
index d3b752507..9dab3e522 100644
--- a/tests/ui/mismatched_types/method-help-unsatisfied-bound.stderr
+++ b/tests/ui/mismatched_types/method-help-unsatisfied-bound.stderr
@@ -10,7 +10,8 @@ note: required by a bound in `Result::<T, E>::unwrap`
--> $SRC_DIR/core/src/result.rs:LL:COL
help: consider annotating `Foo` with `#[derive(Debug)]`
|
-LL | #[derive(Debug)]
+LL + #[derive(Debug)]
+LL | struct Foo;
|
error: aborting due to previous error
diff --git a/tests/ui/missing/missing-items/missing-const-parameter.rs b/tests/ui/missing/missing-items/missing-const-parameter.rs
new file mode 100644
index 000000000..a3af88f26
--- /dev/null
+++ b/tests/ui/missing/missing-items/missing-const-parameter.rs
@@ -0,0 +1,24 @@
+struct Struct<const N: usize>;
+
+impl Struct<{ N }> {}
+//~^ ERROR cannot find value `N` in this scope
+//~| HELP you might be missing a const parameter
+
+fn func0(_: Struct<{ N }>) {}
+//~^ ERROR cannot find value `N` in this scope
+//~| HELP you might be missing a const parameter
+
+fn func1(_: [u8; N]) {}
+//~^ ERROR cannot find value `N` in this scope
+//~| HELP you might be missing a const parameter
+
+fn func2<T>(_: [T; N]) {}
+//~^ ERROR cannot find value `N` in this scope
+//~| HELP you might be missing a const parameter
+
+struct Image<const R: usize>([[u32; C]; R]);
+//~^ ERROR cannot find value `C` in this scope
+//~| HELP a const parameter with a similar name exists
+//~| HELP you might be missing a const parameter
+
+fn main() {}
diff --git a/tests/ui/missing/missing-items/missing-const-parameter.stderr b/tests/ui/missing/missing-items/missing-const-parameter.stderr
new file mode 100644
index 000000000..d9fea1306
--- /dev/null
+++ b/tests/ui/missing/missing-items/missing-const-parameter.stderr
@@ -0,0 +1,64 @@
+error[E0425]: cannot find value `N` in this scope
+ --> $DIR/missing-const-parameter.rs:3:15
+ |
+LL | impl Struct<{ N }> {}
+ | ^ not found in this scope
+ |
+help: you might be missing a const parameter
+ |
+LL | impl<const N: /* Type */> Struct<{ N }> {}
+ | +++++++++++++++++++++
+
+error[E0425]: cannot find value `N` in this scope
+ --> $DIR/missing-const-parameter.rs:7:22
+ |
+LL | fn func0(_: Struct<{ N }>) {}
+ | ^ not found in this scope
+ |
+help: you might be missing a const parameter
+ |
+LL | fn func0<const N: /* Type */>(_: Struct<{ N }>) {}
+ | +++++++++++++++++++++
+
+error[E0425]: cannot find value `N` in this scope
+ --> $DIR/missing-const-parameter.rs:11:18
+ |
+LL | fn func1(_: [u8; N]) {}
+ | ^ not found in this scope
+ |
+help: you might be missing a const parameter
+ |
+LL | fn func1<const N: /* Type */>(_: [u8; N]) {}
+ | +++++++++++++++++++++
+
+error[E0425]: cannot find value `N` in this scope
+ --> $DIR/missing-const-parameter.rs:15:20
+ |
+LL | fn func2<T>(_: [T; N]) {}
+ | ^ not found in this scope
+ |
+help: you might be missing a const parameter
+ |
+LL | fn func2<T, const N: /* Type */>(_: [T; N]) {}
+ | +++++++++++++++++++++
+
+error[E0425]: cannot find value `C` in this scope
+ --> $DIR/missing-const-parameter.rs:19:37
+ |
+LL | struct Image<const R: usize>([[u32; C]; R]);
+ | - ^
+ | |
+ | similarly named const parameter `R` defined here
+ |
+help: a const parameter with a similar name exists
+ |
+LL | struct Image<const R: usize>([[u32; R]; R]);
+ | ~
+help: you might be missing a const parameter
+ |
+LL | struct Image<const R: usize, const C: /* Type */>([[u32; C]; R]);
+ | +++++++++++++++++++++
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/modules/issue-107649.stderr b/tests/ui/modules/issue-107649.stderr
index 1cea71f28..38a910b57 100644
--- a/tests/ui/modules/issue-107649.stderr
+++ b/tests/ui/modules/issue-107649.stderr
@@ -10,7 +10,8 @@ error[E0277]: `Dummy` doesn't implement `Debug`
help: consider annotating `Dummy` with `#[derive(Debug)]`
--> $DIR/auxiliary/dummy_lib.rs:2:1
|
-2 | #[derive(Debug)]
+2 + #[derive(Debug)]
+3 | #[path = "auxiliary/dummy_lib.rs"]
|
error: aborting due to previous error
diff --git a/tests/ui/modules/mod_dir_implicit.rs b/tests/ui/modules/mod_dir_implicit.rs
index d6ea6a98b..7eac90f4d 100644
--- a/tests/ui/modules/mod_dir_implicit.rs
+++ b/tests/ui/modules/mod_dir_implicit.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
mod mod_dir_implicit_aux;
diff --git a/tests/ui/modules/mod_dir_path.rs b/tests/ui/modules/mod_dir_path.rs
index 70f592d0c..72db8e44b 100644
--- a/tests/ui/modules/mod_dir_path.rs
+++ b/tests/ui/modules/mod_dir_path.rs
@@ -1,6 +1,5 @@
// run-pass
#![allow(unused_macros)]
-// ignore-pretty issue #37195
mod mod_dir_simple {
#[path = "test.rs"]
diff --git a/tests/ui/modules/mod_dir_path2.rs b/tests/ui/modules/mod_dir_path2.rs
index c3e3e1d63..b4f8f1c84 100644
--- a/tests/ui/modules/mod_dir_path2.rs
+++ b/tests/ui/modules/mod_dir_path2.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
#[path = "mod_dir_simple"]
mod pancakes {
diff --git a/tests/ui/modules/mod_dir_path3.rs b/tests/ui/modules/mod_dir_path3.rs
index fed70c1bc..56980c010 100644
--- a/tests/ui/modules/mod_dir_path3.rs
+++ b/tests/ui/modules/mod_dir_path3.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
#[path = "mod_dir_simple"]
mod pancakes {
diff --git a/tests/ui/modules/mod_dir_path_multi.rs b/tests/ui/modules/mod_dir_path_multi.rs
index 2b805141a..1c111294a 100644
--- a/tests/ui/modules/mod_dir_path_multi.rs
+++ b/tests/ui/modules/mod_dir_path_multi.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
#[path = "mod_dir_simple"]
mod biscuits {
diff --git a/tests/ui/modules/mod_dir_recursive.rs b/tests/ui/modules/mod_dir_recursive.rs
index b109d13d1..56f261398 100644
--- a/tests/ui/modules/mod_dir_recursive.rs
+++ b/tests/ui/modules/mod_dir_recursive.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
// Testing that the parser for each file tracks its modules
// and paths independently. The load_another_mod module should
diff --git a/tests/ui/modules/mod_dir_simple.rs b/tests/ui/modules/mod_dir_simple.rs
index 1d92c968a..56f15b1d6 100644
--- a/tests/ui/modules/mod_dir_simple.rs
+++ b/tests/ui/modules/mod_dir_simple.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
mod mod_dir_simple {
pub mod test;
diff --git a/tests/ui/modules/mod_file.rs b/tests/ui/modules/mod_file.rs
index 0ca52889e..7b56b99eb 100644
--- a/tests/ui/modules/mod_file.rs
+++ b/tests/ui/modules/mod_file.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
// Testing that a plain .rs file can load modules from other source files
diff --git a/tests/ui/modules/mod_file_with_path_attr.rs b/tests/ui/modules/mod_file_with_path_attr.rs
index 48e253ead..e73936695 100644
--- a/tests/ui/modules/mod_file_with_path_attr.rs
+++ b/tests/ui/modules/mod_file_with_path_attr.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty issue #37195
// Testing that a plain .rs file can load modules from other source files
diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig_aux/compiletest-ignore-dir b/tests/ui/modules_and_files_visibility/mod_file_disambig_aux/compiletest-ignore-dir
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/ui/modules_and_files_visibility/mod_file_disambig_aux/compiletest-ignore-dir
diff --git a/tests/ui-fulldeps/myriad-closures.rs b/tests/ui/myriad-closures.rs
index 310351f50..310351f50 100644
--- a/tests/ui-fulldeps/myriad-closures.rs
+++ b/tests/ui/myriad-closures.rs
diff --git a/tests/ui/namespace/namespace-mix.stderr b/tests/ui/namespace/namespace-mix.stderr
index cb72d4a1c..3ac5e96c5 100644
--- a/tests/ui/namespace/namespace-mix.stderr
+++ b/tests/ui/namespace/namespace-mix.stderr
@@ -14,9 +14,9 @@ LL | check(m1::TS);
| ~~
help: consider importing one of these items instead
|
-LL | use m2::S;
+LL + use m2::S;
|
-LL | use xm2::S;
+LL + use xm2::S;
|
help: if you import `S`, refer to it directly
|
@@ -42,9 +42,9 @@ LL | check(xm1::TS);
| ~~
help: consider importing one of these items instead
|
-LL | use m2::S;
+LL + use m2::S;
|
-LL | use xm2::S;
+LL + use xm2::S;
|
help: if you import `S`, refer to it directly
|
@@ -68,9 +68,9 @@ LL | check(m7::TV);
| ~~
help: consider importing one of these items instead
|
-LL | use m8::V;
+LL + use m8::V;
|
-LL | use xm8::V;
+LL + use xm8::V;
|
help: if you import `V`, refer to it directly
|
@@ -96,9 +96,9 @@ LL | check(xm7::TV);
| ~~
help: consider importing one of these items instead
|
-LL | use m8::V;
+LL + use m8::V;
|
-LL | use xm8::V;
+LL + use xm8::V;
|
help: if you import `V`, refer to it directly
|
diff --git a/tests/ui/never_type/exhaustive_patterns.stderr b/tests/ui/never_type/exhaustive_patterns.stderr
index 40c7c1d10..5fed903eb 100644
--- a/tests/ui/never_type/exhaustive_patterns.stderr
+++ b/tests/ui/never_type/exhaustive_patterns.stderr
@@ -17,8 +17,8 @@ LL | B(inner::Wrapper<B>),
= note: the matched value is of type `Either<(), !>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
-LL | if let Either::A(()) = foo() { todo!() }
- | ++ ~~~~~~~~~~~
+LL | if let Either::A(()) = foo() { todo!() };
+ | ++ +++++++++++
error: aborting due to previous error
diff --git a/tests/ui/never_type/issue-52443.rs b/tests/ui/never_type/issue-52443.rs
index 0498a8a16..4669d7c1a 100644
--- a/tests/ui/never_type/issue-52443.rs
+++ b/tests/ui/never_type/issue-52443.rs
@@ -11,4 +11,5 @@ fn main() {
//~| ERROR cannot convert
//~| ERROR mutable references
//~| ERROR cannot call
+ //~| ERROR the trait bound
}
diff --git a/tests/ui/never_type/issue-52443.stderr b/tests/ui/never_type/issue-52443.stderr
index 99dfce869..1233bdc5d 100644
--- a/tests/ui/never_type/issue-52443.stderr
+++ b/tests/ui/never_type/issue-52443.stderr
@@ -58,6 +58,19 @@ LL | [(); { for _ in 0usize.. {}; 0}];
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+error[E0277]: the trait bound `RangeFrom<usize>: Iterator` is not satisfied
+ --> $DIR/issue-52443.rs:9:21
+ |
+LL | [(); { for _ in 0usize.. {}; 0}];
+ | ^^^^^^^^ `RangeFrom<usize>` is not an iterator
+ |
+ = help: the trait `~const Iterator` is not implemented for `RangeFrom<usize>`
+note: the trait `Iterator` is implemented for `RangeFrom<usize>`, but that implementation is not `const`
+ --> $DIR/issue-52443.rs:9:21
+ |
+LL | [(); { for _ in 0usize.. {}; 0}];
+ | ^^^^^^^^
+
error[E0015]: cannot call non-const fn `<RangeFrom<usize> as Iterator>::next` in constants
--> $DIR/issue-52443.rs:9:21
|
@@ -67,7 +80,7 @@ LL | [(); { for _ in 0usize.. {}; 0}];
= note: calls in constants 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 6 previous errors; 1 warning emitted
+error: aborting due to 7 previous errors; 1 warning emitted
-Some errors have detailed explanations: E0015, E0308, E0658.
+Some errors have detailed explanations: E0015, E0277, E0308, E0658.
For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr
index 363ddfaff..c0d95ddaa 100644
--- a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr
+++ b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr
@@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
|
= note: defining type: test::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None)), Region(BrAnon(2, None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) i32)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) i32)),
(),
]
diff --git a/tests/ui/nll/closure-requirements/escape-argument.stderr b/tests/ui/nll/closure-requirements/escape-argument.stderr
index 5a8462d4d..61e2a1ea6 100644
--- a/tests/ui/nll/closure-requirements/escape-argument.stderr
+++ b/tests/ui/nll/closure-requirements/escape-argument.stderr
@@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
|
= note: defining type: test::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) i32)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) i32)),
(),
]
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
index 7da6ce58b..5a7b12732 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
@@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, _outlives3, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
(),
]
= note: late-bound region is '_#4r
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr
index 993687605..db2ecc779 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr
@@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None)), Region(BrAnon(2, None)), Region(BrAnon(3, None)), Region(BrAnon(4, None)), Region(BrAnon(5, None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
(),
]
= note: late-bound region is '_#3r
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
index 721cd45de..1d9dafbe5 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
@@ -6,7 +6,7 @@ LL | foo(cell, |cell_a, cell_x| {
|
= note: defining type: case1::{closure#0} with closure substs [
i32,
- for<Region(BrAnon(0, None))> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>)),
+ for<Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>)),
(),
]
@@ -36,7 +36,7 @@ LL | foo(cell, |cell_a, cell_x| {
|
= note: defining type: case2::{closure#0} with closure substs [
i32,
- for<Region(BrAnon(0, None))> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>)),
+ for<Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>)),
(),
]
= note: number of external vids: 2
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
index 43dfc3bb9..85f7fe35c 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
@@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None)), Region(BrAnon(2, None)), Region(BrAnon(3, None)), Region(BrAnon(4, None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) u32>)),
(),
]
= note: late-bound region is '_#2r
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
index 96c734226..7194843e2 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
@@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None)), Region(BrAnon(2, None)), Region(BrAnon(3, None)), Region(BrAnon(4, None)), Region(BrAnon(5, None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
(),
]
= note: late-bound region is '_#3r
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr
index 03dbd686e..71f8a1c67 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr
@@ -6,7 +6,7 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
|
= note: defining type: test::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
(),
]
= note: late-bound region is '_#3r
diff --git a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
index d716d3de2..e1cb97b1c 100644
--- a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
@@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
(),
]
= note: late-bound region is '_#3r
diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
index b924873fc..b66e8391c 100644
--- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
@@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None)), Region(BrAnon(2, None)), Region(BrAnon(3, None)), Region(BrAnon(4, None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>)),
(),
]
= note: late-bound region is '_#2r
diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
index 9b25efd0b..49641fd06 100644
--- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
@@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None)), Region(BrAnon(2, None)), Region(BrAnon(3, None)), Region(BrAnon(4, None)), Region(BrAnon(5, None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>)),
+ for<Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(None) }) u32>)),
(),
]
= note: late-bound region is '_#3r
diff --git a/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr
index 6db72b886..4e34ba516 100644
--- a/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr
+++ b/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr
@@ -6,7 +6,7 @@ LL | expect_sig(|a, b| b); // ought to return `a`
|
= note: defining type: test::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) i32)) -> &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) i32,
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) i32)) -> &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) i32,
(),
]
diff --git a/tests/ui/nll/issue-78561.rs b/tests/ui/nll/issue-78561.rs
index 55147fcd1..1a2a3ca56 100644
--- a/tests/ui/nll/issue-78561.rs
+++ b/tests/ui/nll/issue-78561.rs
@@ -1,5 +1,5 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Trait {
type A;
diff --git a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
index 7fcb68252..da4b9595c 100644
--- a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
+++ b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr
@@ -1,16 +1,16 @@
-error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::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(0, 'a), T, ReEarlyBound(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> {
| -- ------------ opaque type defined here
| |
- | hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_)) T` captures the anonymous lifetime defined here
+ | hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) T` captures the anonymous lifetime defined here
LL | x
| ^
|
-help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))` lifetime bound
+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
|
-LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_)) {
+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::'_), '_)) {
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
index a442cf12d..2c4a05975 100644
--- a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
+++ b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
@@ -6,7 +6,7 @@ LL | twice(cell, value, |a, b| invoke(a, b));
|
= note: defining type: generic::<T>::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) T)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) T)),
(),
]
= note: number of external vids: 2
@@ -28,7 +28,7 @@ LL | twice(cell, value, |a, b| invoke(a, b));
|
= note: defining type: generic_fail::<T>::{closure#0} with closure substs [
i16,
- for<Region(BrAnon(0, None)), Region(BrAnon(1, None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) T)),
+ for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) T)),
(),
]
= note: late-bound region is '_#2r
diff --git a/tests/ui/nll/user-annotations/region-error-ice-109072.rs b/tests/ui/nll/user-annotations/region-error-ice-109072.rs
new file mode 100644
index 000000000..3f2ad3ccb
--- /dev/null
+++ b/tests/ui/nll/user-annotations/region-error-ice-109072.rs
@@ -0,0 +1,14 @@
+// Regression test for #109072.
+// Check that we don't ICE when canonicalizing user annotation.
+
+trait Lt<'a> {
+ type T;
+}
+
+impl Lt<'missing> for () { //~ ERROR undeclared lifetime
+ type T = &'missing (); //~ ERROR undeclared lifetime
+}
+
+fn main() {
+ let _: <() as Lt<'_>>::T = &();
+}
diff --git a/tests/ui/nll/user-annotations/region-error-ice-109072.stderr b/tests/ui/nll/user-annotations/region-error-ice-109072.stderr
new file mode 100644
index 000000000..d90971bed
--- /dev/null
+++ b/tests/ui/nll/user-annotations/region-error-ice-109072.stderr
@@ -0,0 +1,26 @@
+error[E0261]: use of undeclared lifetime name `'missing`
+ --> $DIR/region-error-ice-109072.rs:8:9
+ |
+LL | impl Lt<'missing> for () {
+ | - ^^^^^^^^ undeclared lifetime
+ | |
+ | help: consider introducing lifetime `'missing` here: `<'missing>`
+
+error[E0261]: use of undeclared lifetime name `'missing`
+ --> $DIR/region-error-ice-109072.rs:9:15
+ |
+LL | type T = &'missing ();
+ | ^^^^^^^^ undeclared lifetime
+ |
+help: consider introducing lifetime `'missing` here
+ |
+LL | type T<'missing> = &'missing ();
+ | ++++++++++
+help: consider introducing lifetime `'missing` here
+ |
+LL | impl<'missing> Lt<'missing> for () {
+ | ++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/non_modrs_mods/non_modrs_mods.rs b/tests/ui/non_modrs_mods/non_modrs_mods.rs
index f664b0166..b3fa39008 100644
--- a/tests/ui/non_modrs_mods/non_modrs_mods.rs
+++ b/tests/ui/non_modrs_mods/non_modrs_mods.rs
@@ -1,6 +1,5 @@
// run-pass
//
-// ignore-pretty issue #37195
pub mod modrs_mod;
pub mod foors_mod;
#[path = "some_crazy_attr_mod_dir/arbitrary_name.rs"]
diff --git a/tests/ui/non_modrs_mods_and_inline_mods/x/y/z/compiletest-ignore-dir b/tests/ui/non_modrs_mods_and_inline_mods/x/y/z/compiletest-ignore-dir
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/ui/non_modrs_mods_and_inline_mods/x/y/z/compiletest-ignore-dir
diff --git a/tests/ui/not-clone-closure.stderr b/tests/ui/not-clone-closure.stderr
index 37d94cf0e..db9307c61 100644
--- a/tests/ui/not-clone-closure.stderr
+++ b/tests/ui/not-clone-closure.stderr
@@ -14,7 +14,8 @@ LL | let hello = move || {
| ^^^^^^^
help: consider annotating `S` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct S(i32);
|
error: aborting due to previous error
diff --git a/tests/ui/on-unimplemented/no-debug.stderr b/tests/ui/on-unimplemented/no-debug.stderr
index 1035da54d..97d67dbd8 100644
--- a/tests/ui/on-unimplemented/no-debug.stderr
+++ b/tests/ui/on-unimplemented/no-debug.stderr
@@ -9,7 +9,8 @@ LL | println!("{:?} {:?}", Foo, Bar);
= 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)
help: consider annotating `Foo` with `#[derive(Debug)]`
|
-LL | #[derive(Debug)]
+LL + #[derive(Debug)]
+LL | struct Foo;
|
error[E0277]: `Bar` doesn't implement `Debug`
diff --git a/tests/ui/opt-in-copy.rs b/tests/ui/opt-in-copy.rs
index 0b48418e4..d0257b574 100644
--- a/tests/ui/opt-in-copy.rs
+++ b/tests/ui/opt-in-copy.rs
@@ -5,7 +5,7 @@ struct IWantToCopyThis {
}
impl Copy for IWantToCopyThis {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
enum CantCopyThisEither {
A,
@@ -17,6 +17,6 @@ enum IWantToCopyThisToo {
}
impl Copy for IWantToCopyThisToo {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
fn main() {}
diff --git a/tests/ui/opt-in-copy.stderr b/tests/ui/opt-in-copy.stderr
index 4461567df..258ff16e6 100644
--- a/tests/ui/opt-in-copy.stderr
+++ b/tests/ui/opt-in-copy.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/opt-in-copy.rs:7:15
|
LL | but_i_cant: CantCopyThis,
@@ -7,7 +7,7 @@ LL | but_i_cant: CantCopyThis,
LL | impl Copy for IWantToCopyThis {}
| ^^^^^^^^^^^^^^^
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/opt-in-copy.rs:19:15
|
LL | ButICant(CantCopyThisEither),
diff --git a/tests/ui/or-patterns/exhaustiveness-non-exhaustive.stderr b/tests/ui/or-patterns/exhaustiveness-non-exhaustive.stderr
index 9aa808e6b..9f691aea8 100644
--- a/tests/ui/or-patterns/exhaustiveness-non-exhaustive.stderr
+++ b/tests/ui/or-patterns/exhaustiveness-non-exhaustive.stderr
@@ -7,7 +7,7 @@ LL | match (0u8, 0u8) {
= note: the matched value is of type `(u8, u8)`
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 ~ (0 | 1, 2 | 3) => {}
+LL ~ (0 | 1, 2 | 3) => {},
LL + (2_u8..=u8::MAX, _) => todo!()
|
@@ -20,7 +20,7 @@ LL | match ((0u8,),) {
= note: the matched value is of type `((u8,),)`
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 ~ ((0 | 1,) | (2 | 3,),) => {}
+LL ~ ((0 | 1,) | (2 | 3,),) => {},
LL + ((4_u8..=u8::MAX)) => todo!()
|
@@ -33,7 +33,7 @@ LL | match (Some(0u8),) {
= note: the matched value is of type `(Option<u8>,)`
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 ~ (None | Some(0 | 1),) => {}
+LL ~ (None | Some(0 | 1),) => {},
LL + (Some(2_u8..=u8::MAX)) => todo!()
|
diff --git a/tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr b/tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr
index 4adcf4fee..fdb1a9bb4 100644
--- a/tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr
+++ b/tests/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr
@@ -9,8 +9,8 @@ LL | let (0 | (1 | 2)) = 0;
= note: the matched value is of type `i32`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | if let (0 | (1 | 2)) = 0 { todo!() }
- | ++ ~~~~~~~~~~~
+LL | if let (0 | (1 | 2)) = 0 { todo!() };
+ | ++ +++++++++++
error[E0004]: non-exhaustive patterns: `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered
--> $DIR/issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs:3:11
@@ -21,7 +21,7 @@ LL | match 0 {
= note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
-LL ~ 0 | (1 | 2) => {}
+LL ~ 0 | (1 | 2) => {},
LL + i32::MIN..=-1_i32 | 3_i32..=i32::MAX => todo!()
|
diff --git a/tests/ui/panic-runtime/unwind-tables-target-required.rs b/tests/ui/panic-runtime/unwind-tables-target-required.rs
index 3abb52b67..5a90b314a 100644
--- a/tests/ui/panic-runtime/unwind-tables-target-required.rs
+++ b/tests/ui/panic-runtime/unwind-tables-target-required.rs
@@ -1,10 +1,11 @@
// Tests that the compiler errors if the user tries to turn off unwind tables
// when they are required.
//
-// only-x86_64-windows-msvc
+// only-x86_64-pc-windows-msvc
// compile-flags: -C force-unwind-tables=no
//
-// error-pattern: target requires unwind tables, they cannot be disabled with `-C force-unwind-tables=no`.
+// dont-check-compiler-stderr
+// error-pattern: target requires unwind tables, they cannot be disabled with `-C force-unwind-tables=no`
pub fn main() {
}
diff --git a/tests/ui/parser/assoc-static-semantic-fail.rs b/tests/ui/parser/assoc-static-semantic-fail.rs
index a8759d209..403160f12 100644
--- a/tests/ui/parser/assoc-static-semantic-fail.rs
+++ b/tests/ui/parser/assoc-static-semantic-fail.rs
@@ -31,7 +31,7 @@ trait T {
//~| ERROR a static item cannot be `default`
pub(crate) default static TD: u8;
//~^ ERROR associated `static` items are not allowed
- //~| ERROR unnecessary visibility qualifier
+ //~| ERROR visibility qualifiers are not permitted here
//~| ERROR a static item cannot be `default`
}
@@ -47,6 +47,6 @@ impl T for S {
pub default static TD: u8;
//~^ ERROR associated `static` items are not allowed
//~| ERROR associated constant in `impl` without body
- //~| ERROR unnecessary visibility qualifier
+ //~| ERROR visibility qualifiers are not permitted here
//~| ERROR a static item cannot be `default`
}
diff --git a/tests/ui/parser/assoc-static-semantic-fail.stderr b/tests/ui/parser/assoc-static-semantic-fail.stderr
index 8a74f49b9..8178bd223 100644
--- a/tests/ui/parser/assoc-static-semantic-fail.stderr
+++ b/tests/ui/parser/assoc-static-semantic-fail.stderr
@@ -134,11 +134,13 @@ LL | pub(crate) default static ID: u8;
| |
| help: provide a definition for the constant: `= <expr>;`
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/assoc-static-semantic-fail.rs:32:5
|
LL | pub(crate) default static TD: u8;
| ^^^^^^^^^^
+ |
+ = note: trait items always share the visibility of their trait
error: associated constant in `impl` without body
--> $DIR/assoc-static-semantic-fail.rs:41:5
@@ -156,11 +158,13 @@ LL | pub default static TD: u8;
| |
| help: provide a definition for the constant: `= <expr>;`
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/assoc-static-semantic-fail.rs:47:5
|
LL | pub default static TD: u8;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/assoc-static-semantic-fail.rs:3:12
diff --git a/tests/ui/parser/attr-stmt-expr-attr-bad.rs b/tests/ui/parser/attr-stmt-expr-attr-bad.rs
index 469c3855c..c94a32146 100644
--- a/tests/ui/parser/attr-stmt-expr-attr-bad.rs
+++ b/tests/ui/parser/attr-stmt-expr-attr-bad.rs
@@ -1,7 +1,5 @@
fn main() {}
-#[cfg(FALSE)] fn e() { let _ = box #![attr] 0; }
-//~^ ERROR an inner attribute is not permitted in this context
#[cfg(FALSE)] fn e() { let _ = [#[attr]]; }
//~^ ERROR expected expression, found `]`
#[cfg(FALSE)] fn e() { let _ = foo#[attr](); }
diff --git a/tests/ui/parser/attr-stmt-expr-attr-bad.stderr b/tests/ui/parser/attr-stmt-expr-attr-bad.stderr
index 872c560cb..a857f11fd 100644
--- a/tests/ui/parser/attr-stmt-expr-attr-bad.stderr
+++ b/tests/ui/parser/attr-stmt-expr-attr-bad.stderr
@@ -1,26 +1,17 @@
-error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:3:36
- |
-LL | #[cfg(FALSE)] fn e() { let _ = box #![attr] 0; }
- | ^^^^^^^^
- |
- = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
- = note: outer attributes, like `#[test]`, annotate the item following them
-
error: expected expression, found `]`
- --> $DIR/attr-stmt-expr-attr-bad.rs:5:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:3:40
|
LL | #[cfg(FALSE)] fn e() { let _ = [#[attr]]; }
| ^ expected expression
error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:7:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:5:35
|
LL | #[cfg(FALSE)] fn e() { let _ = foo#[attr](); }
| ^ expected one of 8 possible tokens
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:9:36
+ --> $DIR/attr-stmt-expr-attr-bad.rs:7:36
|
LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
| ^^^^^^^^
@@ -29,13 +20,13 @@ LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
= note: outer attributes, like `#[test]`, annotate the item following them
error: expected expression, found `)`
- --> $DIR/attr-stmt-expr-attr-bad.rs:9:44
+ --> $DIR/attr-stmt-expr-attr-bad.rs:7:44
|
LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
| ^ expected expression
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:12:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:10:38
|
LL | #[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
| ^^^^^^^^
@@ -44,13 +35,13 @@ LL | #[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
= note: outer attributes, like `#[test]`, annotate the item following them
error: expected expression, found `)`
- --> $DIR/attr-stmt-expr-attr-bad.rs:12:46
+ --> $DIR/attr-stmt-expr-attr-bad.rs:10:46
|
LL | #[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
| ^ expected expression
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:15:36
+ --> $DIR/attr-stmt-expr-attr-bad.rs:13:36
|
LL | #[cfg(FALSE)] fn e() { let _ = 0 + #![attr] 0; }
| ^^^^^^^^
@@ -59,7 +50,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = 0 + #![attr] 0; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:17:33
+ --> $DIR/attr-stmt-expr-attr-bad.rs:15:33
|
LL | #[cfg(FALSE)] fn e() { let _ = !#![attr] 0; }
| ^^^^^^^^
@@ -68,7 +59,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = !#![attr] 0; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:19:33
+ --> $DIR/attr-stmt-expr-attr-bad.rs:17:33
|
LL | #[cfg(FALSE)] fn e() { let _ = -#![attr] 0; }
| ^^^^^^^^
@@ -77,13 +68,13 @@ LL | #[cfg(FALSE)] fn e() { let _ = -#![attr] 0; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:21:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:19:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x #![attr] as Y; }
| ^ expected one of 8 possible tokens
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:23:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:21:35
|
LL | #[cfg(FALSE)] fn e() { let _ = || #![attr] foo; }
| ^^^^^^^^
@@ -92,7 +83,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = || #![attr] foo; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:25:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:23:40
|
LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] foo; }
| ^^^^^^^^
@@ -101,7 +92,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] foo; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:27:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:25:35
|
LL | #[cfg(FALSE)] fn e() { let _ = || #![attr] {foo}; }
| ^^^^^^^^
@@ -110,7 +101,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = || #![attr] {foo}; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:29:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:27:40
|
LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] {foo}; }
| ^^^^^^^^
@@ -119,19 +110,19 @@ LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] {foo}; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: expected expression, found `..`
- --> $DIR/attr-stmt-expr-attr-bad.rs:31:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:29:40
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] ..#[attr] 0; }
| ^^ expected expression
error: expected expression, found `..`
- --> $DIR/attr-stmt-expr-attr-bad.rs:33:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:31:40
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] ..; }
| ^^ expected expression
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:35:41
+ --> $DIR/attr-stmt-expr-attr-bad.rs:33:41
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &#![attr] 0; }
| ^^^^^^^^
@@ -140,7 +131,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &#![attr] 0; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:37:45
+ --> $DIR/attr-stmt-expr-attr-bad.rs:35:45
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &mut #![attr] 0; }
| ^^^^^^^^
@@ -149,7 +140,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &mut #![attr] 0; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: outer attributes are not allowed on `if` and `else` branches
- --> $DIR/attr-stmt-expr-attr-bad.rs:39:37
+ --> $DIR/attr-stmt-expr-attr-bad.rs:37:37
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
@@ -158,7 +149,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
| the branch belongs to this `if`
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:41:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:39:38
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {#![attr]}; }
| ^^^^^^^^
@@ -167,13 +158,13 @@ LL | #[cfg(FALSE)] fn e() { let _ = if 0 {#![attr]}; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:43:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:41:40
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} #[attr] else {}; }
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: outer attributes are not allowed on `if` and `else` branches
- --> $DIR/attr-stmt-expr-attr-bad.rs:45:45
+ --> $DIR/attr-stmt-expr-attr-bad.rs:43:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
| ---- ^^^^^^^ -- the attributes are attached to this branch
@@ -182,7 +173,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
| the branch belongs to this `else`
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:47:46
+ --> $DIR/attr-stmt-expr-attr-bad.rs:45:46
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else {#![attr]}; }
| ^^^^^^^^
@@ -191,7 +182,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else {#![attr]}; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: outer attributes are not allowed on `if` and `else` branches
- --> $DIR/attr-stmt-expr-attr-bad.rs:49:45
+ --> $DIR/attr-stmt-expr-attr-bad.rs:47:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
| ---- ^^^^^^^ ------- the attributes are attached to this branch
@@ -200,7 +191,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
| the branch belongs to this `else`
error: outer attributes are not allowed on `if` and `else` branches
- --> $DIR/attr-stmt-expr-attr-bad.rs:51:50
+ --> $DIR/attr-stmt-expr-attr-bad.rs:49:50
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
@@ -209,7 +200,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
| the branch belongs to this `if`
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:53:51
+ --> $DIR/attr-stmt-expr-attr-bad.rs:51:51
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; }
| ^^^^^^^^
@@ -218,7 +209,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: outer attributes are not allowed on `if` and `else` branches
- --> $DIR/attr-stmt-expr-attr-bad.rs:55:45
+ --> $DIR/attr-stmt-expr-attr-bad.rs:53:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
@@ -227,7 +218,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
| the branch belongs to this `if`
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:57:46
+ --> $DIR/attr-stmt-expr-attr-bad.rs:55:46
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {#![attr]}; }
| ^^^^^^^^
@@ -236,13 +227,13 @@ LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {#![attr]}; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:59:48
+ --> $DIR/attr-stmt-expr-attr-bad.rs:57:48
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} #[attr] else {}; }
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: outer attributes are not allowed on `if` and `else` branches
- --> $DIR/attr-stmt-expr-attr-bad.rs:61:53
+ --> $DIR/attr-stmt-expr-attr-bad.rs:59:53
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
| ---- ^^^^^^^ -- the attributes are attached to this branch
@@ -251,7 +242,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
| the branch belongs to this `else`
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:63:54
+ --> $DIR/attr-stmt-expr-attr-bad.rs:61:54
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; }
| ^^^^^^^^
@@ -260,7 +251,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: outer attributes are not allowed on `if` and `else` branches
- --> $DIR/attr-stmt-expr-attr-bad.rs:65:53
+ --> $DIR/attr-stmt-expr-attr-bad.rs:63:53
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
| ---- ^^^^^^^ --------------- the attributes are attached to this branch
@@ -269,7 +260,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}
| the branch belongs to this `else`
error: outer attributes are not allowed on `if` and `else` branches
- --> $DIR/attr-stmt-expr-attr-bad.rs:67:66
+ --> $DIR/attr-stmt-expr-attr-bad.rs:65:66
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
@@ -278,7 +269,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}
| the branch belongs to this `if`
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:69:67
+ --> $DIR/attr-stmt-expr-attr-bad.rs:67:67
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]}; }
| ^^^^^^^^
@@ -287,7 +278,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]}
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted following an outer attribute
- --> $DIR/attr-stmt-expr-attr-bad.rs:72:32
+ --> $DIR/attr-stmt-expr-attr-bad.rs:70:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] let _ = 0; }
| ------- ^^^^^^^^ not permitted following an outer attribute
@@ -298,7 +289,7 @@ LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] let _ = 0; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted following an outer attribute
- --> $DIR/attr-stmt-expr-attr-bad.rs:74:32
+ --> $DIR/attr-stmt-expr-attr-bad.rs:72:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] 0; }
| ------- ^^^^^^^^ not permitted following an outer attribute
@@ -309,7 +300,7 @@ LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] 0; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: an inner attribute is not permitted following an outer attribute
- --> $DIR/attr-stmt-expr-attr-bad.rs:76:32
+ --> $DIR/attr-stmt-expr-attr-bad.rs:74:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!(); }
| ------- ^^^^^^^^ ------- the inner attribute doesn't annotate this item macro invocation
@@ -325,7 +316,7 @@ LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo!(); }
|
error: an inner attribute is not permitted following an outer attribute
- --> $DIR/attr-stmt-expr-attr-bad.rs:78:32
+ --> $DIR/attr-stmt-expr-attr-bad.rs:76:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo![]; }
| ------- ^^^^^^^^ ------- the inner attribute doesn't annotate this item macro invocation
@@ -341,7 +332,7 @@ LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo![]; }
|
error: an inner attribute is not permitted following an outer attribute
- --> $DIR/attr-stmt-expr-attr-bad.rs:80:32
+ --> $DIR/attr-stmt-expr-attr-bad.rs:78:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!{}; }
| ------- ^^^^^^^^ ------ the inner attribute doesn't annotate this item macro invocation
@@ -357,7 +348,7 @@ LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo!{}; }
|
error[E0586]: inclusive range with no end
- --> $DIR/attr-stmt-expr-attr-bad.rs:86:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:84:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
| ^^^ help: use `..` instead
@@ -365,13 +356,13 @@ LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error: expected one of `=>`, `if`, or `|`, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:86:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:84:38
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
| ^ expected one of `=>`, `if`, or `|`
error[E0586]: inclusive range with no end
- --> $DIR/attr-stmt-expr-attr-bad.rs:89:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:87:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
| ^^^ help: use `..` instead
@@ -379,19 +370,19 @@ LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error: expected one of `=>`, `if`, or `|`, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:89:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:87:38
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
| ^ expected one of `=>`, `if`, or `|`
error: unexpected token: `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:92:39
+ --> $DIR/attr-stmt-expr-attr-bad.rs:90:39
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=-#[attr] 10 => () } }
| ^
error[E0586]: inclusive range with no end
- --> $DIR/attr-stmt-expr-attr-bad.rs:94:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:92:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
| ^^^ help: use `..` instead
@@ -399,47 +390,47 @@ LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error: expected one of `=>`, `if`, or `|`, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:94:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:92:38
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
| ^ expected one of `=>`, `if`, or `|`
error: unexpected token: `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:98:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:96:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
| ^
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:98:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:96:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: unexpected token: `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:101:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:99:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
| ^
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
- --> $DIR/attr-stmt-expr-attr-bad.rs:101:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:99:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: expected statement after outer attribute
- --> $DIR/attr-stmt-expr-attr-bad.rs:106:37
+ --> $DIR/attr-stmt-expr-attr-bad.rs:104:37
|
LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr]; } } }
| ^^^^^^^
error: expected statement after outer attribute
- --> $DIR/attr-stmt-expr-attr-bad.rs:108:37
+ --> $DIR/attr-stmt-expr-attr-bad.rs:106:37
|
LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr] } } }
| ^^^^^^^
-error: aborting due to 53 previous errors
+error: aborting due to 52 previous errors
For more information about this error, try `rustc --explain E0586`.
diff --git a/tests/ui/parser/circular_modules_main.stderr b/tests/ui/parser/circular_modules_main.stderr
index 1094def60..2de707893 100644
--- a/tests/ui/parser/circular_modules_main.stderr
+++ b/tests/ui/parser/circular_modules_main.stderr
@@ -12,7 +12,7 @@ LL | println!("{}", circular_modules_main::hi_str());
|
help: consider importing this function
|
-LL | use hi_str;
+LL + use hi_str;
|
help: if you import `hi_str`, refer to it directly
|
diff --git a/tests/ui/parser/default.rs b/tests/ui/parser/default.rs
index 52338c1f1..d1058ceb2 100644
--- a/tests/ui/parser/default.rs
+++ b/tests/ui/parser/default.rs
@@ -14,7 +14,7 @@ impl Foo for u8 {
}
impl Foo for u16 {
- pub default fn foo<T: Default>() -> T { //~ ERROR unnecessary visibility qualifier
+ pub default fn foo<T: Default>() -> T { //~ ERROR visibility qualifiers are not permitted here
T::default()
}
}
diff --git a/tests/ui/parser/default.stderr b/tests/ui/parser/default.stderr
index 37aa48ccf..e6330f368 100644
--- a/tests/ui/parser/default.stderr
+++ b/tests/ui/parser/default.stderr
@@ -17,11 +17,13 @@ LL | default pub fn foo<T: Default>() -> T { T::default() }
LL | }
| - item list ends here
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/default.rs:17:5
|
LL | pub default fn foo<T: Default>() -> T {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default.rs:3:12
diff --git a/tests/ui/parser/dyn-trait-compatibility.rs b/tests/ui/parser/dyn-trait-compatibility.rs
index d2b02cc2a..6341e0532 100644
--- a/tests/ui/parser/dyn-trait-compatibility.rs
+++ b/tests/ui/parser/dyn-trait-compatibility.rs
@@ -9,6 +9,6 @@ type A2 = dyn<dyn, dyn>;
type A3 = dyn<<dyn as dyn>::dyn>;
//~^ ERROR cannot find type `dyn` in this scope
//~| ERROR cannot find type `dyn` in this scope
-//~| ERROR use of undeclared crate or module `dyn`
+//~| ERROR cannot find trait `dyn` in this scope
fn main() {}
diff --git a/tests/ui/parser/dyn-trait-compatibility.stderr b/tests/ui/parser/dyn-trait-compatibility.stderr
index 0cae01bd1..653be5b3b 100644
--- a/tests/ui/parser/dyn-trait-compatibility.stderr
+++ b/tests/ui/parser/dyn-trait-compatibility.stderr
@@ -4,12 +4,6 @@ error[E0433]: failed to resolve: use of undeclared crate or module `dyn`
LL | type A1 = dyn::dyn;
| ^^^ use of undeclared crate or module `dyn`
-error[E0433]: failed to resolve: use of undeclared crate or module `dyn`
- --> $DIR/dyn-trait-compatibility.rs:9:23
- |
-LL | type A3 = dyn<<dyn as dyn>::dyn>;
- | ^^^ use of undeclared crate or module `dyn`
-
error[E0412]: cannot find type `dyn` in this scope
--> $DIR/dyn-trait-compatibility.rs:1:11
|
@@ -40,6 +34,12 @@ error[E0412]: cannot find type `dyn` in this scope
LL | type A3 = dyn<<dyn as dyn>::dyn>;
| ^^^ not found in this scope
+error[E0405]: cannot find trait `dyn` in this scope
+ --> $DIR/dyn-trait-compatibility.rs:9:23
+ |
+LL | type A3 = dyn<<dyn as dyn>::dyn>;
+ | ^^^ not found in this scope
+
error[E0412]: cannot find type `dyn` in this scope
--> $DIR/dyn-trait-compatibility.rs:9:16
|
@@ -48,5 +48,5 @@ LL | type A3 = dyn<<dyn as dyn>::dyn>;
error: aborting due to 8 previous errors
-Some errors have detailed explanations: E0412, E0433.
-For more information about an error, try `rustc --explain E0412`.
+Some errors have detailed explanations: E0405, E0412, E0433.
+For more information about an error, try `rustc --explain E0405`.
diff --git a/tests/ui/parser/fn-header-semantic-fail.rs b/tests/ui/parser/fn-header-semantic-fail.rs
index cf5d3dab4..71f18a27e 100644
--- a/tests/ui/parser/fn-header-semantic-fail.rs
+++ b/tests/ui/parser/fn-header-semantic-fail.rs
@@ -11,7 +11,6 @@ fn main() {
extern "C" fn ff4() {} // OK.
const async unsafe extern "C" fn ff5() {}
//~^ ERROR functions cannot be both `const` and `async`
- //~| ERROR cycle detected
trait X {
async fn ft1(); //~ ERROR functions in traits cannot be declared `async`
@@ -34,7 +33,6 @@ fn main() {
//~^ ERROR functions in traits cannot be declared `async`
//~| ERROR functions in traits cannot be declared const
//~| ERROR functions cannot be both `const` and `async`
- //~| ERROR cycle detected
}
impl Y {
@@ -44,7 +42,6 @@ fn main() {
extern "C" fn fi4() {} // OK.
const async unsafe extern "C" fn fi5() {}
//~^ ERROR functions cannot be both `const` and `async`
- //~| ERROR cycle detected
}
extern "C" {
diff --git a/tests/ui/parser/fn-header-semantic-fail.stderr b/tests/ui/parser/fn-header-semantic-fail.stderr
index 2d8bd19a7..7f7b7e835 100644
--- a/tests/ui/parser/fn-header-semantic-fail.stderr
+++ b/tests/ui/parser/fn-header-semantic-fail.stderr
@@ -8,19 +8,19 @@ LL | const async unsafe extern "C" fn ff5() {}
| `const` because of this
error[E0379]: functions in traits cannot be declared const
- --> $DIR/fn-header-semantic-fail.rs:19:9
+ --> $DIR/fn-header-semantic-fail.rs:18:9
|
LL | const fn ft3();
| ^^^^^ functions in traits cannot be const
error[E0379]: functions in traits cannot be declared const
- --> $DIR/fn-header-semantic-fail.rs:21:9
+ --> $DIR/fn-header-semantic-fail.rs:20:9
|
LL | const async unsafe extern "C" fn ft5();
| ^^^^^ functions in traits cannot be const
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:21:9
+ --> $DIR/fn-header-semantic-fail.rs:20:9
|
LL | const async unsafe extern "C" fn ft5();
| ^^^^^-^^^^^----------------------------
@@ -29,19 +29,19 @@ LL | const async unsafe extern "C" fn ft5();
| `const` because of this
error[E0379]: functions in traits cannot be declared const
- --> $DIR/fn-header-semantic-fail.rs:31:9
+ --> $DIR/fn-header-semantic-fail.rs:30:9
|
LL | const fn ft3() {}
| ^^^^^ functions in traits cannot be const
error[E0379]: functions in traits cannot be declared const
- --> $DIR/fn-header-semantic-fail.rs:33:9
+ --> $DIR/fn-header-semantic-fail.rs:32:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^ functions in traits cannot be const
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:33:9
+ --> $DIR/fn-header-semantic-fail.rs:32:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^-^^^^^------------------------------
@@ -50,7 +50,7 @@ LL | const async unsafe extern "C" fn ft5() {}
| `const` because of this
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:45:9
+ --> $DIR/fn-header-semantic-fail.rs:43:9
|
LL | const async unsafe extern "C" fn fi5() {}
| ^^^^^-^^^^^------------------------------
@@ -59,7 +59,7 @@ LL | const async unsafe extern "C" fn fi5() {}
| `const` because of this
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:51:18
+ --> $DIR/fn-header-semantic-fail.rs:48:18
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -72,7 +72,7 @@ LL | fn fe1();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:52:19
+ --> $DIR/fn-header-semantic-fail.rs:49:19
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -86,7 +86,7 @@ LL | fn fe2();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:53:18
+ --> $DIR/fn-header-semantic-fail.rs:50:18
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -100,7 +100,7 @@ LL | fn fe3();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:54:23
+ --> $DIR/fn-header-semantic-fail.rs:51:23
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -114,7 +114,7 @@ LL | fn fe4();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:55:42
+ --> $DIR/fn-header-semantic-fail.rs:52:42
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -128,7 +128,7 @@ LL | fn fe5();
| ~~
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:55:9
+ --> $DIR/fn-header-semantic-fail.rs:52:9
|
LL | const async unsafe extern "C" fn fe5();
| ^^^^^-^^^^^----------------------------
@@ -137,7 +137,7 @@ LL | const async unsafe extern "C" fn fe5();
| `const` because of this
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:17:9
+ --> $DIR/fn-header-semantic-fail.rs:16:9
|
LL | async fn ft1();
| -----^^^^^^^^^^
@@ -150,7 +150,7 @@ LL | async fn ft1();
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:21:9
+ --> $DIR/fn-header-semantic-fail.rs:20:9
|
LL | const async unsafe extern "C" fn ft5();
| ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -163,7 +163,7 @@ LL | const async unsafe extern "C" fn ft5();
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:29:9
+ --> $DIR/fn-header-semantic-fail.rs:28:9
|
LL | async fn ft1() {}
| -----^^^^^^^^^
@@ -176,7 +176,7 @@ LL | async fn ft1() {}
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:33:9
+ --> $DIR/fn-header-semantic-fail.rs:32:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -188,115 +188,7 @@ LL | const async unsafe extern "C" fn ft5() {}
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
-error[E0391]: cycle detected when computing type of `main::ff5::{opaque#0}`
- --> $DIR/fn-header-semantic-fail.rs:12:44
- |
-LL | const async unsafe extern "C" fn ff5() {}
- | ^
- |
-note: ...which requires borrow-checking `main::ff5`...
- --> $DIR/fn-header-semantic-fail.rs:12:5
- |
-LL | const async unsafe extern "C" fn ff5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `main::ff5`...
- --> $DIR/fn-header-semantic-fail.rs:12:5
- |
-LL | const async unsafe extern "C" fn ff5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `main::ff5`...
- --> $DIR/fn-header-semantic-fail.rs:12:5
- |
-LL | const async unsafe extern "C" fn ff5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: ...which requires computing whether `main::ff5::{opaque#0}` is freeze...
- = note: ...which requires evaluating trait selection obligation `main::ff5::{opaque#0}: core::marker::Freeze`...
- = note: ...which again requires computing type of `main::ff5::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
- --> $DIR/fn-header-semantic-fail.rs:5:1
- |
-LL | / #![feature(const_extern_fn)]
-LL | |
-LL | | fn main() {
-LL | | async fn ff1() {} // OK.
-... |
-LL | | }
-LL | | }
- | |_^
-
-error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}`
- --> $DIR/fn-header-semantic-fail.rs:33:48
- |
-LL | const async unsafe extern "C" fn ft5() {}
- | ^
- |
-note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
- --> $DIR/fn-header-semantic-fail.rs:33:9
- |
-LL | const async unsafe extern "C" fn ft5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
- --> $DIR/fn-header-semantic-fail.rs:33:9
- |
-LL | const async unsafe extern "C" fn ft5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
- --> $DIR/fn-header-semantic-fail.rs:33:9
- |
-LL | const async unsafe extern "C" fn ft5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: ...which requires computing whether `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}` is freeze...
- = note: ...which requires evaluating trait selection obligation `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}: core::marker::Freeze`...
- = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
- --> $DIR/fn-header-semantic-fail.rs:5:1
- |
-LL | / #![feature(const_extern_fn)]
-LL | |
-LL | | fn main() {
-LL | | async fn ff1() {} // OK.
-... |
-LL | | }
-LL | | }
- | |_^
-
-error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5::{opaque#0}`
- --> $DIR/fn-header-semantic-fail.rs:45:48
- |
-LL | const async unsafe extern "C" fn fi5() {}
- | ^
- |
-note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5`...
- --> $DIR/fn-header-semantic-fail.rs:45:9
- |
-LL | const async unsafe extern "C" fn fi5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5`...
- --> $DIR/fn-header-semantic-fail.rs:45:9
- |
-LL | const async unsafe extern "C" fn fi5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5`...
- --> $DIR/fn-header-semantic-fail.rs:45:9
- |
-LL | const async unsafe extern "C" fn fi5() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: ...which requires computing whether `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5::{opaque#0}` is freeze...
- = note: ...which requires evaluating trait selection obligation `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5::{opaque#0}: core::marker::Freeze`...
- = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
- --> $DIR/fn-header-semantic-fail.rs:5:1
- |
-LL | / #![feature(const_extern_fn)]
-LL | |
-LL | | fn main() {
-LL | | async fn ff1() {} // OK.
-... |
-LL | | }
-LL | | }
- | |_^
-
-error: aborting due to 21 previous errors
+error: aborting due to 18 previous errors
-Some errors have detailed explanations: E0379, E0391, E0706.
+Some errors have detailed explanations: E0379, E0706.
For more information about an error, try `rustc --explain E0379`.
diff --git a/tests/ui/parser/ident-recovery.rs b/tests/ui/parser/ident-recovery.rs
new file mode 100644
index 000000000..7575372b9
--- /dev/null
+++ b/tests/ui/parser/ident-recovery.rs
@@ -0,0 +1,16 @@
+fn ,comma() {
+ //~^ ERROR expected identifier, found `,`
+ struct Foo {
+ x: i32,,
+ //~^ ERROR expected identifier, found `,`
+ y: u32,
+ }
+}
+
+fn break() {
+//~^ ERROR expected identifier, found keyword `break`
+ let continue = 5;
+ //~^ ERROR expected identifier, found keyword `continue`
+}
+
+fn main() {}
diff --git a/tests/ui/parser/ident-recovery.stderr b/tests/ui/parser/ident-recovery.stderr
new file mode 100644
index 000000000..e9a55026d
--- /dev/null
+++ b/tests/ui/parser/ident-recovery.stderr
@@ -0,0 +1,42 @@
+error: expected identifier, found `,`
+ --> $DIR/ident-recovery.rs:1:4
+ |
+LL | fn ,comma() {
+ | ^
+ | |
+ | expected identifier
+ | help: remove this comma
+
+error: expected identifier, found `,`
+ --> $DIR/ident-recovery.rs:4:16
+ |
+LL | x: i32,,
+ | ^
+ | |
+ | expected identifier
+ | help: remove this comma
+
+error: expected identifier, found keyword `break`
+ --> $DIR/ident-recovery.rs:10:4
+ |
+LL | fn break() {
+ | ^^^^^ expected identifier, found keyword
+ |
+help: escape `break` to use it as an identifier
+ |
+LL | fn r#break() {
+ | ++
+
+error: expected identifier, found keyword `continue`
+ --> $DIR/ident-recovery.rs:12:9
+ |
+LL | let continue = 5;
+ | ^^^^^^^^ expected identifier, found keyword
+ |
+help: escape `continue` to use it as an identifier
+ |
+LL | let r#continue = 5;
+ | ++
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/ui/parser/integer-literal-start-ident.rs b/tests/ui/parser/integer-literal-start-ident.rs
new file mode 100644
index 000000000..12537482e
--- /dev/null
+++ b/tests/ui/parser/integer-literal-start-ident.rs
@@ -0,0 +1,2 @@
+fn 1main() {}
+//~^ ERROR expected identifier, found `1main`
diff --git a/tests/ui/parser/integer-literal-start-ident.stderr b/tests/ui/parser/integer-literal-start-ident.stderr
new file mode 100644
index 000000000..b2c661296
--- /dev/null
+++ b/tests/ui/parser/integer-literal-start-ident.stderr
@@ -0,0 +1,14 @@
+error: expected identifier, found `1main`
+ --> $DIR/integer-literal-start-ident.rs:1:4
+ |
+LL | fn 1main() {}
+ | ^^^^^ expected identifier
+ |
+help: identifiers cannot start with a number
+ --> $DIR/integer-literal-start-ident.rs:1:4
+ |
+LL | fn 1main() {}
+ | ^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/issues/issue-104088.rs b/tests/ui/parser/issues/issue-104088.rs
index 5f794fe2d..3dc636b6a 100644
--- a/tests/ui/parser/issues/issue-104088.rs
+++ b/tests/ui/parser/issues/issue-104088.rs
@@ -1,26 +1,19 @@
-fn test() {
+fn 1234test() {
+//~^ ERROR expected identifier, found `1234test`
if let 123 = 123 { println!("yes"); }
-}
-
-fn test_2() {
- let 1x = 123;
- //~^ ERROR expected identifier, found number literal
-}
-
-fn test_3() {
- let 2x: i32 = 123;
- //~^ ERROR expected identifier, found number literal
-}
-fn test_4() {
if let 2e1 = 123 {
//~^ ERROR mismatched types
}
-}
-fn test_5() {
let 23name = 123;
- //~^ ERROR expected identifier, found number literal
+ //~^ ERROR expected identifier, found `23name`
+
+ let 2x: i32 = 123;
+ //~^ ERROR expected identifier, found `2x`
+
+ let 1x = 123;
+ //~^ ERROR expected identifier, found `1x`
}
fn main() {}
diff --git a/tests/ui/parser/issues/issue-104088.stderr b/tests/ui/parser/issues/issue-104088.stderr
index ff4b4bdb6..8b751759d 100644
--- a/tests/ui/parser/issues/issue-104088.stderr
+++ b/tests/ui/parser/issues/issue-104088.stderr
@@ -1,29 +1,59 @@
-error: expected identifier, found number literal
- --> $DIR/issue-104088.rs:6:9
+error: expected identifier, found `1234test`
+ --> $DIR/issue-104088.rs:1:4
|
-LL | let 1x = 123;
- | ^^ identifiers cannot start with a number
+LL | fn 1234test() {
+ | ^^^^^^^^ expected identifier
+ |
+help: identifiers cannot start with a number
+ --> $DIR/issue-104088.rs:1:4
+ |
+LL | fn 1234test() {
+ | ^^^^
+
+error: expected identifier, found `23name`
+ --> $DIR/issue-104088.rs:9:9
+ |
+LL | let 23name = 123;
+ | ^^^^^^ expected identifier
+ |
+help: identifiers cannot start with a number
+ --> $DIR/issue-104088.rs:9:9
+ |
+LL | let 23name = 123;
+ | ^^
-error: expected identifier, found number literal
- --> $DIR/issue-104088.rs:11:9
+error: expected identifier, found `2x`
+ --> $DIR/issue-104088.rs:12:9
|
LL | let 2x: i32 = 123;
- | ^^ identifiers cannot start with a number
+ | ^^ expected identifier
+ |
+help: identifiers cannot start with a number
+ --> $DIR/issue-104088.rs:12:9
+ |
+LL | let 2x: i32 = 123;
+ | ^
-error: expected identifier, found number literal
- --> $DIR/issue-104088.rs:22:9
+error: expected identifier, found `1x`
+ --> $DIR/issue-104088.rs:15:9
|
-LL | let 23name = 123;
- | ^^^^^^ identifiers cannot start with a number
+LL | let 1x = 123;
+ | ^^ expected identifier
+ |
+help: identifiers cannot start with a number
+ --> $DIR/issue-104088.rs:15:9
+ |
+LL | let 1x = 123;
+ | ^
error[E0308]: mismatched types
- --> $DIR/issue-104088.rs:16:12
+ --> $DIR/issue-104088.rs:5:12
|
LL | if let 2e1 = 123 {
| ^^^ --- this expression has type `{integer}`
| |
| expected integer, found floating-point number
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/parser/issues/issue-108242-semicolon-recovery.rs b/tests/ui/parser/issues/issue-108242-semicolon-recovery.rs
new file mode 100644
index 000000000..2fc0b2947
--- /dev/null
+++ b/tests/ui/parser/issues/issue-108242-semicolon-recovery.rs
@@ -0,0 +1,5 @@
+fn foo() {}
+fn main() {
+ foo(;
+ foo(;
+} //~ ERROR mismatched closing delimiter
diff --git a/tests/ui/parser/issues/issue-108242-semicolon-recovery.stderr b/tests/ui/parser/issues/issue-108242-semicolon-recovery.stderr
new file mode 100644
index 000000000..f68d6d501
--- /dev/null
+++ b/tests/ui/parser/issues/issue-108242-semicolon-recovery.stderr
@@ -0,0 +1,13 @@
+error: mismatched closing delimiter: `}`
+ --> $DIR/issue-108242-semicolon-recovery.rs:4:8
+ |
+LL | fn main() {
+ | - closing delimiter possibly meant for this
+LL | foo(;
+LL | foo(;
+ | ^ unclosed delimiter
+LL | }
+ | ^ mismatched closing delimiter
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/issues/issue-110014.rs b/tests/ui/parser/issues/issue-110014.rs
new file mode 100644
index 000000000..69d8f402b
--- /dev/null
+++ b/tests/ui/parser/issues/issue-110014.rs
@@ -0,0 +1,3 @@
+fn`2222222222222222222222222222222222222222() {}
+//~^ ERROR unknown start of token: `
+//~^^ ERROR expected identifier, found `2222222222222222222222222222222222222222`
diff --git a/tests/ui/parser/issues/issue-110014.stderr b/tests/ui/parser/issues/issue-110014.stderr
new file mode 100644
index 000000000..7f1dd592e
--- /dev/null
+++ b/tests/ui/parser/issues/issue-110014.stderr
@@ -0,0 +1,19 @@
+error: unknown start of token: `
+ --> $DIR/issue-110014.rs:1:3
+ |
+LL | fn`2222222222222222222222222222222222222222() {}
+ | ^
+ |
+help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
+ |
+LL | fn'2222222222222222222222222222222222222222() {}
+ | ~
+
+error: expected identifier, found `2222222222222222222222222222222222222222`
+ --> $DIR/issue-110014.rs:1:4
+ |
+LL | fn`2222222222222222222222222222222222222222() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/parser/issues/issue-48508.rs b/tests/ui/parser/issues/issue-48508.rs
index 37d04c5d6..1e7db9df8 100644
--- a/tests/ui/parser/issues/issue-48508.rs
+++ b/tests/ui/parser/issues/issue-48508.rs
@@ -7,7 +7,6 @@
// issue-48508-aux.rs
// compile-flags:-g
-// ignore-pretty issue #37195
// ignore-asmjs wasm2js does not support source maps yet
#![allow(uncommon_codepoints)]
diff --git a/tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs b/tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs
index 76c07bbfd..b0e8f4d99 100644
--- a/tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs
+++ b/tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs
@@ -5,11 +5,17 @@
#[allow(unused_macro_rules)]
macro_rules! m {
- ($e:expr) => { 0 }; // This fails on the input below due to `, foo`.
- ($e:expr,) => { 1 }; // This also fails to match due to `foo`.
- (box $e:expr, foo) => { 2 }; // Successful matcher, we should get `2`.
+ ($e:expr) => {
+ 0
+ }; // This fails on the input below due to `, foo`.
+ ($e:expr,) => {
+ 1
+ }; // This also fails to match due to `foo`.
+ (do yeet $e:expr, foo) => {
+ 2
+ }; // Successful matcher, we should get `2`.
}
fn main() {
- assert_eq!(2, m!(box 42, foo));
+ assert_eq!(2, m!(do yeet 42, foo));
}
diff --git a/tests/ui/parser/removed-syntax-box.fixed b/tests/ui/parser/removed-syntax-box.fixed
new file mode 100644
index 000000000..09d1304b7
--- /dev/null
+++ b/tests/ui/parser/removed-syntax-box.fixed
@@ -0,0 +1,14 @@
+// run-rustfix
+
+fn main() {
+ #[allow(dead_code)]
+ struct T {
+ a: u8,
+ b: u8,
+ }
+ let _ = Box::new(()); //~ ERROR `box_syntax` has been removed
+ let _ = Box::new(1); //~ ERROR `box_syntax` has been removed
+ let _ = Box::new(T { a: 12, b: 18 }); //~ ERROR `box_syntax` has been removed
+ let _ = Box::new([5; 30]); //~ ERROR `box_syntax` has been removed
+ let _: Box<()> = Box::new(()); //~ ERROR `box_syntax` has been removed
+}
diff --git a/tests/ui/parser/removed-syntax-box.rs b/tests/ui/parser/removed-syntax-box.rs
new file mode 100644
index 000000000..1f5061b02
--- /dev/null
+++ b/tests/ui/parser/removed-syntax-box.rs
@@ -0,0 +1,14 @@
+// run-rustfix
+
+fn main() {
+ #[allow(dead_code)]
+ struct T {
+ a: u8,
+ b: u8,
+ }
+ let _ = box (); //~ ERROR `box_syntax` has been removed
+ let _ = box 1; //~ ERROR `box_syntax` has been removed
+ let _ = box T { a: 12, b: 18 }; //~ ERROR `box_syntax` has been removed
+ let _ = box [5; 30]; //~ ERROR `box_syntax` has been removed
+ let _: Box<()> = box (); //~ ERROR `box_syntax` has been removed
+}
diff --git a/tests/ui/parser/removed-syntax-box.stderr b/tests/ui/parser/removed-syntax-box.stderr
new file mode 100644
index 000000000..46b891587
--- /dev/null
+++ b/tests/ui/parser/removed-syntax-box.stderr
@@ -0,0 +1,57 @@
+error: `box_syntax` has been removed
+ --> $DIR/removed-syntax-box.rs:9:13
+ |
+LL | let _ = box ();
+ | ^^^^^^
+ |
+help: use `Box::new()` instead
+ |
+LL | let _ = Box::new(());
+ | ~~~~~~~~~~~~
+
+error: `box_syntax` has been removed
+ --> $DIR/removed-syntax-box.rs:10:13
+ |
+LL | let _ = box 1;
+ | ^^^^^
+ |
+help: use `Box::new()` instead
+ |
+LL | let _ = Box::new(1);
+ | ~~~~~~~~~~~
+
+error: `box_syntax` has been removed
+ --> $DIR/removed-syntax-box.rs:11:13
+ |
+LL | let _ = box T { a: 12, b: 18 };
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: use `Box::new()` instead
+ |
+LL | let _ = Box::new(T { a: 12, b: 18 });
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: `box_syntax` has been removed
+ --> $DIR/removed-syntax-box.rs:12:13
+ |
+LL | let _ = box [5; 30];
+ | ^^^^^^^^^^^
+ |
+help: use `Box::new()` instead
+ |
+LL | let _ = Box::new([5; 30]);
+ | ~~~~~~~~~~~~~~~~~
+
+error: `box_syntax` has been removed
+ --> $DIR/removed-syntax-box.rs:13:22
+ |
+LL | let _: Box<()> = box ();
+ | ^^^^^^
+ |
+help: use `Box::new()` instead
+ |
+LL | let _: Box<()> = Box::new(());
+ | ~~~~~~~~~~~~
+
+error: aborting due to 5 previous errors
+
diff --git a/tests/ui/parser/trait-pub-assoc-const.rs b/tests/ui/parser/trait-pub-assoc-const.rs
index 219ffa309..7953e12ec 100644
--- a/tests/ui/parser/trait-pub-assoc-const.rs
+++ b/tests/ui/parser/trait-pub-assoc-const.rs
@@ -1,6 +1,6 @@
trait Foo {
pub const Foo: u32;
- //~^ ERROR unnecessary visibility qualifier
+ //~^ ERROR visibility qualifiers are not permitted here
}
fn main() {}
diff --git a/tests/ui/parser/trait-pub-assoc-const.stderr b/tests/ui/parser/trait-pub-assoc-const.stderr
index efd09a036..c14a2f2ee 100644
--- a/tests/ui/parser/trait-pub-assoc-const.stderr
+++ b/tests/ui/parser/trait-pub-assoc-const.stderr
@@ -1,8 +1,10 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/trait-pub-assoc-const.rs:2:5
|
LL | pub const Foo: u32;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
error: aborting due to previous error
diff --git a/tests/ui/parser/trait-pub-assoc-ty.rs b/tests/ui/parser/trait-pub-assoc-ty.rs
index a78dfbdcd..5d9434edc 100644
--- a/tests/ui/parser/trait-pub-assoc-ty.rs
+++ b/tests/ui/parser/trait-pub-assoc-ty.rs
@@ -1,6 +1,6 @@
trait Foo {
pub type Foo;
- //~^ ERROR unnecessary visibility qualifier
+ //~^ ERROR visibility qualifiers are not permitted here
}
fn main() {}
diff --git a/tests/ui/parser/trait-pub-assoc-ty.stderr b/tests/ui/parser/trait-pub-assoc-ty.stderr
index e76373f5c..7f6e7350c 100644
--- a/tests/ui/parser/trait-pub-assoc-ty.stderr
+++ b/tests/ui/parser/trait-pub-assoc-ty.stderr
@@ -1,8 +1,10 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/trait-pub-assoc-ty.rs:2:5
|
LL | pub type Foo;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
error: aborting due to previous error
diff --git a/tests/ui/parser/trait-pub-method.rs b/tests/ui/parser/trait-pub-method.rs
index 1f6ee028a..c8f33e782 100644
--- a/tests/ui/parser/trait-pub-method.rs
+++ b/tests/ui/parser/trait-pub-method.rs
@@ -1,6 +1,6 @@
trait Foo {
pub fn foo();
- //~^ ERROR unnecessary visibility qualifier
+ //~^ ERROR visibility qualifiers are not permitted here
}
fn main() {}
diff --git a/tests/ui/parser/trait-pub-method.stderr b/tests/ui/parser/trait-pub-method.stderr
index 0e3fe027c..2bf1d468a 100644
--- a/tests/ui/parser/trait-pub-method.stderr
+++ b/tests/ui/parser/trait-pub-method.stderr
@@ -1,8 +1,10 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/trait-pub-method.rs:2:5
|
LL | pub fn foo();
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
error: aborting due to previous error
diff --git a/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr b/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
index 29cd6c45c..25838fbf0 100644
--- a/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
+++ b/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
@@ -2,18 +2,16 @@ error: cannot move out of value because it is borrowed
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:12:14
|
LL | Some(ref _y @ _z) => {}
- | ------^^^--
- | | |
- | | value is moved into `_z` here
+ | ^^^^^^ -- value is moved into `_z` here
+ | |
| value is borrowed by `_y` here
error: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:19:14
|
LL | Some(_z @ ref _y) => {}
- | --^^^------
- | | |
- | | value borrowed here after move
+ | ^^ ------ value borrowed here after move
+ | |
| value moved into `_z` here
| move occurs because `_z` has type `X` which does not implement the `Copy` trait
|
@@ -26,18 +24,16 @@ error: cannot move out of value because it is borrowed
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:26:14
|
LL | Some(ref mut _y @ _z) => {}
- | ----------^^^--
- | | |
- | | value is moved into `_z` here
+ | ^^^^^^^^^^ -- value is moved into `_z` here
+ | |
| value is mutably borrowed by `_y` here
error: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:33:14
|
LL | Some(_z @ ref mut _y) => {}
- | --^^^----------
- | | |
- | | value borrowed here after move
+ | ^^ ---------- value borrowed here after move
+ | |
| value moved into `_z` here
| move occurs because `_z` has type `X` which does not implement the `Copy` trait
|
diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
index 2c123b01e..9305facc4 100644
--- a/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
@@ -2,72 +2,64 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-at-and-box.rs:31:9
|
LL | let ref a @ box b = Box::new(NC);
- | -----^^^^^^^-
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-at-and-box.rs:34:9
|
LL | let ref a @ box ref mut b = Box::new(nc());
- | -----^^^^^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-at-and-box.rs:36:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
- | -----^^^^^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-at-and-box.rs:38:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
- | -----^^^^^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-at-and-box.rs:42:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
- | -----^^^^^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-at-and-box.rs:48:9
|
LL | let ref mut a @ box ref b = Box::new(NC);
- | ---------^^^^^^^-----
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-at-and-box.rs:62:9
|
LL | ref mut a @ box ref b => {
- | ---------^^^^^^^-----
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-at-and-box.rs:54:11
|
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
- | ---------^^^^^^^-----
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error[E0382]: borrow of moved value
diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
index d6474f1b4..c440f4619 100644
--- a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
@@ -2,9 +2,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse-promotion.rs:6:9
|
LL | let a @ ref b = U;
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `a` here
| move occurs because `a` has type `U` which does not implement the `Copy` trait
|
diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
index 389e86e64..13989ebad 100644
--- a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
@@ -2,9 +2,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:22:9
|
LL | let a @ ref b = U;
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `a` here
| move occurs because `a` has type `U` which does not implement the `Copy` trait
|
@@ -17,9 +16,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:24:9
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
- | -^^^^^^^^^^^^---------^^^^^^-----^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- ----- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
@@ -33,9 +31,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:24:14
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
- | -----^^^---------
- | | |
- | | value borrowed here after move
+ | ^^^^^ --------- value borrowed here after move
+ | |
| value moved into `b` here
| move occurs because `b` has type `U` which does not implement the `Copy` trait
|
@@ -48,9 +45,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:24:33
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `d` here
| move occurs because `d` has type `U` which does not implement the `Copy` trait
|
@@ -63,9 +59,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:29:9
|
LL | let a @ [ref mut b, ref c] = [U, U];
- | -^^^^---------^^-----^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- ----- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
@@ -79,9 +74,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:9
|
LL | let a @ ref b = u();
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `a` here
| move occurs because `a` has type `U` which does not implement the `Copy` trait
|
@@ -94,9 +88,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:33:9
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
- | -^^^^^^^^^^^^---------^^^^^^-----^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- ----- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
@@ -110,9 +103,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:33:14
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
- | -----^^^---------
- | | |
- | | value borrowed here after move
+ | ^^^^^ --------- value borrowed here after move
+ | |
| value moved into `b` here
| move occurs because `b` has type `U` which does not implement the `Copy` trait
|
@@ -125,9 +117,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:33:33
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `d` here
| move occurs because `d` has type `U` which does not implement the `Copy` trait
|
@@ -140,9 +131,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:38:9
|
LL | let a @ [ref mut b, ref c] = [u(), u()];
- | -^^^^---------^^-----^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- ----- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
@@ -156,9 +146,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:42:9
|
LL | a @ Some(ref b) => {}
- | -^^^^^^^^-----^
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `a` here
| move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait
|
@@ -171,9 +160,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:47:9
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
- | -^^^^^^^^^^^^^^^^^---------^^^^^^-----^^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- ----- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait
@@ -187,9 +175,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:47:19
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
- | -----^^^---------
- | | |
- | | value borrowed here after move
+ | ^^^^^ --------- value borrowed here after move
+ | |
| value moved into `b` here
| move occurs because `b` has type `U` which does not implement the `Copy` trait
|
@@ -202,9 +189,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:47:38
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `d` here
| move occurs because `d` has type `U` which does not implement the `Copy` trait
|
@@ -217,9 +203,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:55:9
|
LL | mut a @ Some([ref b, ref mut c]) => {}
- | -----^^^^^^^^^-----^^---------^^
- | | | |
- | | | value borrowed here after move
+ | ^^^^^ ----- --------- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait
@@ -233,9 +218,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:9
|
LL | a @ Some(ref b) => {}
- | -^^^^^^^^-----^
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `a` here
| move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait
|
@@ -248,9 +232,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:9
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
- | -^^^^^^^^^^^^^^^^^---------^^^^^^-----^^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- ----- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait
@@ -264,9 +247,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:19
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
- | -----^^^---------
- | | |
- | | value borrowed here after move
+ | ^^^^^ --------- value borrowed here after move
+ | |
| value moved into `b` here
| move occurs because `b` has type `U` which does not implement the `Copy` trait
|
@@ -279,9 +261,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:38
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `d` here
| move occurs because `d` has type `U` which does not implement the `Copy` trait
|
@@ -294,9 +275,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:75:9
|
LL | mut a @ Some([ref b, ref mut c]) => {}
- | -----^^^^^^^^^-----^^---------^^
- | | | |
- | | | value borrowed here after move
+ | ^^^^^ ----- --------- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait
@@ -310,9 +290,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:11:11
|
LL | fn f1(a @ ref b: U) {}
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `a` here
| move occurs because `a` has type `U` which does not implement the `Copy` trait
|
@@ -325,9 +304,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:11
|
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
- | -----^^^^^^^^-----^^^^^^^^^^-----^
- | | | |
- | | | value borrowed here after move
+ | ^^^^^ ----- ----- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
@@ -341,9 +319,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:20
|
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `b` here
| move occurs because `b` has type `U` which does not implement the `Copy` trait
|
@@ -356,9 +333,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:31
|
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
- | -----^^^-----
- | | |
- | | value borrowed here after move
+ | ^^^^^ ----- value borrowed here after move
+ | |
| value moved into `d` here
| move occurs because `d` has type `U` which does not implement the `Copy` trait
|
@@ -371,9 +347,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:19:11
|
LL | fn f3(a @ [ref mut b, ref c]: [U; 2]) {}
- | -^^^^---------^^-----^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- ----- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
index 4f7fbc9e0..00593b2a9 100644
--- a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
@@ -2,18 +2,16 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:24:9
|
LL | let ref a @ b = U;
- | -----^^^-
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:26:9
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
- | -----^^^^^^^^^^^^-----^^^^^^^^^^-^
- | | | |
- | | | value is moved into `e` here
+ | ^^^^^ ----- - value is moved into `e` here
+ | | |
| | value is moved into `c` here
| value is borrowed by `a` here
@@ -21,27 +19,24 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:26:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
- | -----^^^-----
- | | |
- | | value is moved into `c` here
+ | ^^^^^ ----- value is moved into `c` here
+ | |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:26:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
- | -----^^^-
- | | |
- | | value is moved into `e` here
+ | ^^^^^ - value is moved into `e` here
+ | |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:30:9
|
LL | let ref mut a @ [b, mut c] = [U, U];
- | ---------^^^^-^^-----^
- | | | |
- | | | value is moved into `c` here
+ | ^^^^^^^^^ - ----- value is moved into `c` here
+ | | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
@@ -49,18 +44,16 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:33:9
|
LL | let ref a @ b = u();
- | -----^^^-
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:9
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
- | -----^^^^^^^^^^^^-----^^^^^^^^^^-^
- | | | |
- | | | value is moved into `e` here
+ | ^^^^^ ----- - value is moved into `e` here
+ | | |
| | value is moved into `c` here
| value is borrowed by `a` here
@@ -68,27 +61,24 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
- | -----^^^-----
- | | |
- | | value is moved into `c` here
+ | ^^^^^ ----- value is moved into `c` here
+ | |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
- | -----^^^-
- | | |
- | | value is moved into `e` here
+ | ^^^^^ - value is moved into `e` here
+ | |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:42:9
|
LL | let ref mut a @ [b, mut c] = [u(), u()];
- | ---------^^^^-^^-----^
- | | | |
- | | | value is moved into `c` here
+ | ^^^^^^^^^ - ----- value is moved into `c` here
+ | | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
@@ -96,18 +86,16 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:47:9
|
LL | ref a @ Some(b) => {}
- | -----^^^^^^^^-^
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:52:9
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
- | -----^^^^^^^^^^^^^^^^^-----^^^^^^^^^^-^^
- | | | |
- | | | value is moved into `e` here
+ | ^^^^^ ----- - value is moved into `e` here
+ | | |
| | value is moved into `c` here
| value is borrowed by `a` here
@@ -115,27 +103,24 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:52:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
- | -----^^^-----
- | | |
- | | value is moved into `c` here
+ | ^^^^^ ----- value is moved into `c` here
+ | |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:52:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
- | -----^^^-
- | | |
- | | value is moved into `e` here
+ | ^^^^^ - value is moved into `e` here
+ | |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:59:9
|
LL | ref mut a @ Some([b, mut c]) => {}
- | ---------^^^^^^^^^-^^-----^^
- | | | |
- | | | value is moved into `c` here
+ | ^^^^^^^^^ - ----- value is moved into `c` here
+ | | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
@@ -143,18 +128,16 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:64:9
|
LL | ref a @ Some(b) => {}
- | -----^^^^^^^^-^
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:9
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
- | -----^^^^^^^^^^^^^^^^^-----^^^^^^^^^^-^^
- | | | |
- | | | value is moved into `e` here
+ | ^^^^^ ----- - value is moved into `e` here
+ | | |
| | value is moved into `c` here
| value is borrowed by `a` here
@@ -162,27 +145,24 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
- | -----^^^-----
- | | |
- | | value is moved into `c` here
+ | ^^^^^ ----- value is moved into `c` here
+ | |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
- | -----^^^-
- | | |
- | | value is moved into `e` here
+ | ^^^^^ - value is moved into `e` here
+ | |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:78:9
|
LL | ref mut a @ Some([b, mut c]) => {}
- | ---------^^^^^^^^^-^^-----^^
- | | | |
- | | | value is moved into `c` here
+ | ^^^^^^^^^ - ----- value is moved into `c` here
+ | | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
@@ -190,18 +170,16 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:11:11
|
LL | fn f1(ref a @ b: U) {}
- | -----^^^-
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:14:11
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
- | -----^^^^^^^^^^^^-----^^^^^^^^^^-^
- | | | |
- | | | value is moved into `e` here
+ | ^^^^^ ----- - value is moved into `e` here
+ | | |
| | value is moved into `c` here
| value is borrowed by `a` here
@@ -209,27 +187,24 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:14:20
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
- | -----^^^-----
- | | |
- | | value is moved into `c` here
+ | ^^^^^ ----- value is moved into `c` here
+ | |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:14:35
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
- | -----^^^-
- | | |
- | | value is moved into `e` here
+ | ^^^^^ - value is moved into `e` here
+ | |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:20:11
|
LL | fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
- | ---------^^^^-^^-----^
- | | | |
- | | | value is moved into `c` here
+ | ^^^^^^^^^ - ----- value is moved into `c` here
+ | | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
index f51b50418..d6409d1b6 100644
--- a/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
@@ -2,18 +2,16 @@ error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:8:9
|
LL | ref mut z @ &mut Some(ref a) => {
- | ---------^^^^^^^^^^^^^-----^
- | | |
- | | value is borrowed by `a` here
+ | ^^^^^^^^^ ----- value is borrowed by `a` here
+ | |
| value is mutably borrowed by `z` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:33:9
|
LL | let ref mut a @ (ref b @ ref mut c) = u(); // sub-in-sub
- | ---------^^^^-----------------^
- | | | |
- | | | value is mutably borrowed by `c` here
+ | ^^^^^^^^^ ----- --------- value is mutably borrowed by `c` here
+ | | |
| | value is borrowed by `b` here
| value is mutably borrowed by `a` here
@@ -21,36 +19,32 @@ error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:33:22
|
LL | let ref mut a @ (ref b @ ref mut c) = u(); // sub-in-sub
- | -----^^^---------
- | | |
- | | value is mutably borrowed by `c` here
+ | ^^^^^ --------- value is mutably borrowed by `c` here
+ | |
| value is borrowed by `b` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:37:9
|
LL | let ref a @ ref mut b = U;
- | -----^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:39:9
|
LL | let ref mut a @ ref b = U;
- | ---------^^^-----
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:41:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
- | -----^^^^---------^^---------^
- | | | |
- | | | value is mutably borrowed by `c` here
+ | ^^^^^ --------- --------- value is mutably borrowed by `c` here
+ | | |
| | value is mutably borrowed by `b` here
| value is borrowed by `a` here
@@ -58,9 +52,8 @@ error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:43:9
|
LL | let ref mut a @ (ref b, ref c) = (U, U);
- | ---------^^^^-----^^-----^
- | | | |
- | | | value is borrowed by `c` here
+ | ^^^^^^^^^ ----- ----- value is borrowed by `c` here
+ | | |
| | value is borrowed by `b` here
| value is mutably borrowed by `a` here
@@ -68,153 +61,136 @@ error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:46:9
|
LL | let ref mut a @ ref b = u();
- | ---------^^^-----
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:51:9
|
LL | let ref a @ ref mut b = u();
- | -----^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:57:9
|
LL | let ref mut a @ ref b = U;
- | ---------^^^-----
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:61:9
|
LL | let ref a @ ref mut b = U;
- | -----^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:67:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) => {
- | ---------^^^^^^-----^
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:67:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) => {
- | ---------^^^^^^^-----^
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
- | -----^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
- | -----^^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:87:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {}
- | -----^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:87:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {}
- | -----^^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:94:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {}
- | ---------^^^^^^-----^
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:94:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {}
- | ---------^^^^^^^-----^
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
- | -----^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
- | -----^^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:109:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {}
- | ---------^^^^^^-----^
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:109:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {}
- | ---------^^^^^^^-----^
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:117:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
- | -----^^^^---------^^---------^
- | | | |
- | | | value is mutably borrowed by `c` here
+ | ^^^^^ --------- --------- value is mutably borrowed by `c` here
+ | | |
| | value is mutably borrowed by `b` here
| value is borrowed by `a` here
@@ -222,9 +198,8 @@ error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:123:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
- | -----^^^^---------^^---------^
- | | | |
- | | | value is mutably borrowed by `c` here
+ | ^^^^^ --------- --------- value is mutably borrowed by `c` here
+ | | |
| | value is mutably borrowed by `b` here
| value is borrowed by `a` here
@@ -232,9 +207,8 @@ error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:129:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
- | -----^^^^---------^^---------^
- | | | |
- | | | value is mutably borrowed by `c` here
+ | ^^^^^ --------- --------- value is mutably borrowed by `c` here
+ | | |
| | value is mutably borrowed by `b` here
| value is borrowed by `a` here
@@ -242,9 +216,8 @@ error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:134:9
|
LL | let ref mut a @ (ref b, ref c) = (U, U);
- | ---------^^^^-----^^-----^
- | | | |
- | | | value is borrowed by `c` here
+ | ^^^^^^^^^ ----- ----- value is borrowed by `c` here
+ | | |
| | value is borrowed by `b` here
| value is mutably borrowed by `a` here
@@ -252,36 +225,32 @@ error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:22:11
|
LL | fn f1(ref a @ ref mut b: U) {}
- | -----^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:24:11
|
LL | fn f2(ref mut a @ ref b: U) {}
- | ---------^^^-----
- | | |
- | | value is borrowed by `b` here
+ | ^^^^^^^^^ ----- value is borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:26:11
|
LL | fn f3(ref a @ [ref b, ref mut mid @ .., ref c]: [U; 4]) {}
- | -----^^^^^^^^^^^----------------^^^^^^^^
- | | |
- | | value is mutably borrowed by `mid` here
+ | ^^^^^ ----------- value is mutably borrowed by `mid` here
+ | |
| value is borrowed by `a` here
error: cannot borrow value as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:28:22
|
LL | fn f4_also_moved(ref a @ ref mut b @ c: U) {}
- | -----^^^-------------
- | | | |
- | | | value is moved into `c` here
+ | ^^^^^ --------- - value is moved into `c` here
+ | | |
| | value is mutably borrowed by `b` here
| value is borrowed by `a` here
@@ -289,9 +258,8 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:28:30
|
LL | fn f4_also_moved(ref a @ ref mut b @ c: U) {}
- | ---------^^^-
- | | |
- | | value is moved into `c` here
+ | ^^^^^^^^^ - value is moved into `c` here
+ | |
| value is mutably borrowed by `b` here
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
index a0cb04a06..24189d061 100644
--- a/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
@@ -2,98 +2,80 @@ error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:26:9
|
LL | let ref mut a @ ref mut b = U;
- | ---------^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:29:9
|
LL | let ref mut a @ ref mut b = U;
- | ---------^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:33:9
|
LL | let ref mut a @ ref mut b = U;
- | ---------^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:36:9
|
LL | let ref mut a @ ref mut b = U;
- | ---------^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:39:9
|
LL | let ref mut a @ ref mut b = U;
- | ---------^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:44:9
|
-LL | let ref mut a @ (
- | ^--------
- | |
- | _________value is mutably borrowed by `a` here
- | |
-LL | |
-LL | | ref mut b,
- | | --------- value is mutably borrowed by `b` here
-LL | | [
-LL | | ref mut c,
- | | --------- value is mutably borrowed by `c` here
-LL | | ref mut d,
- | | --------- value is mutably borrowed by `d` here
-LL | | ref e,
- | | ----- value is borrowed by `e` here
-LL | | ]
-LL | | ) = (U, [U, U, U]);
- | |_____^
+LL | let ref mut a @ (
+ | ^^^^^^^^^ value is mutably borrowed by `a` here
+LL |
+LL | ref mut b,
+ | --------- value is mutably borrowed by `b` here
+LL | [
+LL | ref mut c,
+ | --------- value is mutably borrowed by `c` here
+LL | ref mut d,
+ | --------- value is mutably borrowed by `d` here
+LL | ref e,
+ | ----- value is borrowed by `e` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:54:9
|
-LL | let ref mut a @ (
- | ^--------
- | |
- | _________value is mutably borrowed by `a` here
- | |
-LL | |
-LL | | ref mut b,
- | | --------- value is mutably borrowed by `b` here
-LL | | [
-LL | | ref mut c,
- | | --------- value is mutably borrowed by `c` here
-LL | | ref mut d,
- | | --------- value is mutably borrowed by `d` here
-LL | | ref e,
- | | ----- value is borrowed by `e` here
-LL | | ]
-LL | | ) = (u(), [u(), u(), u()]);
- | |_________^
+LL | let ref mut a @ (
+ | ^^^^^^^^^ value is mutably borrowed by `a` here
+LL |
+LL | ref mut b,
+ | --------- value is mutably borrowed by `b` here
+LL | [
+LL | ref mut c,
+ | --------- value is mutably borrowed by `c` here
+LL | ref mut d,
+ | --------- value is mutably borrowed by `d` here
+LL | ref e,
+ | ----- value is borrowed by `e` here
error: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-twice.rs:64:9
|
LL | let a @ (ref mut b, ref mut c) = (U, U);
- | -^^^^---------^^---------^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- --------- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
@@ -107,9 +89,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-twice.rs:67:9
|
LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
- | -^^^^-^^^-^^-^^
- | | | | |
- | | | | value borrowed here after move
+ | ^ - - - value borrowed here after move
+ | | | |
| | | value borrowed here after move
| | value borrowed here after move
| value moved into `a` here
@@ -124,9 +105,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-twice.rs:70:9
|
LL | let a @ &mut ref mut b = &mut U;
- | -^^^^^^^^---------
- | | |
- | | value borrowed here after move
+ | ^ --------- value borrowed here after move
+ | |
| value moved into `a` here
| move occurs because `a` has type `&mut U` which does not implement the `Copy` trait
|
@@ -139,9 +119,8 @@ error: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-twice.rs:72:9
|
LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
- | -^^^^^^^^^---------^^---------^
- | | | |
- | | | value borrowed here after move
+ | ^ --------- --------- value borrowed here after move
+ | | |
| | value borrowed here after move
| value moved into `a` here
| move occurs because `a` has type `&mut (U, U)` which does not implement the `Copy` trait
@@ -155,117 +134,99 @@ error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:76:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:76:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------^^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:82:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:82:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------^^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:89:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:89:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------^^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:101:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:101:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------^^^^^^^---------^
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:8:11
|
LL | fn f1(ref mut a @ ref mut b: U) {}
- | ---------^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:10:11
|
LL | fn f2(ref mut a @ ref mut b: U) {}
- | ---------^^^---------
- | | |
- | | value is mutably borrowed by `b` here
+ | ^^^^^^^^^ --------- value is mutably borrowed by `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:13:9
|
-LL | ref mut a @ [
- | ^--------
- | |
- | _________value is mutably borrowed by `a` here
- | |
-LL | |
-LL | | [ref b @ .., _],
- | | ---------- value is borrowed by `b` here
-LL | | [_, ref mut mid @ ..],
- | | ---------------- value is mutably borrowed by `mid` here
-LL | | ..,
-LL | | [..],
-LL | | ] : [[U; 4]; 5]
- | |_________^
+LL | ref mut a @ [
+ | ^^^^^^^^^ value is mutably borrowed by `a` here
+LL |
+LL | [ref b @ .., _],
+ | ----- value is borrowed by `b` here
+LL | [_, ref mut mid @ ..],
+ | ----------- value is mutably borrowed by `mid` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:21:22
|
LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
- | ---------^^^-------------
- | | | |
- | | | value is moved into `c` here
+ | ^^^^^^^^^ --------- - value is moved into `c` here
+ | | |
| | value is mutably borrowed by `b` here
| value is mutably borrowed by `a` here
@@ -273,9 +234,8 @@ error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-ref-mut-twice.rs:21:34
|
LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
- | ---------^^^-
- | | |
- | | value is moved into `c` here
+ | ^^^^^^^^^ - value is moved into `c` here
+ | |
| value is mutably borrowed by `b` here
error[E0499]: cannot borrow value as mutable more than once at a time
diff --git a/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr b/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
index 73ebbf481..36515c1a2 100644
--- a/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
+++ b/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
@@ -2,36 +2,32 @@ error: cannot move out of value because it is borrowed
--> $DIR/default-binding-modes-both-sides-independent.rs:26:9
|
LL | let ref a @ b = NotCopy;
- | -----^^^-
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/default-binding-modes-both-sides-independent.rs:29:9
|
LL | let ref mut a @ b = NotCopy;
- | ---------^^^-
- | | |
- | | value is moved into `b` here
+ | ^^^^^^^^^ - value is moved into `b` here
+ | |
| value is mutably borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/default-binding-modes-both-sides-independent.rs:34:12
|
LL | Ok(ref a @ b) | Err(b @ ref a) => {
- | -----^^^-
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error: borrow of moved value
--> $DIR/default-binding-modes-both-sides-independent.rs:34:29
|
LL | Ok(ref a @ b) | Err(b @ ref a) => {
- | -^^^-----
- | | |
- | | value borrowed here after move
+ | ^ ----- value borrowed here after move
+ | |
| value moved into `b` here
| move occurs because `b` has type `NotCopy` which does not implement the `Copy` trait
|
@@ -44,9 +40,8 @@ error: cannot move out of value because it is borrowed
--> $DIR/default-binding-modes-both-sides-independent.rs:42:9
|
LL | ref a @ b => {
- | -----^^^-
- | | |
- | | value is moved into `b` here
+ | ^^^^^ - value is moved into `b` here
+ | |
| value is borrowed by `a` here
error[E0382]: borrow of moved value
diff --git a/tests/ui/pattern/issue-106552.stderr b/tests/ui/pattern/issue-106552.stderr
index ed5d40c09..96f3d6845 100644
--- a/tests/ui/pattern/issue-106552.stderr
+++ b/tests/ui/pattern/issue-106552.stderr
@@ -9,8 +9,8 @@ LL | let 5 = 6;
= note: the matched value is of type `i32`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | if let 5 = 6 { todo!() }
- | ++ ~~~~~~~~~~~
+LL | if let 5 = 6 { todo!() };
+ | ++ +++++++++++
help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
|
LL | let _5 = 6;
@@ -20,7 +20,7 @@ error[E0005]: refutable pattern in local binding
--> $DIR/issue-106552.rs:5:9
|
LL | let x @ 5 = 6;
- | ^^^^^ patterns `i32::MIN..=4_i32` and `6_i32..=i32::MAX` not covered
+ | ^ patterns `i32::MIN..=4_i32` and `6_i32..=i32::MAX` not covered
|
= 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
diff --git a/tests/ui/pattern/issue-106862.fixed b/tests/ui/pattern/issue-106862.fixed
new file mode 100644
index 000000000..9b27a61ff
--- /dev/null
+++ b/tests/ui/pattern/issue-106862.fixed
@@ -0,0 +1,44 @@
+// run-rustfix
+
+#![allow(unused)]
+
+use Foo::{FooB, FooA};
+
+enum Foo {
+ FooA { opt_x: Option<i32>, y: i32 },
+ FooB { x: i32, y: i32 }
+}
+
+fn main() {
+ let f = FooB { x: 3, y: 4 };
+
+ match f {
+ FooB { x: a, y: b } => println!("{} {}", a, b),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
+ _ => (),
+ }
+
+ match f {
+ FooB { x, y } => println!("{} {}", x, y),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
+ _ => (),
+ }
+
+ match f {
+ FooA { opt_x: Some(x), y } => println!("{} {}", x, y),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooA`
+ _ => (),
+ }
+
+ match f {
+ FooB { x: a, y: _ } => println!("{}", a),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
+ _ => (),
+ }
+
+ match f {
+ FooB { x, y } => (),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
+ _ => (),
+ }
+}
diff --git a/tests/ui/pattern/issue-106862.rs b/tests/ui/pattern/issue-106862.rs
new file mode 100644
index 000000000..590430a78
--- /dev/null
+++ b/tests/ui/pattern/issue-106862.rs
@@ -0,0 +1,44 @@
+// run-rustfix
+
+#![allow(unused)]
+
+use Foo::{FooB, FooA};
+
+enum Foo {
+ FooA { opt_x: Option<i32>, y: i32 },
+ FooB { x: i32, y: i32 }
+}
+
+fn main() {
+ let f = FooB { x: 3, y: 4 };
+
+ match f {
+ FooB(a, b) => println!("{} {}", a, b),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
+ _ => (),
+ }
+
+ match f {
+ FooB(x, y) => println!("{} {}", x, y),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
+ _ => (),
+ }
+
+ match f {
+ FooA(Some(x), y) => println!("{} {}", x, y),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooA`
+ _ => (),
+ }
+
+ match f {
+ FooB(a, _, _) => println!("{}", a),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
+ _ => (),
+ }
+
+ match f {
+ FooB() => (),
+ //~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
+ _ => (),
+ }
+}
diff --git a/tests/ui/pattern/issue-106862.stderr b/tests/ui/pattern/issue-106862.stderr
new file mode 100644
index 000000000..27f8ac972
--- /dev/null
+++ b/tests/ui/pattern/issue-106862.stderr
@@ -0,0 +1,48 @@
+error[E0532]: expected tuple struct or tuple variant, found variant `FooB`
+ --> $DIR/issue-106862.rs:16:9
+ |
+LL | FooB { x: i32, y: i32 }
+ | ----------------------- `FooB` defined here
+...
+LL | FooB(a, b) => println!("{} {}", a, b),
+ | ^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x: a, y: b }`
+
+error[E0532]: expected tuple struct or tuple variant, found variant `FooB`
+ --> $DIR/issue-106862.rs:22:9
+ |
+LL | FooB { x: i32, y: i32 }
+ | ----------------------- `FooB` defined here
+...
+LL | FooB(x, y) => println!("{} {}", x, y),
+ | ^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x, y }`
+
+error[E0532]: expected tuple struct or tuple variant, found variant `FooA`
+ --> $DIR/issue-106862.rs:28:9
+ |
+LL | FooA { opt_x: Option<i32>, y: i32 },
+ | ----------------------------------- `FooA` defined here
+...
+LL | FooA(Some(x), y) => println!("{} {}", x, y),
+ | ^^^^^^^^^^^^^^^^ help: use struct pattern syntax instead: `FooA { opt_x: Some(x), y }`
+
+error[E0532]: expected tuple struct or tuple variant, found variant `FooB`
+ --> $DIR/issue-106862.rs:34:9
+ |
+LL | FooB { x: i32, y: i32 }
+ | ----------------------- `FooB` defined here
+...
+LL | FooB(a, _, _) => println!("{}", a),
+ | ^^^^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x: a, y: _ }`
+
+error[E0532]: expected tuple struct or tuple variant, found variant `FooB`
+ --> $DIR/issue-106862.rs:40:9
+ |
+LL | FooB { x: i32, y: i32 }
+ | ----------------------- `FooB` defined here
+...
+LL | FooB() => (),
+ | ^^^^^^ help: use struct pattern syntax instead: `FooB { x, y }`
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0532`.
diff --git a/tests/ui/pattern/issue-68393-let-pat-assoc-constant.stderr b/tests/ui/pattern/issue-68393-let-pat-assoc-constant.stderr
index 54ecc2498..62c90b638 100644
--- a/tests/ui/pattern/issue-68393-let-pat-assoc-constant.stderr
+++ b/tests/ui/pattern/issue-68393-let-pat-assoc-constant.stderr
@@ -1,15 +1,15 @@
error[E0158]: associated consts cannot be referenced in patterns
- --> $DIR/issue-68393-let-pat-assoc-constant.rs:20:40
- |
-LL | pub fn test<A: Foo, B: Foo>(arg: EFoo, A::X: EFoo) {
- | ^^^^
-
-error[E0158]: associated consts cannot be referenced in patterns
--> $DIR/issue-68393-let-pat-assoc-constant.rs:22:9
|
LL | let A::X = arg;
| ^^^^
+error[E0158]: associated consts cannot be referenced in patterns
+ --> $DIR/issue-68393-let-pat-assoc-constant.rs:20:40
+ |
+LL | pub fn test<A: Foo, B: Foo>(arg: EFoo, A::X: EFoo) {
+ | ^^^^
+
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0158`.
diff --git a/tests/ui/pattern/pat-tuple-field-count-cross.stderr b/tests/ui/pattern/pat-tuple-field-count-cross.stderr
index d92957461..0d7f2e4af 100644
--- a/tests/ui/pattern/pat-tuple-field-count-cross.stderr
+++ b/tests/ui/pattern/pat-tuple-field-count-cross.stderr
@@ -113,8 +113,8 @@ LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
|
help: use the tuple variant pattern syntax instead
|
-LL | E1::Z1(/* fields */) => {}
- | ~~~~~~~~~~~~~~~~~~~~
+LL | E1::Z1() => {}
+ | ~~~~~~~~
help: a unit variant with a similar name exists
|
LL | E1::Z0 => {}
diff --git a/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed
index b28dce881..b469fade3 100644
--- a/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed
+++ b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed
@@ -4,7 +4,7 @@ fn main() {
match Some(1) { //~ ERROR non-exhaustive patterns: `None` not covered
Some(1) => {}
// hello
- Some(_) => {}
+ Some(_) => {},
None => todo!()
}
}
diff --git a/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr
index 2a016048f..5f2c89246 100644
--- a/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr
+++ b/tests/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr
@@ -12,7 +12,7 @@ note: `Option<i32>` defined here
= note: the matched value is of type `Option<i32>`
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 ~ Some(_) => {}
+LL ~ Some(_) => {},
LL + None => todo!()
|
diff --git a/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr b/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr
index 358421cd6..dbd46da44 100644
--- a/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr
+++ b/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `MyType` in a pattern, `MyType` must be annotat
|
LL | if let CONSTANT = &&MyType {
| ^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/pattern/usefulness/consts-opaque.stderr b/tests/ui/pattern/usefulness/consts-opaque.stderr
index 35396751a..3f0b4a9f2 100644
--- a/tests/ui/pattern/usefulness/consts-opaque.stderr
+++ b/tests/ui/pattern/usefulness/consts-opaque.stderr
@@ -3,36 +3,18 @@ error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated wit
|
LL | FOO => {}
| ^^^
-
-error: unreachable pattern
- --> $DIR/consts-opaque.rs:32:9
- |
-LL | FOO => {}
- | --- matches any value
-LL |
-LL | _ => {} // should not be emitting unreachable warning
- | ^ unreachable pattern
- |
-note: the lint level is defined here
- --> $DIR/consts-opaque.rs:6:9
|
-LL | #![deny(unreachable_patterns)]
- | ^^^^^^^^^^^^^^^^^^^^
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:37:9
|
LL | FOO_REF => {}
| ^^^^^^^
-
-error: unreachable pattern
- --> $DIR/consts-opaque.rs:39:9
|
-LL | FOO_REF => {}
- | ------- matches any value
-LL |
-LL | Foo(_) => {} // should not be emitting unreachable warning
- | ^^^^^^ unreachable pattern
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
warning: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/consts-opaque.rs:45:9
@@ -42,6 +24,8 @@ LL | FOO_REF_REF => {}
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
= note: `#[warn(indirect_structural_match)]` on by default
error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
@@ -49,6 +33,87 @@ error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated wit
|
LL | BAR => {} // should not be emitting unreachable warning
| ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
+
+error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/consts-opaque.rs:61:9
+ |
+LL | BAR => {}
+ | ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
+
+error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/consts-opaque.rs:70:9
+ |
+LL | BAR => {}
+ | ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
+
+error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/consts-opaque.rs:72:9
+ |
+LL | BAR => {} // should not be emitting unreachable warning
+ | ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
+
+error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/consts-opaque.rs:80:9
+ |
+LL | BAZ => {}
+ | ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
+
+error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/consts-opaque.rs:90:9
+ |
+LL | BAZ => {}
+ | ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
+
+error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/consts-opaque.rs:97:9
+ |
+LL | BAZ => {}
+ | ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
+
+error: unreachable pattern
+ --> $DIR/consts-opaque.rs:32:9
+ |
+LL | FOO => {}
+ | --- matches any value
+LL |
+LL | _ => {} // should not be emitting unreachable warning
+ | ^ unreachable pattern
+ |
+note: the lint level is defined here
+ --> $DIR/consts-opaque.rs:6:9
+ |
+LL | #![deny(unreachable_patterns)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: unreachable pattern
+ --> $DIR/consts-opaque.rs:39:9
+ |
+LL | FOO_REF => {}
+ | ------- matches any value
+LL |
+LL | Foo(_) => {} // should not be emitting unreachable warning
+ | ^^^^^^ unreachable pattern
error: unreachable pattern
--> $DIR/consts-opaque.rs:53:9
@@ -67,12 +132,6 @@ LL | Bar => {}
LL | _ => {}
| ^ unreachable pattern
-error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/consts-opaque.rs:61:9
- |
-LL | BAR => {}
- | ^^^
-
error: unreachable pattern
--> $DIR/consts-opaque.rs:63:9
|
@@ -91,18 +150,6 @@ LL | BAR => {}
LL | _ => {}
| ^ unreachable pattern
-error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/consts-opaque.rs:70:9
- |
-LL | BAR => {}
- | ^^^
-
-error: to use a constant of type `Bar` in a pattern, `Bar` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/consts-opaque.rs:72:9
- |
-LL | BAR => {} // should not be emitting unreachable warning
- | ^^^
-
error: unreachable pattern
--> $DIR/consts-opaque.rs:72:9
|
@@ -121,12 +168,6 @@ LL | BAR => {}
LL | _ => {} // should not be emitting unreachable warning
| ^ unreachable pattern
-error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/consts-opaque.rs:80:9
- |
-LL | BAZ => {}
- | ^^^
-
error: unreachable pattern
--> $DIR/consts-opaque.rs:82:9
|
@@ -145,12 +186,6 @@ LL | BAZ => {}
LL | _ => {}
| ^ unreachable pattern
-error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/consts-opaque.rs:90:9
- |
-LL | BAZ => {}
- | ^^^
-
error: unreachable pattern
--> $DIR/consts-opaque.rs:92:9
|
@@ -160,12 +195,6 @@ LL |
LL | _ => {}
| ^ unreachable pattern
-error: to use a constant of type `Baz` in a pattern, `Baz` must be annotated with `#[derive(PartialEq, Eq)]`
- --> $DIR/consts-opaque.rs:97:9
- |
-LL | BAZ => {}
- | ^^^
-
error: unreachable pattern
--> $DIR/consts-opaque.rs:99:9
|
diff --git a/tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr b/tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
index 17e1a2304..ff29de03d 100644
--- a/tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
+++ b/tests/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
@@ -12,7 +12,7 @@ LL | pub enum HiddenEnum {
= note: the matched value is of type `HiddenEnum`
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 ~ HiddenEnum::B => {}
+LL ~ HiddenEnum::B => {},
LL + _ => todo!()
|
@@ -33,7 +33,7 @@ LL | B,
= note: the matched value is of type `HiddenEnum`
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 ~ HiddenEnum::C => {}
+LL ~ HiddenEnum::C => {},
LL + HiddenEnum::B => todo!()
|
@@ -54,7 +54,7 @@ LL | B,
= note: the matched value is of type `HiddenEnum`
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 ~ HiddenEnum::A => {}
+LL ~ HiddenEnum::A => {},
LL + HiddenEnum::B | _ => todo!()
|
@@ -72,7 +72,7 @@ note: `Option<HiddenEnum>` defined here
= note: the matched value is of type `Option<HiddenEnum>`
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 ~ Some(HiddenEnum::A) => {}
+LL ~ Some(HiddenEnum::A) => {},
LL + Some(HiddenEnum::B) | Some(_) => todo!()
|
@@ -93,7 +93,7 @@ LL | C,
= note: the matched value is of type `InCrate`
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 ~ InCrate::B => {}
+LL ~ InCrate::B => {},
LL + InCrate::C => todo!()
|
diff --git a/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
index 5e12bc1d2..5a145efce 100644
--- a/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
@@ -162,7 +162,7 @@ LL | match_guarded_arm!(0u8);
= note: the matched value is of type `u8`
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 => {}
+LL ~ _ if false => {},
LL + _ => todo!()
|
@@ -180,7 +180,7 @@ LL | struct NonEmptyStruct1;
= note: the matched value is of type `NonEmptyStruct1`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyStruct1 => todo!()
|
@@ -198,7 +198,7 @@ LL | struct NonEmptyStruct2(bool);
= note: the matched value is of type `NonEmptyStruct2`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyStruct2(_) => todo!()
|
@@ -216,7 +216,7 @@ LL | union NonEmptyUnion1 {
= note: the matched value is of type `NonEmptyUnion1`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyUnion1 { .. } => todo!()
|
@@ -234,7 +234,7 @@ LL | union NonEmptyUnion2 {
= note: the matched value is of type `NonEmptyUnion2`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyUnion2 { .. } => todo!()
|
@@ -254,7 +254,7 @@ LL | Foo(bool),
= note: the matched value is of type `NonEmptyEnum1`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyEnum1::Foo(_) => todo!()
|
@@ -276,7 +276,7 @@ LL | Bar,
= note: the matched value is of type `NonEmptyEnum2`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
|
@@ -294,7 +294,7 @@ LL | enum NonEmptyEnum5 {
= note: the matched value is of type `NonEmptyEnum5`
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 => {}
+LL ~ _ if false => {},
LL + _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/empty-match.normal.stderr b/tests/ui/pattern/usefulness/empty-match.normal.stderr
index 5e12bc1d2..5a145efce 100644
--- a/tests/ui/pattern/usefulness/empty-match.normal.stderr
+++ b/tests/ui/pattern/usefulness/empty-match.normal.stderr
@@ -162,7 +162,7 @@ LL | match_guarded_arm!(0u8);
= note: the matched value is of type `u8`
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 => {}
+LL ~ _ if false => {},
LL + _ => todo!()
|
@@ -180,7 +180,7 @@ LL | struct NonEmptyStruct1;
= note: the matched value is of type `NonEmptyStruct1`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyStruct1 => todo!()
|
@@ -198,7 +198,7 @@ LL | struct NonEmptyStruct2(bool);
= note: the matched value is of type `NonEmptyStruct2`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyStruct2(_) => todo!()
|
@@ -216,7 +216,7 @@ LL | union NonEmptyUnion1 {
= note: the matched value is of type `NonEmptyUnion1`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyUnion1 { .. } => todo!()
|
@@ -234,7 +234,7 @@ LL | union NonEmptyUnion2 {
= note: the matched value is of type `NonEmptyUnion2`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyUnion2 { .. } => todo!()
|
@@ -254,7 +254,7 @@ LL | Foo(bool),
= note: the matched value is of type `NonEmptyEnum1`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyEnum1::Foo(_) => todo!()
|
@@ -276,7 +276,7 @@ LL | Bar,
= note: the matched value is of type `NonEmptyEnum2`
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 => {}
+LL ~ _ if false => {},
LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
|
@@ -294,7 +294,7 @@ LL | enum NonEmptyEnum5 {
= note: the matched value is of type `NonEmptyEnum5`
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 => {}
+LL ~ _ if false => {},
LL + _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/floats.stderr b/tests/ui/pattern/usefulness/floats.stderr
index c926e50b3..d66d4ba29 100644
--- a/tests/ui/pattern/usefulness/floats.stderr
+++ b/tests/ui/pattern/usefulness/floats.stderr
@@ -7,7 +7,7 @@ LL | match 0.0 {
= note: the matched value is of type `f64`
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 ~ 0.0..=1.0 => {}
+LL ~ 0.0..=1.0 => {},
LL + _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/guards.stderr b/tests/ui/pattern/usefulness/guards.stderr
index 0c1563c16..fc6748958 100644
--- a/tests/ui/pattern/usefulness/guards.stderr
+++ b/tests/ui/pattern/usefulness/guards.stderr
@@ -7,7 +7,7 @@ LL | match 0u8 {
= note: the matched value is of type `u8`
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 ~ 128 ..= 255 if true => {}
+LL ~ 128 ..= 255 if true => {},
LL + 128_u8..=u8::MAX => todo!()
|
diff --git a/tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr b/tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr
index f30ba05df..b585de206 100644
--- a/tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr
@@ -91,7 +91,7 @@ LL | match 0i8 {
= note: the matched value is of type `i8`
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 ~ 1 ..= i8::MAX => {}
+LL ~ 1 ..= i8::MAX => {},
LL + 0_i8 => todo!()
|
@@ -140,7 +140,7 @@ LL | match (0u8, true) {
= note: the matched value is of type `(u8, bool)`
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 ~ (0 ..= 255, true) => {}
+LL ~ (0 ..= 255, true) => {},
LL + (126_u8..=127_u8, false) => todo!()
|
diff --git a/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
index e3eb98ccd..0e0f0c3e1 100644
--- a/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
@@ -9,7 +9,7 @@ LL | match 0usize {
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
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 ~ 0 ..= usize::MAX => {}
+LL ~ 0 ..= usize::MAX => {},
LL + _ => todo!()
|
@@ -24,7 +24,7 @@ LL | match 0isize {
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
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 ~ isize::MIN ..= isize::MAX => {}
+LL ~ isize::MIN ..= isize::MAX => {},
LL + _ => todo!()
|
@@ -147,7 +147,7 @@ LL | match 0isize {
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
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 ~ 1 ..= isize::MAX => {}
+LL ~ 1 ..= isize::MAX => {},
LL + _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
index 30492c982..b80411b26 100644
--- a/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
@@ -9,7 +9,7 @@ LL | match 0usize {
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
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 ~ 0..=usize::MAX => {}
+LL ~ 0..=usize::MAX => {},
LL + _ => todo!()
|
@@ -24,7 +24,7 @@ LL | match 0isize {
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
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 ~ isize::MIN..=isize::MAX => {}
+LL ~ isize::MIN..=isize::MAX => {},
LL + _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/issue-2111.stderr b/tests/ui/pattern/usefulness/issue-2111.stderr
index 01890b73c..7f7c5a0f1 100644
--- a/tests/ui/pattern/usefulness/issue-2111.stderr
+++ b/tests/ui/pattern/usefulness/issue-2111.stderr
@@ -7,7 +7,7 @@ LL | match (a, b) {
= note: the matched value is of type `(Option<usize>, Option<usize>)`
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 ~ (Some(_), None) | (None, Some(_)) => {}
+LL ~ (Some(_), None) | (None, Some(_)) => {},
LL + (None, None) | (Some(_), Some(_)) => todo!()
|
diff --git a/tests/ui/pattern/usefulness/issue-30240.stderr b/tests/ui/pattern/usefulness/issue-30240.stderr
index 759fdeafe..ff755d681 100644
--- a/tests/ui/pattern/usefulness/issue-30240.stderr
+++ b/tests/ui/pattern/usefulness/issue-30240.stderr
@@ -7,7 +7,7 @@ LL | match "world" {
= note: the matched value is of type `&str`
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 ~ "hello" => {}
+LL ~ "hello" => {},
LL + &_ => todo!()
|
@@ -20,7 +20,7 @@ LL | match "world" {
= note: the matched value is of type `&str`
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 ~ "hello" => {}
+LL ~ "hello" => {},
LL + &_ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/issue-35609.stderr b/tests/ui/pattern/usefulness/issue-35609.stderr
index 12113957d..6d5e2f410 100644
--- a/tests/ui/pattern/usefulness/issue-35609.stderr
+++ b/tests/ui/pattern/usefulness/issue-35609.stderr
@@ -7,7 +7,7 @@ LL | match (A, ()) {
= note: the matched value is of type `(Enum, ())`
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 ~ (A, _) => {}
+LL ~ (A, _) => {},
LL + _ => todo!()
|
@@ -20,7 +20,7 @@ LL | match (A, A) {
= note: the matched value is of type `(Enum, Enum)`
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 ~ (_, A) => {}
+LL ~ (_, A) => {},
LL + _ => todo!()
|
@@ -33,7 +33,7 @@ LL | match ((A, ()), ()) {
= note: the matched value is of type `((Enum, ()), ())`
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 ~ ((A, ()), _) => {}
+LL ~ ((A, ()), _) => {},
LL + _ => todo!()
|
@@ -46,7 +46,7 @@ LL | match ((A, ()), A) {
= note: the matched value is of type `((Enum, ()), Enum)`
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 ~ ((A, ()), _) => {}
+LL ~ ((A, ()), _) => {},
LL + _ => todo!()
|
@@ -59,7 +59,7 @@ LL | match ((A, ()), ()) {
= note: the matched value is of type `((Enum, ()), ())`
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 ~ ((A, _), _) => {}
+LL ~ ((A, _), _) => {},
LL + _ => todo!()
|
@@ -77,7 +77,7 @@ LL | struct S(Enum, ());
= note: the matched value is of type `S`
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 ~ S(A, _) => {}
+LL ~ S(A, _) => {},
LL + _ => todo!()
|
@@ -95,7 +95,7 @@ LL | struct Sd { x: Enum, y: () }
= note: the matched value is of type `Sd`
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 ~ Sd { x: A, y: _ } => {}
+LL ~ Sd { x: A, y: _ } => {},
LL + _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/issue-3601.stderr b/tests/ui/pattern/usefulness/issue-3601.stderr
index 59d7bcd4b..2f6b167d4 100644
--- a/tests/ui/pattern/usefulness/issue-3601.stderr
+++ b/tests/ui/pattern/usefulness/issue-3601.stderr
@@ -9,7 +9,7 @@ note: `Box<ElementKind>` defined here
= note: the matched value is of type `Box<ElementKind>`
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 ElementKind::HTMLImageElement(ref d) if d.image.is_some() => { true },
LL + box _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/issue-50900.stderr b/tests/ui/pattern/usefulness/issue-50900.stderr
index 348246d28..7880c8925 100644
--- a/tests/ui/pattern/usefulness/issue-50900.stderr
+++ b/tests/ui/pattern/usefulness/issue-50900.stderr
@@ -12,7 +12,7 @@ LL | pub struct Tag(pub Context, pub u16);
= note: the matched value is of type `Tag`
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 ~ Tag::ExifIFDPointer => {}
+LL ~ Tag::ExifIFDPointer => {},
LL + Tag(Context::Exif, _) => todo!()
|
diff --git a/tests/ui/pattern/usefulness/issue-56379.stderr b/tests/ui/pattern/usefulness/issue-56379.stderr
index 6eed6bfae..b3e40b992 100644
--- a/tests/ui/pattern/usefulness/issue-56379.stderr
+++ b/tests/ui/pattern/usefulness/issue-56379.stderr
@@ -18,7 +18,7 @@ LL | C(bool),
= note: the matched value is of type `Foo`
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 ~ Foo::C(true) => {}
+LL ~ Foo::C(true) => {},
LL + Foo::A(false) | Foo::B(false) | Foo::C(false) => todo!()
|
diff --git a/tests/ui/pattern/usefulness/match-byte-array-patterns-2.stderr b/tests/ui/pattern/usefulness/match-byte-array-patterns-2.stderr
index a90f32f7a..3c482eef2 100644
--- a/tests/ui/pattern/usefulness/match-byte-array-patterns-2.stderr
+++ b/tests/ui/pattern/usefulness/match-byte-array-patterns-2.stderr
@@ -7,7 +7,7 @@ LL | match buf {
= note: the matched value is of type `&[u8; 4]`
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 ~ b"AAAA" => {}
+LL ~ b"AAAA" => {},
LL + &[0_u8..=64_u8, _, _, _] | &[66_u8..=u8::MAX, _, _, _] => todo!()
|
@@ -20,7 +20,7 @@ LL | match buf {
= note: the matched value is of type `&[u8]`
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 ~ b"AAAA" => {}
+LL ~ b"AAAA" => {},
LL + _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/match-privately-empty.stderr b/tests/ui/pattern/usefulness/match-privately-empty.stderr
index 86f75d15c..45352f094 100644
--- a/tests/ui/pattern/usefulness/match-privately-empty.stderr
+++ b/tests/ui/pattern/usefulness/match-privately-empty.stderr
@@ -12,7 +12,7 @@ note: `Option<Private>` defined here
= note: the matched value is of type `Option<Private>`
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 ~ }) => {}
+LL ~ }) => {},
LL + Some(Private { misc: true, .. }) => todo!()
|
diff --git a/tests/ui/pattern/usefulness/match-slice-patterns.stderr b/tests/ui/pattern/usefulness/match-slice-patterns.stderr
index 961dd5901..63d1f38e9 100644
--- a/tests/ui/pattern/usefulness/match-slice-patterns.stderr
+++ b/tests/ui/pattern/usefulness/match-slice-patterns.stderr
@@ -7,7 +7,7 @@ LL | match list {
= note: the matched value is of type `&[Option<()>]`
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 ~ &[.., Some(_), _] => {}
+LL ~ &[.., Some(_), _] => {},
LL ~ &[_, Some(_), .., None, _] => todo!(),
|
diff --git a/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
index 769d4070f..8489e2f14 100644
--- a/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
+++ b/tests/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
@@ -18,7 +18,7 @@ LL | C
= note: the matched value is of type `E`
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 ~ E::A => {}
+LL ~ E::A => {},
LL + E::B | E::C => todo!()
|
@@ -44,8 +44,8 @@ LL | C
= note: the matched value is of type `E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | if let E::A = e { todo!() }
- | ++ ~~~~~~~~~~~
+LL | if let E::A = e { todo!() };
+ | ++ +++++++++++
error[E0004]: non-exhaustive patterns: `&E::B` and `&E::C` not covered
--> $DIR/non-exhaustive-defined-here.rs:50:11
@@ -67,7 +67,7 @@ LL | C
= note: the matched value is of type `&E`
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 ~ E::A => {}
+LL ~ E::A => {},
LL + &E::B | &E::C => todo!()
|
@@ -93,8 +93,8 @@ LL | C
= note: the matched value is of type `&E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | if let E::A = e { todo!() }
- | ++ ~~~~~~~~~~~
+LL | if let E::A = e { todo!() };
+ | ++ +++++++++++
error[E0004]: non-exhaustive patterns: `&&mut &E::B` and `&&mut &E::C` not covered
--> $DIR/non-exhaustive-defined-here.rs:66:11
@@ -116,7 +116,7 @@ LL | C
= note: the matched value is of type `&&mut &E`
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 ~ E::A => {}
+LL ~ E::A => {},
LL + &&mut &E::B | &&mut &E::C => todo!()
|
@@ -142,8 +142,8 @@ LL | C
= note: the matched value is of type `&&mut &E`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | if let E::A = e { todo!() }
- | ++ ~~~~~~~~~~~
+LL | if let E::A = e { todo!() };
+ | ++ +++++++++++
error[E0004]: non-exhaustive patterns: `Opt::None` not covered
--> $DIR/non-exhaustive-defined-here.rs:92:11
@@ -162,7 +162,7 @@ LL | None,
= note: the matched value is of type `Opt`
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 ~ Opt::Some(ref _x) => {}
+LL ~ Opt::Some(ref _x) => {},
LL + Opt::None => todo!()
|
diff --git a/tests/ui/pattern/usefulness/non-exhaustive-match-nested.stderr b/tests/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
index 44f327421..98e417a17 100644
--- a/tests/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
+++ b/tests/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
@@ -25,7 +25,7 @@ LL | enum T { A(U), B }
= note: the matched value is of type `T`
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 ~ T::B => { panic!("goodbye"); }
+LL ~ T::B => { panic!("goodbye"); },
LL + T::A(U::C) => todo!()
|
diff --git a/tests/ui/pattern/usefulness/non-exhaustive-match.stderr b/tests/ui/pattern/usefulness/non-exhaustive-match.stderr
index e2260f50b..e59e8885e 100644
--- a/tests/ui/pattern/usefulness/non-exhaustive-match.stderr
+++ b/tests/ui/pattern/usefulness/non-exhaustive-match.stderr
@@ -24,7 +24,7 @@ LL | match true {
= note: the matched value is of type `bool`
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 ~ true => {}
+LL ~ true => {},
LL + false => todo!()
|
@@ -42,7 +42,7 @@ note: `Option<i32>` defined here
= note: the matched value is of type `Option<i32>`
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 ~ None => {}
+LL ~ None => {},
LL + Some(_) => todo!()
|
@@ -55,7 +55,7 @@ LL | match (2, 3, 4) {
= note: the matched value is of type `(i32, i32, i32)`
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 ~ (_, _, 4) => {}
+LL ~ (_, _, 4) => {},
LL + (_, _, i32::MIN..=3_i32) | (_, _, 5_i32..=i32::MAX) => todo!()
|
@@ -68,7 +68,7 @@ LL | match (T::A, T::A) {
= note: the matched value is of type `(T, T)`
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 ~ (T::B, T::A) => {}
+LL ~ (T::B, T::A) => {},
LL + (T::A, T::A) | (T::B, T::B) => todo!()
|
@@ -86,7 +86,7 @@ LL | enum T { A, B }
= note: the matched value is of type `T`
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 ~ T::A => {}
+LL ~ T::A => {},
LL + T::B => todo!()
|
@@ -99,7 +99,7 @@ LL | match *vec {
= note: the matched value is of type `[Option<isize>]`
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 ~ [None] => {}
+LL ~ [None] => {},
LL + [] => todo!()
|
diff --git a/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr b/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr
index c518de477..beb51a4d4 100644
--- a/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr
+++ b/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr
@@ -17,8 +17,8 @@ LL | let (1, (Some(1), 2..=3)) = (1, (None, 2));
= note: the matched value is of type `(i32, (Option<i32>, i32))`
help: you might want to use `if let` to ignore the variants that aren't matched
|
-LL | if let (1, (Some(1), 2..=3)) = (1, (None, 2)) { todo!() }
- | ++ ~~~~~~~~~~~
+LL | if let (1, (Some(1), 2..=3)) = (1, (None, 2)) { todo!() };
+ | ++ +++++++++++
error: aborting due to 2 previous errors
diff --git a/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr b/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr
index 55f0b2319..ab3f6f69f 100644
--- a/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr
+++ b/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.stderr
@@ -5,6 +5,10 @@ LL | let f = |3: isize| println!("hello");
| ^ pattern `_` not covered
|
= note: the matched value is of type `isize`
+help: alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits
+ |
+LL | let f = |_3: isize| println!("hello");
+ | +
error: aborting due to previous error
diff --git a/tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr b/tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr
index 5d1e170ae..fb6ecda3c 100644
--- a/tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr
+++ b/tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr
@@ -7,7 +7,7 @@ LL | match s2 {
= note: the matched value is of type `&[bool; 2]`
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 ~ [true, .., true] => {}
+LL ~ [true, .., true] => {},
LL + &[false, _] => todo!()
|
@@ -20,7 +20,7 @@ LL | match s3 {
= note: the matched value is of type `&[bool; 3]`
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 ~ [true, .., true] => {}
+LL ~ [true, .., true] => {},
LL + &[false, ..] => todo!()
|
@@ -33,7 +33,7 @@ LL | match s10 {
= note: the matched value is of type `&[bool; 10]`
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 ~ [true, .., true] => {}
+LL ~ [true, .., true] => {},
LL + &[false, ..] => todo!()
|
@@ -46,7 +46,7 @@ LL | match s2 {
= note: the matched value is of type `&[bool; 2]`
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 ~ [.., false] => {}
+LL ~ [.., false] => {},
LL + &[false, true] => todo!()
|
@@ -59,7 +59,7 @@ LL | match s3 {
= note: the matched value is of type `&[bool; 3]`
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 ~ [.., false] => {}
+LL ~ [.., false] => {},
LL + &[false, .., true] => todo!()
|
@@ -72,7 +72,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ [.., false] => {}
+LL ~ [.., false] => {},
LL + &[false, .., true] => todo!()
|
@@ -85,7 +85,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ [] => {}
+LL ~ [] => {},
LL + &[_, ..] => todo!()
|
@@ -98,7 +98,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ [_] => {}
+LL ~ [_] => {},
LL + &[_, _, ..] => todo!()
|
@@ -111,7 +111,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ [true, ..] => {}
+LL ~ [true, ..] => {},
LL + &[false, ..] => todo!()
|
@@ -124,7 +124,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ [true, ..] => {}
+LL ~ [true, ..] => {},
LL + &[false, _, ..] => todo!()
|
@@ -137,7 +137,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ [.., true] => {}
+LL ~ [.., true] => {},
LL + &[_, .., false] => todo!()
|
@@ -150,7 +150,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ [.., false] => {}
+LL ~ [.., false] => {},
LL + &[_, _, .., true] => todo!()
|
@@ -163,7 +163,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ [false, .., false] => {}
+LL ~ [false, .., false] => {},
LL + &[true, _, .., _] => todo!()
|
@@ -176,7 +176,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ &[true] => {}
+LL ~ &[true] => {},
LL + &[] | &[_, _, ..] => todo!()
|
@@ -189,7 +189,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ CONST => {}
+LL ~ CONST => {},
LL + &[] | &[_, _, ..] => todo!()
|
@@ -202,7 +202,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ &[false] => {}
+LL ~ &[false] => {},
LL + &[] | &[_, _, ..] => todo!()
|
@@ -215,7 +215,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ CONST => {}
+LL ~ CONST => {},
LL + &[] | &[_, _, ..] => todo!()
|
@@ -228,7 +228,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ CONST => {}
+LL ~ CONST => {},
LL + &[_, _, ..] => todo!()
|
@@ -241,7 +241,7 @@ LL | match s {
= note: the matched value is of type `&[bool]`
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 ~ &[_, _, ..] => {}
+LL ~ &[_, _, ..] => {},
LL + &[false] => todo!()
|
@@ -254,7 +254,7 @@ LL | match s1 {
= note: the matched value is of type `&[bool; 1]`
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 ~ CONST1 => {}
+LL ~ CONST1 => {},
LL + &[false] => todo!()
|
diff --git a/tests/ui/pattern/usefulness/stable-gated-patterns.stderr b/tests/ui/pattern/usefulness/stable-gated-patterns.stderr
index 7b8588a3c..f944c25a9 100644
--- a/tests/ui/pattern/usefulness/stable-gated-patterns.stderr
+++ b/tests/ui/pattern/usefulness/stable-gated-patterns.stderr
@@ -15,7 +15,7 @@ LL | Stable2,
= note: the matched value is of type `UnstableEnum`
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 ~ UnstableEnum::Stable => {}
+LL ~ UnstableEnum::Stable => {},
LL + UnstableEnum::Stable2 | _ => todo!()
|
@@ -33,7 +33,7 @@ LL | pub enum UnstableEnum {
= note: the matched value is of type `UnstableEnum`
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 ~ UnstableEnum::Stable2 => {}
+LL ~ UnstableEnum::Stable2 => {},
LL + _ => todo!()
|
diff --git a/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr b/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
index 85c97be29..22425aa0d 100644
--- a/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
+++ b/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
@@ -14,7 +14,7 @@ LL | B { x: Option<isize> },
= note: the matched value is of type `A`
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 ~ A::B { x: None } => {}
+LL ~ A::B { x: None } => {},
LL + A::B { x: Some(_) } => todo!()
|
diff --git a/tests/ui/pattern/usefulness/unstable-gated-patterns.stderr b/tests/ui/pattern/usefulness/unstable-gated-patterns.stderr
index 6dc9a4058..d776249b2 100644
--- a/tests/ui/pattern/usefulness/unstable-gated-patterns.stderr
+++ b/tests/ui/pattern/usefulness/unstable-gated-patterns.stderr
@@ -15,7 +15,7 @@ LL | Unstable,
= note: the matched value is of type `UnstableEnum`
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 ~ UnstableEnum::Stable2 => {}
+LL ~ UnstableEnum::Stable2 => {},
LL + UnstableEnum::Unstable => todo!()
|
diff --git a/tests/ui/auxiliary/xc-private-method-lib.rs b/tests/ui/privacy/auxiliary/xc-private-method-lib.rs
index 4d5ec6de3..4d5ec6de3 100644
--- a/tests/ui/auxiliary/xc-private-method-lib.rs
+++ b/tests/ui/privacy/auxiliary/xc-private-method-lib.rs
diff --git a/tests/ui/privacy/effective_visibilities.rs b/tests/ui/privacy/effective_visibilities.rs
index ff20e20d3..e9ac93160 100644
--- a/tests/ui/privacy/effective_visibilities.rs
+++ b/tests/ui/privacy/effective_visibilities.rs
@@ -1,3 +1,4 @@
+#![rustc_effective_visibility] //~ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
#![feature(rustc_attrs)]
#[rustc_effective_visibility]
@@ -17,13 +18,13 @@ mod outer { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub
}
#[rustc_effective_visibility]
- struct PrivStruct; //~ ERROR Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self)
- //~| ERROR Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self)
+ struct PrivStruct; //~ ERROR not in the table
+ //~| ERROR not in the table
#[rustc_effective_visibility]
pub union PubUnion { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
#[rustc_effective_visibility]
- a: u8, //~ ERROR Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self)
+ a: u8, //~ ERROR not in the table
#[rustc_effective_visibility]
pub b: u8, //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
}
diff --git a/tests/ui/privacy/effective_visibilities.stderr b/tests/ui/privacy/effective_visibilities.stderr
index 046b6095f..f74f812e1 100644
--- a/tests/ui/privacy/effective_visibilities.stderr
+++ b/tests/ui/privacy/effective_visibilities.stderr
@@ -1,140 +1,152 @@
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:1:1
+ |
+LL | / #![rustc_effective_visibility]
+LL | | #![feature(rustc_attrs)]
+LL | |
+LL | | #[rustc_effective_visibility]
+... |
+LL | |
+LL | | fn main() {}
+ | |____________^
+
error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
- --> $DIR/effective_visibilities.rs:4:1
+ --> $DIR/effective_visibilities.rs:5:1
|
LL | mod outer {
| ^^^^^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:6:5
+ --> $DIR/effective_visibilities.rs:7:5
|
LL | pub mod inner1 {
| ^^^^^^^^^^^^^^
error: not in the table
- --> $DIR/effective_visibilities.rs:9:9
+ --> $DIR/effective_visibilities.rs:10:9
|
LL | extern "C" {}
| ^^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:12:9
+ --> $DIR/effective_visibilities.rs:13:9
|
LL | pub trait PubTrait {
| ^^^^^^^^^^^^^^^^^^
-error: Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self)
- --> $DIR/effective_visibilities.rs:20:9
+error: not in the table
+ --> $DIR/effective_visibilities.rs:21:9
|
LL | struct PrivStruct;
| ^^^^^^^^^^^^^^^^^
-error: Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self)
- --> $DIR/effective_visibilities.rs:20:9
+error: not in the table
+ --> $DIR/effective_visibilities.rs:21:9
|
LL | struct PrivStruct;
| ^^^^^^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:24:9
+ --> $DIR/effective_visibilities.rs:25:9
|
LL | pub union PubUnion {
| ^^^^^^^^^^^^^^^^^^
-error: Direct: pub(self), Reexported: pub(self), Reachable: pub(self), ReachableThroughImplTrait: pub(self)
- --> $DIR/effective_visibilities.rs:26:13
+error: not in the table
+ --> $DIR/effective_visibilities.rs:27:13
|
LL | a: u8,
| ^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:28:13
+ --> $DIR/effective_visibilities.rs:29:13
|
LL | pub b: u8,
| ^^^^^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:32:9
+ --> $DIR/effective_visibilities.rs:33:9
|
LL | pub enum Enum {
| ^^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:34:13
+ --> $DIR/effective_visibilities.rs:35:13
|
LL | A(
| ^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:34:13
+ --> $DIR/effective_visibilities.rs:35:13
|
LL | A(
| ^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:37:17
+ --> $DIR/effective_visibilities.rs:38:17
|
LL | PubUnion,
| ^^^^^^^^
error: not in the table
- --> $DIR/effective_visibilities.rs:43:5
+ --> $DIR/effective_visibilities.rs:44:5
|
LL | macro_rules! none_macro {
| ^^^^^^^^^^^^^^^^^^^^^^^
error: Direct: pub(self), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:49:5
+ --> $DIR/effective_visibilities.rs:50:5
|
LL | macro_rules! public_macro {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:54:5
+ --> $DIR/effective_visibilities.rs:55:5
|
LL | pub struct ReachableStruct {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:56:9
+ --> $DIR/effective_visibilities.rs:57:9
|
LL | pub a: u8,
| ^^^^^^^^^
error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:61:9
+ --> $DIR/effective_visibilities.rs:62:9
|
LL | pub use outer::inner1;
| ^^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:67:5
+ --> $DIR/effective_visibilities.rs:68:5
|
LL | pub type HalfPublicImport = u8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
- --> $DIR/effective_visibilities.rs:70:5
+ --> $DIR/effective_visibilities.rs:71:5
|
LL | pub(crate) const HalfPublicImport: u8 = 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:74:9
+ --> $DIR/effective_visibilities.rs:75:9
|
LL | pub use half_public_import::HalfPublicImport;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:14:13
+ --> $DIR/effective_visibilities.rs:15:13
|
LL | const A: i32;
| ^^^^^^^^^^^^
error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
- --> $DIR/effective_visibilities.rs:16:13
+ --> $DIR/effective_visibilities.rs:17:13
|
LL | type B;
| ^^^^^^
-error: aborting due to 23 previous errors
+error: aborting due to 24 previous errors
diff --git a/tests/ui/privacy/issue-29161.rs b/tests/ui/privacy/issue-29161.rs
index d80405aa8..5c926dee0 100644
--- a/tests/ui/privacy/issue-29161.rs
+++ b/tests/ui/privacy/issue-29161.rs
@@ -2,7 +2,7 @@ mod a {
struct A;
impl Default for A {
- pub fn default() -> A { //~ ERROR unnecessary visibility qualifier
+ pub fn default() -> A { //~ ERROR visibility qualifiers are not permitted here
A
}
}
diff --git a/tests/ui/privacy/issue-29161.stderr b/tests/ui/privacy/issue-29161.stderr
index 7ce95e4b0..1a6c80499 100644
--- a/tests/ui/privacy/issue-29161.stderr
+++ b/tests/ui/privacy/issue-29161.stderr
@@ -1,8 +1,10 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/issue-29161.rs:5:9
|
LL | pub fn default() -> A {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
error[E0603]: struct `A` is private
--> $DIR/issue-29161.rs:13:8
diff --git a/tests/ui/privacy/priv-in-bad-locations.rs b/tests/ui/privacy/priv-in-bad-locations.rs
index 76af8c6cd..32c5b801f 100644
--- a/tests/ui/privacy/priv-in-bad-locations.rs
+++ b/tests/ui/privacy/priv-in-bad-locations.rs
@@ -1,4 +1,4 @@
-pub extern "C" { //~ ERROR unnecessary visibility qualifier
+pub extern "C" { //~ ERROR visibility qualifiers are not permitted here
pub fn bar();
}
@@ -8,10 +8,10 @@ trait A {
struct B;
-pub impl B {} //~ ERROR unnecessary visibility qualifier
+pub impl B {} //~ ERROR visibility qualifiers are not permitted here
-pub impl A for B { //~ ERROR unnecessary visibility qualifier
- pub fn foo(&self) {} //~ ERROR unnecessary visibility qualifier
+pub impl A for B { //~ ERROR visibility qualifiers are not permitted here
+ pub fn foo(&self) {} //~ ERROR visibility qualifiers are not permitted here
}
pub fn main() {}
diff --git a/tests/ui/privacy/priv-in-bad-locations.stderr b/tests/ui/privacy/priv-in-bad-locations.stderr
index 75bd2fe47..70dab5bfe 100644
--- a/tests/ui/privacy/priv-in-bad-locations.stderr
+++ b/tests/ui/privacy/priv-in-bad-locations.stderr
@@ -1,30 +1,34 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/priv-in-bad-locations.rs:1:1
|
LL | pub extern "C" {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual foreign items instead
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/priv-in-bad-locations.rs:11:1
|
LL | pub impl B {}
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual impl items instead
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/priv-in-bad-locations.rs:13:1
|
LL | pub impl A for B {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/priv-in-bad-locations.rs:14:5
|
LL | pub fn foo(&self) {}
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
error: aborting due to 4 previous errors
diff --git a/tests/ui/privacy/privacy-ns1.stderr b/tests/ui/privacy/privacy-ns1.stderr
index 91bc84e70..9710cc486 100644
--- a/tests/ui/privacy/privacy-ns1.stderr
+++ b/tests/ui/privacy/privacy-ns1.stderr
@@ -13,7 +13,7 @@ LL | Baz();
| ~~~
help: consider importing this function instead
|
-LL | use foo2::Bar;
+LL + use foo2::Bar;
|
error[E0425]: cannot find function, tuple struct or tuple variant `Bar` in this scope
@@ -31,7 +31,7 @@ LL | Baz();
| ~~~
help: consider importing this function
|
-LL | use foo2::Bar;
+LL + use foo2::Bar;
|
error[E0412]: cannot find type `Bar` in this scope
@@ -49,7 +49,7 @@ LL | let _x: Box<Baz>;
| ~~~
help: consider importing this trait
|
-LL | use foo1::Bar;
+LL + use foo1::Bar;
|
error[E0747]: constant provided when a type was expected
diff --git a/tests/ui/privacy/privacy-ns2.stderr b/tests/ui/privacy/privacy-ns2.stderr
index 904e9013f..75e735e1e 100644
--- a/tests/ui/privacy/privacy-ns2.stderr
+++ b/tests/ui/privacy/privacy-ns2.stderr
@@ -6,7 +6,7 @@ LL | Bar();
|
help: consider importing this function instead
|
-LL | use foo2::Bar;
+LL + use foo2::Bar;
|
error[E0423]: expected function, tuple struct or tuple variant, found trait `Bar`
@@ -24,7 +24,7 @@ LL | Baz();
| ~~~
help: consider importing this function instead
|
-LL | use foo2::Bar;
+LL + use foo2::Bar;
|
error[E0573]: expected type, found function `Bar`
@@ -39,7 +39,7 @@ LL | let _x = Bar();
| ~
help: consider importing this trait instead
|
-LL | use foo1::Bar;
+LL + use foo1::Bar;
|
error[E0603]: trait `Bar` is private
diff --git a/tests/ui/privacy/privacy-sanity.rs b/tests/ui/privacy/privacy-sanity.rs
index 8bbf1ab5d..6622089dd 100644
--- a/tests/ui/privacy/privacy-sanity.rs
+++ b/tests/ui/privacy/privacy-sanity.rs
@@ -10,17 +10,17 @@ pub struct S {
}
struct Ts(pub u8);
-pub impl Tr for S { //~ ERROR unnecessary visibility qualifier
- pub fn f() {} //~ ERROR unnecessary visibility qualifier
- pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
- pub type T = u8; //~ ERROR unnecessary visibility qualifier
+pub impl Tr for S { //~ ERROR visibility qualifiers are not permitted here
+ pub fn f() {} //~ ERROR visibility qualifiers are not permitted here
+ pub const C: u8 = 0; //~ ERROR visibility qualifiers are not permitted here
+ pub type T = u8; //~ ERROR visibility qualifiers are not permitted here
}
-pub impl S { //~ ERROR unnecessary visibility qualifier
+pub impl S { //~ ERROR visibility qualifiers are not permitted here
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
-pub extern "C" { //~ ERROR unnecessary visibility qualifier
+pub extern "C" { //~ ERROR visibility qualifiers are not permitted here
pub fn f();
pub static St: u8;
}
@@ -36,17 +36,17 @@ const MAIN: u8 = {
}
struct Ts(pub u8);
- pub impl Tr for S { //~ ERROR unnecessary visibility qualifier
- pub fn f() {} //~ ERROR unnecessary visibility qualifier
- pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
- pub type T = u8; //~ ERROR unnecessary visibility qualifier
+ pub impl Tr for S { //~ ERROR visibility qualifiers are not permitted here
+ pub fn f() {} //~ ERROR visibility qualifiers are not permitted here
+ pub const C: u8 = 0; //~ ERROR visibility qualifiers are not permitted here
+ pub type T = u8; //~ ERROR visibility qualifiers are not permitted here
}
- pub impl S { //~ ERROR unnecessary visibility qualifier
+ pub impl S { //~ ERROR visibility qualifiers are not permitted here
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
- pub extern "C" { //~ ERROR unnecessary visibility qualifier
+ pub extern "C" { //~ ERROR visibility qualifiers are not permitted here
pub fn f();
pub static St: u8;
}
@@ -65,17 +65,17 @@ fn main() {
}
struct Ts(pub u8);
- pub impl Tr for S { //~ ERROR unnecessary visibility qualifier
- pub fn f() {} //~ ERROR unnecessary visibility qualifier
- pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
- pub type T = u8; //~ ERROR unnecessary visibility qualifier
+ pub impl Tr for S { //~ ERROR visibility qualifiers are not permitted here
+ pub fn f() {} //~ ERROR visibility qualifiers are not permitted here
+ pub const C: u8 = 0; //~ ERROR visibility qualifiers are not permitted here
+ pub type T = u8; //~ ERROR visibility qualifiers are not permitted here
}
- pub impl S { //~ ERROR unnecessary visibility qualifier
+ pub impl S { //~ ERROR visibility qualifiers are not permitted here
pub fn f() {}
pub const C: u8 = 0;
// pub type T = u8;
}
- pub extern "C" { //~ ERROR unnecessary visibility qualifier
+ pub extern "C" { //~ ERROR visibility qualifiers are not permitted here
pub fn f();
pub static St: u8;
}
diff --git a/tests/ui/privacy/privacy-sanity.stderr b/tests/ui/privacy/privacy-sanity.stderr
index c92553fd1..a537f8c19 100644
--- a/tests/ui/privacy/privacy-sanity.stderr
+++ b/tests/ui/privacy/privacy-sanity.stderr
@@ -1,120 +1,144 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:13:1
|
LL | pub impl Tr for S {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:14:5
|
LL | pub fn f() {}
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:15:5
|
LL | pub const C: u8 = 0;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:16:5
|
LL | pub type T = u8;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:18:1
|
LL | pub impl S {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual impl items instead
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:23:1
|
LL | pub extern "C" {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual foreign items instead
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:39:5
|
LL | pub impl Tr for S {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:40:9
|
LL | pub fn f() {}
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:41:9
|
LL | pub const C: u8 = 0;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:42:9
|
LL | pub type T = u8;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:44:5
|
LL | pub impl S {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual impl items instead
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:49:5
|
LL | pub extern "C" {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual foreign items instead
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:68:5
|
LL | pub impl Tr for S {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:69:9
|
LL | pub fn f() {}
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:70:9
|
LL | pub const C: u8 = 0;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:71:9
|
LL | pub type T = u8;
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:73:5
|
LL | pub impl S {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual impl items instead
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/privacy-sanity.rs:78:5
|
LL | pub extern "C" {
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
|
= note: place qualifiers on individual foreign items instead
diff --git a/tests/ui/privacy/private-in-public-assoc-ty.rs b/tests/ui/privacy/private-in-public-assoc-ty.rs
index fba72c131..d4d379bdb 100644
--- a/tests/ui/privacy/private-in-public-assoc-ty.rs
+++ b/tests/ui/privacy/private-in-public-assoc-ty.rs
@@ -2,7 +2,7 @@
// This test also ensures that the checks are performed even inside private modules.
#![feature(associated_type_defaults)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
mod m {
struct Priv;
diff --git a/tests/ui/privacy/private-in-public-type-alias-impl-trait.rs b/tests/ui/privacy/private-in-public-type-alias-impl-trait.rs
index c7df31529..fe6ed4673 100644
--- a/tests/ui/privacy/private-in-public-type-alias-impl-trait.rs
+++ b/tests/ui/privacy/private-in-public-type-alias-impl-trait.rs
@@ -1,5 +1,5 @@
// build-pass (FIXME(62277): could be check-pass?)
-
+#![feature(impl_trait_in_assoc_type)]
#![feature(type_alias_impl_trait)]
#![deny(private_in_public)]
diff --git a/tests/ui/privacy/useless-pub.rs b/tests/ui/privacy/useless-pub.rs
index fde7cd5d8..e4b671142 100644
--- a/tests/ui/privacy/useless-pub.rs
+++ b/tests/ui/privacy/useless-pub.rs
@@ -5,12 +5,12 @@ pub trait E {
}
impl E for A {
- pub fn foo(&self) {} //~ ERROR: unnecessary visibility qualifier
+ pub fn foo(&self) {} //~ ERROR: visibility qualifiers are not permitted here
}
enum Foo {
- V1 { pub f: i32 }, //~ ERROR unnecessary visibility qualifier
- V2(pub i32), //~ ERROR unnecessary visibility qualifier
+ V1 { pub f: i32 }, //~ ERROR visibility qualifiers are not permitted here
+ V2(pub i32), //~ ERROR visibility qualifiers are not permitted here
}
fn main() {}
diff --git a/tests/ui/privacy/useless-pub.stderr b/tests/ui/privacy/useless-pub.stderr
index 14c4983ae..73497e3fe 100644
--- a/tests/ui/privacy/useless-pub.stderr
+++ b/tests/ui/privacy/useless-pub.stderr
@@ -1,20 +1,26 @@
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/useless-pub.rs:8:5
|
LL | pub fn foo(&self) {}
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: trait items always share the visibility of their trait
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/useless-pub.rs:12:10
|
LL | V1 { pub f: i32 },
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: enum variants and their fields always share the visibility of the enum they are in
-error[E0449]: unnecessary visibility qualifier
+error[E0449]: visibility qualifiers are not permitted here
--> $DIR/useless-pub.rs:13:8
|
LL | V2(pub i32),
- | ^^^ `pub` not permitted here because it's implied
+ | ^^^
+ |
+ = note: enum variants and their fields always share the visibility of the enum they are in
error: aborting due to 3 previous errors
diff --git a/tests/ui/xc-private-method.rs b/tests/ui/privacy/xc-private-method.rs
index f05994646..f05994646 100644
--- a/tests/ui/xc-private-method.rs
+++ b/tests/ui/privacy/xc-private-method.rs
diff --git a/tests/ui/xc-private-method.stderr b/tests/ui/privacy/xc-private-method.stderr
index 0eabc592a..0eabc592a 100644
--- a/tests/ui/xc-private-method.stderr
+++ b/tests/ui/privacy/xc-private-method.stderr
diff --git a/tests/ui/xc-private-method2.rs b/tests/ui/privacy/xc-private-method2.rs
index f11b25108..f11b25108 100644
--- a/tests/ui/xc-private-method2.rs
+++ b/tests/ui/privacy/xc-private-method2.rs
diff --git a/tests/ui/xc-private-method2.stderr b/tests/ui/privacy/xc-private-method2.stderr
index af0c3cfcb..af0c3cfcb 100644
--- a/tests/ui/xc-private-method2.stderr
+++ b/tests/ui/privacy/xc-private-method2.stderr
diff --git a/tests/ui/proc-macro/amputate-span.stderr b/tests/ui/proc-macro/amputate-span.stderr
index ab4670411..aa797339b 100644
--- a/tests/ui/proc-macro/amputate-span.stderr
+++ b/tests/ui/proc-macro/amputate-span.stderr
@@ -6,7 +6,7 @@ LL | Command::new("git");
|
help: consider importing this struct
|
-LL | use std::process::Command;
+LL + use std::process::Command;
|
error[E0433]: failed to resolve: use of undeclared type `Command`
@@ -17,7 +17,7 @@ LL | Command::new("git");
|
help: consider importing this struct
|
-LL | use std::process::Command;
+LL + use std::process::Command;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/proc-macro/attributes-on-modules-fail.stderr b/tests/ui/proc-macro/attributes-on-modules-fail.stderr
index bb6cbb698..97521f23a 100644
--- a/tests/ui/proc-macro/attributes-on-modules-fail.stderr
+++ b/tests/ui/proc-macro/attributes-on-modules-fail.stderr
@@ -50,7 +50,7 @@ LL | type A = Y;
|
help: consider importing this struct
|
-LL | use Y;
+LL + use Y;
|
error[E0412]: cannot find type `X` in this scope
@@ -61,7 +61,7 @@ LL | type A = X;
|
help: consider importing this struct
|
-LL | use m::X;
+LL + use m::X;
|
error: aborting due to 7 previous errors
diff --git a/tests/ui/proc-macro/bad-projection.rs b/tests/ui/proc-macro/bad-projection.rs
new file mode 100644
index 000000000..d214c7ac8
--- /dev/null
+++ b/tests/ui/proc-macro/bad-projection.rs
@@ -0,0 +1,15 @@
+// force-host
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+#![allow(warnings)]
+
+extern crate proc_macro;
+
+trait Project {
+ type Assoc;
+}
+
+#[proc_macro]
+pub fn uwu() -> <() as Project>::Assoc {}
+//~^ ERROR the trait bound `(): Project` is not satisfied
diff --git a/tests/ui/proc-macro/bad-projection.stderr b/tests/ui/proc-macro/bad-projection.stderr
new file mode 100644
index 000000000..8a8246376
--- /dev/null
+++ b/tests/ui/proc-macro/bad-projection.stderr
@@ -0,0 +1,9 @@
+error[E0277]: the trait bound `(): Project` is not satisfied
+ --> $DIR/bad-projection.rs:14:17
+ |
+LL | pub fn uwu() -> <() as Project>::Assoc {}
+ | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Project` is not implemented for `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/proc-macro/derive-bad.rs b/tests/ui/proc-macro/derive-bad.rs
index cb5188b5f..92d35f537 100644
--- a/tests/ui/proc-macro/derive-bad.rs
+++ b/tests/ui/proc-macro/derive-bad.rs
@@ -4,7 +4,7 @@
extern crate derive_bad;
#[derive(A)]
-//~^ ERROR proc-macro derive produced unparseable tokens
+//~^ ERROR proc-macro derive produced unparsable tokens
//~| ERROR expected `:`, found `}`
struct A; //~ ERROR the name `A` is defined multiple times
diff --git a/tests/ui/proc-macro/derive-bad.stderr b/tests/ui/proc-macro/derive-bad.stderr
index 241f99b28..43e97f40b 100644
--- a/tests/ui/proc-macro/derive-bad.stderr
+++ b/tests/ui/proc-macro/derive-bad.stderr
@@ -9,7 +9,7 @@ LL | #[derive(A)]
|
= note: this error originates in the derive macro `A` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: proc-macro derive produced unparseable tokens
+error: proc-macro derive produced unparsable tokens
--> $DIR/derive-bad.rs:6:10
|
LL | #[derive(A)]
diff --git a/tests/ui/proc-macro/issue-91800.rs b/tests/ui/proc-macro/issue-91800.rs
index 0c1281de4..f48c8bf72 100644
--- a/tests/ui/proc-macro/issue-91800.rs
+++ b/tests/ui/proc-macro/issue-91800.rs
@@ -5,7 +5,7 @@ extern crate issue_91800_macro;
#[derive(MyTrait)]
//~^ ERROR macros that expand to items must be delimited with braces or followed by a semicolon
-//~| ERROR proc-macro derive produced unparseable tokens
+//~| ERROR proc-macro derive produced unparsable tokens
#[attribute_macro]
//~^ ERROR macros that expand to items must be delimited with braces or followed by a semicolon
struct MyStruct;
diff --git a/tests/ui/proc-macro/issue-91800.stderr b/tests/ui/proc-macro/issue-91800.stderr
index 9c356263a..d831d62e9 100644
--- a/tests/ui/proc-macro/issue-91800.stderr
+++ b/tests/ui/proc-macro/issue-91800.stderr
@@ -6,7 +6,7 @@ LL | #[derive(MyTrait)]
|
= note: this error originates in the derive macro `MyTrait` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: proc-macro derive produced unparseable tokens
+error: proc-macro derive produced unparsable tokens
--> $DIR/issue-91800.rs:6:10
|
LL | #[derive(MyTrait)]
diff --git a/tests/ui/proc-macro/macro-namespace-reserved-2.stderr b/tests/ui/proc-macro/macro-namespace-reserved-2.stderr
index 633a6c6a0..b9effe7cf 100644
--- a/tests/ui/proc-macro/macro-namespace-reserved-2.stderr
+++ b/tests/ui/proc-macro/macro-namespace-reserved-2.stderr
@@ -57,6 +57,14 @@ error: expected derive macro, found attribute macro `my_macro_attr`
|
LL | #[derive(my_macro_attr)]
| ^^^^^^^^^^^^^ not a derive macro
+ |
+help: remove from the surrounding `derive()`
+ --> $DIR/macro-namespace-reserved-2.rs:53:10
+ |
+LL | #[derive(my_macro_attr)]
+ | ^^^^^^^^^^^^^
+ = help: add as non-Derive macro
+ `#[my_macro_attr]`
error: can't use a procedural macro from the same crate that defines it
--> $DIR/macro-namespace-reserved-2.rs:56:10
@@ -87,6 +95,14 @@ error: expected derive macro, found macro `crate::my_macro`
|
LL | #[derive(crate::my_macro)]
| ^^^^^^^^^^^^^^^ not a derive macro
+ |
+help: remove from the surrounding `derive()`
+ --> $DIR/macro-namespace-reserved-2.rs:50:10
+ |
+LL | #[derive(crate::my_macro)]
+ | ^^^^^^^^^^^^^^^
+ = help: add as non-Derive macro
+ `#[crate::my_macro]`
error: cannot find macro `my_macro_attr` in this scope
--> $DIR/macro-namespace-reserved-2.rs:28:5
diff --git a/tests/ui/proc-macro/proc-macro-abi.rs b/tests/ui/proc-macro/proc-macro-abi.rs
index 873660a5b..93a613e8b 100644
--- a/tests/ui/proc-macro/proc-macro-abi.rs
+++ b/tests/ui/proc-macro/proc-macro-abi.rs
@@ -9,19 +9,19 @@ use proc_macro::TokenStream;
#[proc_macro]
pub extern "C" fn abi(a: TokenStream) -> TokenStream {
- //~^ ERROR proc macro functions may not be `extern "C"`
+ //~^ ERROR function-like proc macro has incorrect signature
a
}
#[proc_macro]
pub extern "system" fn abi2(a: TokenStream) -> TokenStream {
- //~^ ERROR proc macro functions may not be `extern "system"`
+ //~^ ERROR function-like proc macro has incorrect signature
a
}
#[proc_macro]
pub extern fn abi3(a: TokenStream) -> TokenStream {
- //~^ ERROR proc macro functions may not be `extern "C"`
+ //~^ ERROR function-like proc macro has incorrect signature
a
}
diff --git a/tests/ui/proc-macro/proc-macro-abi.stderr b/tests/ui/proc-macro/proc-macro-abi.stderr
index 9a781be09..ccc72e518 100644
--- a/tests/ui/proc-macro/proc-macro-abi.stderr
+++ b/tests/ui/proc-macro/proc-macro-abi.stderr
@@ -1,20 +1,29 @@
-error: proc macro functions may not be `extern "C"`
+error: function-like proc macro has incorrect signature
--> $DIR/proc-macro-abi.rs:11:1
|
LL | pub extern "C" fn abi(a: TokenStream) -> TokenStream {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "Rust" fn, found "C" fn
+ |
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `extern "C" fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
-error: proc macro functions may not be `extern "system"`
+error: function-like proc macro has incorrect signature
--> $DIR/proc-macro-abi.rs:17:1
|
LL | pub extern "system" fn abi2(a: TokenStream) -> TokenStream {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "Rust" fn, found "system" fn
+ |
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `extern "system" fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
-error: proc macro functions may not be `extern "C"`
+error: function-like proc macro has incorrect signature
--> $DIR/proc-macro-abi.rs:23:1
|
LL | pub extern fn abi3(a: TokenStream) -> TokenStream {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "Rust" fn, found "C" fn
+ |
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `extern "C" fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
error: aborting due to 3 previous errors
diff --git a/tests/ui/proc-macro/signature-proc-macro-attribute.rs b/tests/ui/proc-macro/signature-proc-macro-attribute.rs
index 51abc8e7d..fb48f748c 100644
--- a/tests/ui/proc-macro/signature-proc-macro-attribute.rs
+++ b/tests/ui/proc-macro/signature-proc-macro-attribute.rs
@@ -8,25 +8,23 @@ use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn bad_input(input: String) -> TokenStream {
- //~^ ERROR mismatched attribute proc macro signature
+ //~^ ERROR attribute proc macro has incorrect signature
::proc_macro::TokenStream::new()
}
#[proc_macro_attribute]
pub fn bad_output(input: TokenStream) -> String {
- //~^ ERROR mismatched attribute proc macro signature
- //~| ERROR mismatched attribute proc macro signature
+ //~^ ERROR attribute proc macro has incorrect signature
String::from("blah")
}
#[proc_macro_attribute]
pub fn bad_everything(input: String) -> String {
- //~^ ERROR mismatched attribute proc macro signature
- //~| ERROR mismatched attribute proc macro signature
+ //~^ ERROR attribute proc macro has incorrect signature
input
}
#[proc_macro_attribute]
pub fn too_many(a: TokenStream, b: TokenStream, c: String) -> TokenStream {
- //~^ ERROR mismatched attribute proc macro signature
+ //~^ ERROR attribute proc macro has incorrect signature
}
diff --git a/tests/ui/proc-macro/signature-proc-macro-attribute.stderr b/tests/ui/proc-macro/signature-proc-macro-attribute.stderr
index abf7a6f3c..ce832eaa5 100644
--- a/tests/ui/proc-macro/signature-proc-macro-attribute.stderr
+++ b/tests/ui/proc-macro/signature-proc-macro-attribute.stderr
@@ -1,42 +1,38 @@
-error: mismatched attribute proc macro signature
+error: attribute proc macro has incorrect signature
--> $DIR/signature-proc-macro-attribute.rs:10:1
|
LL | pub fn bad_input(input: String) -> TokenStream {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attribute proc macro must have two arguments of type `proc_macro::TokenStream`
-
-error: mismatched attribute proc macro signature
- --> $DIR/signature-proc-macro-attribute.rs:16:42
- |
-LL | pub fn bad_output(input: TokenStream) -> String {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
|
- = note: attribute proc macros must have a signature of `fn(TokenStream, TokenStream) -> TokenStream`
+ = note: expected signature `fn(proc_macro::TokenStream, proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(std::string::String) -> proc_macro::TokenStream`
-error: mismatched attribute proc macro signature
+error: attribute proc macro has incorrect signature
--> $DIR/signature-proc-macro-attribute.rs:16:1
|
LL | pub fn bad_output(input: TokenStream) -> String {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attribute proc macro must have two arguments of type `proc_macro::TokenStream`
-
-error: mismatched attribute proc macro signature
- --> $DIR/signature-proc-macro-attribute.rs:23:41
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
|
-LL | pub fn bad_everything(input: String) -> String {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
- |
- = note: attribute proc macros must have a signature of `fn(TokenStream, TokenStream) -> TokenStream`
+ = note: expected signature `fn(proc_macro::TokenStream, proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(proc_macro::TokenStream) -> std::string::String`
-error: mismatched attribute proc macro signature
- --> $DIR/signature-proc-macro-attribute.rs:23:1
+error: attribute proc macro has incorrect signature
+ --> $DIR/signature-proc-macro-attribute.rs:22:1
|
LL | pub fn bad_everything(input: String) -> String {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attribute proc macro must have two arguments of type `proc_macro::TokenStream`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
+ |
+ = note: expected signature `fn(proc_macro::TokenStream, proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(std::string::String) -> std::string::String`
-error: mismatched attribute proc macro signature
- --> $DIR/signature-proc-macro-attribute.rs:30:49
+error: attribute proc macro has incorrect signature
+ --> $DIR/signature-proc-macro-attribute.rs:28:52
|
LL | pub fn too_many(a: TokenStream, b: TokenStream, c: String) -> TokenStream {
- | ^^^^^^^^^ found unexpected argument
+ | ^^^^^^ incorrect number of function parameters
+ |
+ = note: expected signature `fn(proc_macro::TokenStream, proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(proc_macro::TokenStream, proc_macro::TokenStream, std::string::String) -> proc_macro::TokenStream`
-error: aborting due to 6 previous errors
+error: aborting due to 4 previous errors
diff --git a/tests/ui/proc-macro/signature-proc-macro-derive.rs b/tests/ui/proc-macro/signature-proc-macro-derive.rs
index f2fd824b6..d294b1591 100644
--- a/tests/ui/proc-macro/signature-proc-macro-derive.rs
+++ b/tests/ui/proc-macro/signature-proc-macro-derive.rs
@@ -8,24 +8,23 @@ use proc_macro::TokenStream;
#[proc_macro_derive(Blah)]
pub fn bad_input(input: String) -> TokenStream {
- //~^ ERROR mismatched derive proc macro signature
+ //~^ ERROR derive proc macro has incorrect signature
TokenStream::new()
}
#[proc_macro_derive(Bleh)]
pub fn bad_output(input: TokenStream) -> String {
- //~^ ERROR mismatched derive proc macro signature
+ //~^ ERROR derive proc macro has incorrect signature
String::from("blah")
}
#[proc_macro_derive(Bluh)]
pub fn bad_everything(input: String) -> String {
- //~^ ERROR mismatched derive proc macro signature
- //~| ERROR mismatched derive proc macro signature
+ //~^ ERROR derive proc macro has incorrect signature
input
}
#[proc_macro_derive(Blih)]
pub fn too_many(a: TokenStream, b: TokenStream, c: String) -> TokenStream {
- //~^ ERROR mismatched derive proc macro signature
+ //~^ ERROR derive proc macro has incorrect signature
}
diff --git a/tests/ui/proc-macro/signature-proc-macro-derive.stderr b/tests/ui/proc-macro/signature-proc-macro-derive.stderr
index a358ae277..03c6abad1 100644
--- a/tests/ui/proc-macro/signature-proc-macro-derive.stderr
+++ b/tests/ui/proc-macro/signature-proc-macro-derive.stderr
@@ -1,40 +1,38 @@
-error: mismatched derive proc macro signature
+error: derive proc macro has incorrect signature
--> $DIR/signature-proc-macro-derive.rs:10:25
|
LL | pub fn bad_input(input: String) -> TokenStream {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
+ | ^^^^^^ expected `proc_macro::TokenStream`, found `std::string::String`
|
- = note: derive proc macros must have a signature of `fn(TokenStream) -> TokenStream`
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(std::string::String) -> proc_macro::TokenStream`
-error: mismatched derive proc macro signature
+error: derive proc macro has incorrect signature
--> $DIR/signature-proc-macro-derive.rs:16:42
|
LL | pub fn bad_output(input: TokenStream) -> String {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
+ | ^^^^^^ expected `proc_macro::TokenStream`, found `std::string::String`
|
- = note: derive proc macros must have a signature of `fn(TokenStream) -> TokenStream`
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(proc_macro::TokenStream) -> std::string::String`
-error: mismatched derive proc macro signature
- --> $DIR/signature-proc-macro-derive.rs:22:41
- |
-LL | pub fn bad_everything(input: String) -> String {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
- |
- = note: derive proc macros must have a signature of `fn(TokenStream) -> TokenStream`
-
-error: mismatched derive proc macro signature
+error: derive proc macro has incorrect signature
--> $DIR/signature-proc-macro-derive.rs:22:30
|
LL | pub fn bad_everything(input: String) -> String {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
+ | ^^^^^^ expected `proc_macro::TokenStream`, found `std::string::String`
|
- = note: derive proc macros must have a signature of `fn(TokenStream) -> TokenStream`
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(std::string::String) -> std::string::String`
-error: mismatched derive proc macro signature
- --> $DIR/signature-proc-macro-derive.rs:29:33
+error: derive proc macro has incorrect signature
+ --> $DIR/signature-proc-macro-derive.rs:28:36
|
LL | pub fn too_many(a: TokenStream, b: TokenStream, c: String) -> TokenStream {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ found unexpected arguments
+ | ^^^^^^^^^^^ incorrect number of function parameters
+ |
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(proc_macro::TokenStream, proc_macro::TokenStream, std::string::String) -> proc_macro::TokenStream`
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
diff --git a/tests/ui/proc-macro/signature-proc-macro.rs b/tests/ui/proc-macro/signature-proc-macro.rs
index 54770aacd..ca2509ed8 100644
--- a/tests/ui/proc-macro/signature-proc-macro.rs
+++ b/tests/ui/proc-macro/signature-proc-macro.rs
@@ -8,24 +8,23 @@ use proc_macro::TokenStream;
#[proc_macro]
pub fn bad_input(input: String) -> TokenStream {
- //~^ ERROR mismatched function-like proc macro signature
+ //~^ ERROR function-like proc macro has incorrect signature
::proc_macro::TokenStream::new()
}
#[proc_macro]
pub fn bad_output(input: TokenStream) -> String {
- //~^ ERROR mismatched function-like proc macro signature
+ //~^ ERROR function-like proc macro has incorrect signature
String::from("blah")
}
#[proc_macro]
pub fn bad_everything(input: String) -> String {
- //~^ ERROR mismatched function-like proc macro signature
- //~| ERROR mismatched function-like proc macro signature
+ //~^ ERROR function-like proc macro has incorrect signature
input
}
#[proc_macro]
pub fn too_many(a: TokenStream, b: TokenStream, c: String) -> TokenStream {
- //~^ ERROR mismatched function-like proc macro signature
+ //~^ ERROR function-like proc macro has incorrect signature
}
diff --git a/tests/ui/proc-macro/signature-proc-macro.stderr b/tests/ui/proc-macro/signature-proc-macro.stderr
index 4b14a54e6..dd2cb0570 100644
--- a/tests/ui/proc-macro/signature-proc-macro.stderr
+++ b/tests/ui/proc-macro/signature-proc-macro.stderr
@@ -1,40 +1,38 @@
-error: mismatched function-like proc macro signature
+error: function-like proc macro has incorrect signature
--> $DIR/signature-proc-macro.rs:10:25
|
LL | pub fn bad_input(input: String) -> TokenStream {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
+ | ^^^^^^ expected `proc_macro::TokenStream`, found `std::string::String`
|
- = note: function-like proc macros must have a signature of `fn(TokenStream) -> TokenStream`
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(std::string::String) -> proc_macro::TokenStream`
-error: mismatched function-like proc macro signature
+error: function-like proc macro has incorrect signature
--> $DIR/signature-proc-macro.rs:16:42
|
LL | pub fn bad_output(input: TokenStream) -> String {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
+ | ^^^^^^ expected `proc_macro::TokenStream`, found `std::string::String`
|
- = note: function-like proc macros must have a signature of `fn(TokenStream) -> TokenStream`
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(proc_macro::TokenStream) -> std::string::String`
-error: mismatched function-like proc macro signature
- --> $DIR/signature-proc-macro.rs:22:41
- |
-LL | pub fn bad_everything(input: String) -> String {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
- |
- = note: function-like proc macros must have a signature of `fn(TokenStream) -> TokenStream`
-
-error: mismatched function-like proc macro signature
+error: function-like proc macro has incorrect signature
--> $DIR/signature-proc-macro.rs:22:30
|
LL | pub fn bad_everything(input: String) -> String {
- | ^^^^^^ found std::string::String, expected type `proc_macro::TokenStream`
+ | ^^^^^^ expected `proc_macro::TokenStream`, found `std::string::String`
|
- = note: function-like proc macros must have a signature of `fn(TokenStream) -> TokenStream`
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(std::string::String) -> std::string::String`
-error: mismatched function-like proc macro signature
- --> $DIR/signature-proc-macro.rs:29:33
+error: function-like proc macro has incorrect signature
+ --> $DIR/signature-proc-macro.rs:28:36
|
LL | pub fn too_many(a: TokenStream, b: TokenStream, c: String) -> TokenStream {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ found unexpected arguments
+ | ^^^^^^^^^^^ incorrect number of function parameters
+ |
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `fn(proc_macro::TokenStream, proc_macro::TokenStream, std::string::String) -> proc_macro::TokenStream`
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
diff --git a/tests/ui/proc-macro/signature.rs b/tests/ui/proc-macro/signature.rs
index 11187aa31..7b4982a61 100644
--- a/tests/ui/proc-macro/signature.rs
+++ b/tests/ui/proc-macro/signature.rs
@@ -8,10 +8,6 @@ extern crate proc_macro;
#[proc_macro_derive(A)]
pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
- //~^ ERROR: mismatched derive proc macro signature
- //~| mismatched derive proc macro signature
- //~| mismatched derive proc macro signature
- //~| proc macro functions may not be `extern
- //~| proc macro functions may not be `unsafe
+ //~^ ERROR: derive proc macro has incorrect signature
loop {}
}
diff --git a/tests/ui/proc-macro/signature.stderr b/tests/ui/proc-macro/signature.stderr
index 3dbe3f22a..ba5c8c157 100644
--- a/tests/ui/proc-macro/signature.stderr
+++ b/tests/ui/proc-macro/signature.stderr
@@ -1,36 +1,11 @@
-error: proc macro functions may not be `extern "C"`
+error: derive proc macro has incorrect signature
--> $DIR/signature.rs:10:1
|
LL | pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: proc macro functions may not be `unsafe`
- --> $DIR/signature.rs:10:1
- |
-LL | pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: mismatched derive proc macro signature
- --> $DIR/signature.rs:10:49
- |
-LL | pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
- | ^^^ found u32, expected type `proc_macro::TokenStream`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
|
- = note: derive proc macros must have a signature of `fn(TokenStream) -> TokenStream`
-
-error: mismatched derive proc macro signature
- --> $DIR/signature.rs:10:33
- |
-LL | pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
- | ^^^ found i32, expected type `proc_macro::TokenStream`
- |
- = note: derive proc macros must have a signature of `fn(TokenStream) -> TokenStream`
-
-error: mismatched derive proc macro signature
- --> $DIR/signature.rs:10:38
- |
-LL | pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
- | ^^^^^^ found unexpected argument
+ = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+ found signature `unsafe extern "C" fn(i32, u32) -> u32`
-error: aborting due to 5 previous errors
+error: aborting due to previous error
diff --git a/tests/ui/proc-macro/span-api-tests.rs b/tests/ui/proc-macro/span-api-tests.rs
index 3f04ba866..7493f9cdb 100644
--- a/tests/ui/proc-macro/span-api-tests.rs
+++ b/tests/ui/proc-macro/span-api-tests.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty
// aux-build:span-api-tests.rs
// aux-build:span-test-macros.rs
// compile-flags: -Ztranslate-remapped-path-to-local-path=yes
diff --git a/tests/ui/process/signal-exit-status.rs b/tests/ui/process/signal-exit-status.rs
index 9519ed7b4..0f05f916c 100644
--- a/tests/ui/process/signal-exit-status.rs
+++ b/tests/ui/process/signal-exit-status.rs
@@ -4,14 +4,16 @@
// ignore-windows
// ignore-fuchsia code returned as ZX_TASK_RETCODE_EXCEPTION_KILL, FIXME (#58590)
+#![feature(core_intrinsics)]
+
use std::env;
use std::process::Command;
pub fn main() {
let args: Vec<String> = env::args().collect();
if args.len() >= 2 && args[1] == "signal" {
- // Raise a segfault.
- unsafe { *(1 as *mut isize) = 0; }
+ // Raise an aborting signal without UB
+ core::intrinsics::abort();
} else {
let status = Command::new(&args[0]).arg("signal").status().unwrap();
assert!(status.code().is_none());
diff --git a/tests/ui/range/range-pattern-out-of-bounds-issue-68972.rs b/tests/ui/range/range-pattern-out-of-bounds-issue-68972.rs
index d02caff1f..206f05d0d 100644
--- a/tests/ui/range/range-pattern-out-of-bounds-issue-68972.rs
+++ b/tests/ui/range/range-pattern-out-of-bounds-issue-68972.rs
@@ -4,10 +4,8 @@ fn main() {
match 0u8 {
251..257 => {}
//~^ ERROR literal out of range
- //~| ERROR literal out of range
251..=256 => {}
//~^ ERROR literal out of range
- //~| ERROR literal out of range
_ => {}
}
}
diff --git a/tests/ui/range/range-pattern-out-of-bounds-issue-68972.stderr b/tests/ui/range/range-pattern-out-of-bounds-issue-68972.stderr
index 7b8309b9b..4f3f9d1eb 100644
--- a/tests/ui/range/range-pattern-out-of-bounds-issue-68972.stderr
+++ b/tests/ui/range/range-pattern-out-of-bounds-issue-68972.stderr
@@ -5,22 +5,10 @@ LL | 251..257 => {}
| ^^^ this value doesn't fit in `u8` whose maximum value is `255`
error: literal out of range for `u8`
- --> $DIR/range-pattern-out-of-bounds-issue-68972.rs:8:15
+ --> $DIR/range-pattern-out-of-bounds-issue-68972.rs:7:15
|
LL | 251..=256 => {}
| ^^^ this value doesn't fit in `u8` whose maximum value is `255`
-error: literal out of range for `u8`
- --> $DIR/range-pattern-out-of-bounds-issue-68972.rs:5:14
- |
-LL | 251..257 => {}
- | ^^^ this value doesn't fit in `u8` whose maximum value is `255`
-
-error: literal out of range for `u8`
- --> $DIR/range-pattern-out-of-bounds-issue-68972.rs:8:15
- |
-LL | 251..=256 => {}
- | ^^^ this value doesn't fit in `u8` whose maximum value is `255`
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
diff --git a/tests/ui/range/range_traits-2.stderr b/tests/ui/range/range_traits-2.stderr
index 61facba53..0829fc2ce 100644
--- a/tests/ui/range/range_traits-2.stderr
+++ b/tests/ui/range/range_traits-2.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/range_traits-2.rs:3:10
|
LL | #[derive(Copy, Clone)]
diff --git a/tests/ui/range/range_traits-3.stderr b/tests/ui/range/range_traits-3.stderr
index e54d17b32..db19d1bae 100644
--- a/tests/ui/range/range_traits-3.stderr
+++ b/tests/ui/range/range_traits-3.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/range_traits-3.rs:3:10
|
LL | #[derive(Copy, Clone)]
diff --git a/tests/ui/range/range_traits-6.stderr b/tests/ui/range/range_traits-6.stderr
index addc525f1..dfc74f87c 100644
--- a/tests/ui/range/range_traits-6.stderr
+++ b/tests/ui/range/range_traits-6.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/range_traits-6.rs:3:10
|
LL | #[derive(Copy, Clone)]
diff --git a/tests/ui/reachable/expr_box.rs b/tests/ui/reachable/expr_box.rs
deleted file mode 100644
index 00328ea01..000000000
--- a/tests/ui/reachable/expr_box.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#![feature(box_syntax)]
-#![allow(unused_variables)]
-#![deny(unreachable_code)]
-
-fn main() {
- let x = box return; //~ ERROR unreachable
- println!("hi");
-}
diff --git a/tests/ui/reachable/expr_box.stderr b/tests/ui/reachable/expr_box.stderr
deleted file mode 100644
index ea6472cbe..000000000
--- a/tests/ui/reachable/expr_box.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error: unreachable expression
- --> $DIR/expr_box.rs:6:13
- |
-LL | let x = box return;
- | ^^^^------
- | | |
- | | any code following this expression is unreachable
- | unreachable expression
- |
-note: the lint level is defined here
- --> $DIR/expr_box.rs:3:9
- |
-LL | #![deny(unreachable_code)]
- | ^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/tests/ui/reachable-unnameable-type-alias.rs b/tests/ui/reachable/reachable-unnameable-type-alias.rs
index 461355f87..461355f87 100644
--- a/tests/ui/reachable-unnameable-type-alias.rs
+++ b/tests/ui/reachable/reachable-unnameable-type-alias.rs
diff --git a/tests/ui/recursion/issue-95134.rs b/tests/ui/recursion/issue-95134.rs
index fdc4d5369..2f1cffa2f 100644
--- a/tests/ui/recursion/issue-95134.rs
+++ b/tests/ui/recursion/issue-95134.rs
@@ -1,7 +1,7 @@
// build-fail
// known-bug: #95134
// compile-flags: -Copt-level=0
-// failure-status: 101
+// dont-check-failure-status
// dont-check-compiler-stderr
pub fn encode_num<Writer: ExampleWriter>(n: u32, mut writer: Writer) -> Result<(), Writer::Error> {
diff --git a/tests/ui/regions/issue-2718.rs b/tests/ui/regions/issue-2718.rs
deleted file mode 100644
index 6449337ee..000000000
--- a/tests/ui/regions/issue-2718.rs
+++ /dev/null
@@ -1,327 +0,0 @@
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_unsafe)]
-#![allow(unused_imports)]
-#![allow(non_camel_case_types)]
-
-pub type Task = isize;
-
-// tjc: I don't know why
-pub mod pipes {
- use self::state::{empty, full, blocked, terminated};
- use super::Task;
- use std::mem::{forget, transmute};
- use std::mem::{replace, swap};
- use std::mem;
- use std::thread;
- use std::marker::Send;
-
- pub struct Stuff<T> {
- state: state,
- blocked_task: Option<Task>,
- payload: Option<T>
- }
-
- #[derive(PartialEq, Debug)]
- #[repr(isize)]
- pub enum state {
- empty,
- full,
- blocked,
- terminated
- }
-
- pub struct packet<T> {
- state: state,
- blocked_task: Option<Task>,
- payload: Option<T>
- }
-
- unsafe impl<T:Send> Send for packet<T> {}
-
- pub fn packet<T:Send>() -> *const packet<T> {
- unsafe {
- let p: *const packet<T> = mem::transmute(Box::new(Stuff{
- state: empty,
- blocked_task: None::<Task>,
- payload: None::<T>
- }));
- p
- }
- }
-
- mod rusti {
- pub fn atomic_xchg(_dst: &mut isize, _src: isize) -> isize { panic!(); }
- pub fn atomic_xchg_acq(_dst: &mut isize, _src: isize) -> isize { panic!(); }
- pub fn atomic_xchg_rel(_dst: &mut isize, _src: isize) -> isize { panic!(); }
- }
-
- // We should consider moving this to ::std::unsafe, although I
- // suspect graydon would want us to use void pointers instead.
- pub unsafe fn uniquify<T>(x: *const T) -> Box<T> {
- mem::transmute(x)
- }
-
- pub fn swap_state_acq(dst: &mut state, src: state) -> state {
- unsafe {
- transmute(rusti::atomic_xchg_acq(transmute(dst), src as isize))
- }
- }
-
- pub fn swap_state_rel(dst: &mut state, src: state) -> state {
- unsafe {
- transmute(rusti::atomic_xchg_rel(transmute(dst), src as isize))
- }
- }
-
- pub fn send<T:Send>(mut p: send_packet<T>, payload: T) {
- let p = p.unwrap();
- let mut p = unsafe { uniquify(p) };
- assert!((*p).payload.is_none());
- (*p).payload = Some(payload);
- let old_state = swap_state_rel(&mut (*p).state, full);
- match old_state {
- empty => {
- // Yay, fastpath.
-
- // The receiver will eventually clean this up.
- unsafe { forget(p); }
- }
- full => { panic!("duplicate send") }
- blocked => {
-
- // The receiver will eventually clean this up.
- unsafe { forget(p); }
- }
- terminated => {
- // The receiver will never receive this. Rely on drop_glue
- // to clean everything up.
- }
- }
- }
-
- pub fn recv<T:Send>(mut p: recv_packet<T>) -> Option<T> {
- let p = p.unwrap();
- let mut p = unsafe { uniquify(p) };
- loop {
- let old_state = swap_state_acq(&mut (*p).state,
- blocked);
- match old_state {
- empty | blocked => { thread::yield_now(); }
- full => {
- let payload = replace(&mut p.payload, None);
- return Some(payload.unwrap())
- }
- terminated => {
- assert_eq!(old_state, terminated);
- return None;
- }
- }
- }
- }
-
- pub fn sender_terminate<T:Send>(p: *const packet<T>) {
- let mut p = unsafe { uniquify(p) };
- match swap_state_rel(&mut (*p).state, terminated) {
- empty | blocked => {
- // The receiver will eventually clean up.
- unsafe { forget(p) }
- }
- full => {
- // This is impossible
- panic!("you dun goofed")
- }
- terminated => {
- // I have to clean up, use drop_glue
- }
- }
- }
-
- pub fn receiver_terminate<T:Send>(p: *const packet<T>) {
- let mut p = unsafe { uniquify(p) };
- match swap_state_rel(&mut (*p).state, terminated) {
- empty => {
- // the sender will clean up
- unsafe { forget(p) }
- }
- blocked => {
- // this shouldn't happen.
- panic!("terminating a blocked packet")
- }
- terminated | full => {
- // I have to clean up, use drop_glue
- }
- }
- }
-
- pub struct send_packet<T:Send> {
- p: Option<*const packet<T>>,
- }
-
- impl<T:Send> Drop for send_packet<T> {
- fn drop(&mut self) {
- unsafe {
- if self.p != None {
- let self_p: &mut Option<*const packet<T>> =
- mem::transmute(&mut self.p);
- let p = replace(self_p, None);
- sender_terminate(p.unwrap())
- }
- }
- }
- }
-
- impl<T:Send> send_packet<T> {
- pub fn unwrap(&mut self) -> *const packet<T> {
- replace(&mut self.p, None).unwrap()
- }
- }
-
- pub fn send_packet<T:Send>(p: *const packet<T>) -> send_packet<T> {
- send_packet {
- p: Some(p)
- }
- }
-
- pub struct recv_packet<T:Send> {
- p: Option<*const packet<T>>,
- }
-
- impl<T:Send> Drop for recv_packet<T> {
- fn drop(&mut self) {
- unsafe {
- if self.p != None {
- let self_p: &mut Option<*const packet<T>> =
- mem::transmute(&mut self.p);
- let p = replace(self_p, None);
- receiver_terminate(p.unwrap())
- }
- }
- }
- }
-
- impl<T:Send> recv_packet<T> {
- pub fn unwrap(&mut self) -> *const packet<T> {
- replace(&mut self.p, None).unwrap()
- }
- }
-
- pub fn recv_packet<T:Send>(p: *const packet<T>) -> recv_packet<T> {
- recv_packet {
- p: Some(p)
- }
- }
-
- pub fn entangle<T:Send>() -> (send_packet<T>, recv_packet<T>) {
- let p = packet();
- (send_packet(p), recv_packet(p))
- }
-}
-
-pub mod pingpong {
- use std::mem;
-
- pub struct ping(::pipes::send_packet<pong>);
-
- unsafe impl Send for ping {}
-
- pub struct pong(::pipes::send_packet<ping>);
-
- unsafe impl Send for pong {}
-
- pub fn liberate_ping(p: ping) -> ::pipes::send_packet<pong> {
- unsafe {
- let _addr : *const ::pipes::send_packet<pong> = match &p {
- &ping(ref x) => { mem::transmute(x) }
- };
- panic!()
- }
- }
-
- pub fn liberate_pong(p: pong) -> ::pipes::send_packet<ping> {
- unsafe {
- let _addr : *const ::pipes::send_packet<ping> = match &p {
- &pong(ref x) => { mem::transmute(x) }
- };
- panic!()
- }
- }
-
- pub fn init() -> (client::ping, server::ping) {
- ::pipes::entangle()
- }
-
- pub mod client {
- use pingpong;
-
- pub type ping = ::pipes::send_packet<pingpong::ping>;
- pub type pong = ::pipes::recv_packet<pingpong::pong>;
-
- pub fn do_ping(c: ping) -> pong {
- let (sp, rp) = ::pipes::entangle();
-
- ::pipes::send(c, pingpong::ping(sp));
- rp
- }
-
- pub fn do_pong(c: pong) -> (ping, ()) {
- let packet = ::pipes::recv(c);
- if packet.is_none() {
- panic!("sender closed the connection")
- }
- (pingpong::liberate_pong(packet.unwrap()), ())
- }
- }
-
- pub mod server {
- use pingpong;
-
- pub type ping = ::pipes::recv_packet<pingpong::ping>;
- pub type pong = ::pipes::send_packet<pingpong::pong>;
-
- pub fn do_ping(c: ping) -> (pong, ()) {
- let packet = ::pipes::recv(c);
- if packet.is_none() {
- panic!("sender closed the connection")
- }
- (pingpong::liberate_ping(packet.unwrap()), ())
- }
-
- pub fn do_pong(c: pong) -> ping {
- let (sp, rp) = ::pipes::entangle();
- ::pipes::send(c, pingpong::pong(sp));
- rp
- }
- }
-}
-
-fn client(chan: pingpong::client::ping) {
- let chan = pingpong::client::do_ping(chan);
- println!("Sent ping");
- let (_chan, _data) = pingpong::client::do_pong(chan);
- println!("Received pong");
-}
-
-fn server(chan: pingpong::server::ping) {
- let (chan, _data) = pingpong::server::do_ping(chan);
- println!("Received ping");
- let _chan = pingpong::server::do_pong(chan);
- println!("Sent pong");
-}
-
-pub fn main() {
- /*
-// Commented out because of option::get error
-
- let (client_, server_) = pingpong::init();
-
- task::spawn {|client_|
- let client__ = client_.take();
- client(client__);
- };
- task::spawn {|server_|
- let server__ = server_.take();
- server(server_ËŠ);
- };
- */
-}
diff --git a/tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr b/tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr
index 36b936163..1bf8e6e06 100644
--- a/tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr
+++ b/tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr
@@ -7,7 +7,8 @@ LL | let _ = [ a; 5 ];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Foo` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct Foo {
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/crate-in-paths.stderr b/tests/ui/resolve/crate-in-paths.stderr
index b7cf49507..07fb5dcc0 100644
--- a/tests/ui/resolve/crate-in-paths.stderr
+++ b/tests/ui/resolve/crate-in-paths.stderr
@@ -6,7 +6,7 @@ LL | Foo;
|
help: consider importing this unit struct
|
-LL | use crate::bar::Foo;
+LL + use crate::bar::Foo;
|
error: aborting due to previous error
diff --git a/tests/ui/disambiguate-identical-names.rs b/tests/ui/resolve/disambiguate-identical-names.rs
index 708d2cd76..708d2cd76 100644
--- a/tests/ui/disambiguate-identical-names.rs
+++ b/tests/ui/resolve/disambiguate-identical-names.rs
diff --git a/tests/ui/disambiguate-identical-names.stderr b/tests/ui/resolve/disambiguate-identical-names.stderr
index 7d8293018..7d8293018 100644
--- a/tests/ui/disambiguate-identical-names.stderr
+++ b/tests/ui/resolve/disambiguate-identical-names.stderr
diff --git a/tests/ui/resolve/enums-are-namespaced-xc.stderr b/tests/ui/resolve/enums-are-namespaced-xc.stderr
index 6448e596d..5af6cb042 100644
--- a/tests/ui/resolve/enums-are-namespaced-xc.stderr
+++ b/tests/ui/resolve/enums-are-namespaced-xc.stderr
@@ -6,7 +6,7 @@ LL | let _ = namespaced_enums::A;
|
help: consider importing this unit variant
|
-LL | use namespaced_enums::Foo::A;
+LL + use namespaced_enums::Foo::A;
|
help: if you import `A`, refer to it directly
|
@@ -22,7 +22,7 @@ LL | let _ = namespaced_enums::B(10);
|
help: consider importing this tuple variant
|
-LL | use namespaced_enums::Foo::B;
+LL + use namespaced_enums::Foo::B;
|
help: if you import `B`, refer to it directly
|
@@ -38,7 +38,7 @@ LL | let _ = namespaced_enums::C { a: 10 };
|
help: consider importing this variant
|
-LL | use namespaced_enums::Foo::C;
+LL + use namespaced_enums::Foo::C;
|
help: if you import `C`, refer to it directly
|
diff --git a/tests/ui/resolve/filter-intrinsics.stderr b/tests/ui/resolve/filter-intrinsics.stderr
index 955070891..cc1092dd0 100644
--- a/tests/ui/resolve/filter-intrinsics.stderr
+++ b/tests/ui/resolve/filter-intrinsics.stderr
@@ -6,7 +6,7 @@ LL | let _ = size_of::<usize>();
|
help: consider importing this function
|
-LL | use std::mem::size_of;
+LL + use std::mem::size_of;
|
error[E0425]: cannot find function `fabsf64` in this scope
@@ -17,7 +17,7 @@ LL | let _ = fabsf64(1.0);
|
help: consider importing this function
|
-LL | use std::intrinsics::fabsf64;
+LL + use std::intrinsics::fabsf64;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/resolve/issue-102946.stderr b/tests/ui/resolve/issue-102946.stderr
index 65be0258e..b2cdcb25c 100644
--- a/tests/ui/resolve/issue-102946.stderr
+++ b/tests/ui/resolve/issue-102946.stderr
@@ -6,7 +6,7 @@ LL | impl Error for str::Utf8Error {
|
help: consider importing this trait
|
-LL | use std::error::Error;
+LL + use std::error::Error;
|
error[E0223]: ambiguous associated type
diff --git a/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.rs b/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.rs
new file mode 100644
index 000000000..431213e25
--- /dev/null
+++ b/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.rs
@@ -0,0 +1,33 @@
+#![deny(ambiguous_glob_reexports)]
+
+pub mod foo {
+ pub type X = u8;
+}
+
+pub mod bar {
+ pub type X = u8;
+ pub type Y = u8;
+}
+
+pub use foo::*;
+//~^ ERROR ambiguous glob re-exports
+pub use bar::*;
+
+mod ambiguous {
+ mod m1 { pub type A = u8; }
+ mod m2 { pub type A = u8; }
+ pub use self::m1::*;
+ //~^ ERROR ambiguous glob re-exports
+ pub use self::m2::*;
+}
+
+pub mod single {
+ pub use ambiguous::A;
+ //~^ ERROR `A` is ambiguous
+}
+
+pub mod glob {
+ pub use ambiguous::*;
+}
+
+pub fn main() {}
diff --git a/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.stderr b/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.stderr
new file mode 100644
index 000000000..07e61dd86
--- /dev/null
+++ b/tests/ui/resolve/issue-107563-ambiguous-glob-reexports.stderr
@@ -0,0 +1,47 @@
+error[E0659]: `A` is ambiguous
+ --> $DIR/issue-107563-ambiguous-glob-reexports.rs:25:24
+ |
+LL | pub use ambiguous::A;
+ | ^ ambiguous name
+ |
+ = note: ambiguous because of multiple glob imports of a name in the same module
+note: `A` could refer to the type alias imported here
+ --> $DIR/issue-107563-ambiguous-glob-reexports.rs:19:13
+ |
+LL | pub use self::m1::*;
+ | ^^^^^^^^^^^
+ = help: consider adding an explicit import of `A` to disambiguate
+note: `A` could also refer to the type alias imported here
+ --> $DIR/issue-107563-ambiguous-glob-reexports.rs:21:13
+ |
+LL | pub use self::m2::*;
+ | ^^^^^^^^^^^
+ = help: consider adding an explicit import of `A` to disambiguate
+
+error: ambiguous glob re-exports
+ --> $DIR/issue-107563-ambiguous-glob-reexports.rs:12:9
+ |
+LL | pub use foo::*;
+ | ^^^^^^ the name `X` in the type namespace is first re-exported here
+LL |
+LL | pub use bar::*;
+ | ------ but the name `X` in the type namespace is also re-exported here
+ |
+note: the lint level is defined here
+ --> $DIR/issue-107563-ambiguous-glob-reexports.rs:1:9
+ |
+LL | #![deny(ambiguous_glob_reexports)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: ambiguous glob re-exports
+ --> $DIR/issue-107563-ambiguous-glob-reexports.rs:19:13
+ |
+LL | pub use self::m1::*;
+ | ^^^^^^^^^^^ the name `A` in the type namespace is first re-exported here
+LL |
+LL | pub use self::m2::*;
+ | ----------- but the name `A` in the type namespace is also re-exported here
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/resolve/issue-16058.stderr b/tests/ui/resolve/issue-16058.stderr
index c47d22cef..710002a15 100644
--- a/tests/ui/resolve/issue-16058.stderr
+++ b/tests/ui/resolve/issue-16058.stderr
@@ -6,11 +6,11 @@ LL | Result {
|
help: consider importing one of these items instead
|
-LL | use std::fmt::Result;
+LL + use std::fmt::Result;
|
-LL | use std::io::Result;
+LL + use std::io::Result;
|
-LL | use std::thread::Result;
+LL + use std::thread::Result;
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-17518.stderr b/tests/ui/resolve/issue-17518.stderr
index 034d0d01b..492e3b34a 100644
--- a/tests/ui/resolve/issue-17518.stderr
+++ b/tests/ui/resolve/issue-17518.stderr
@@ -6,7 +6,7 @@ LL | E { name: "foobar" };
|
help: consider importing this variant
|
-LL | use SomeEnum::E;
+LL + use SomeEnum::E;
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-21221-1.stderr b/tests/ui/resolve/issue-21221-1.stderr
index 538eeead9..a38116cd7 100644
--- a/tests/ui/resolve/issue-21221-1.stderr
+++ b/tests/ui/resolve/issue-21221-1.stderr
@@ -6,11 +6,11 @@ LL | impl Mul for Foo {
|
help: consider importing one of these items
|
-LL | use mul1::Mul;
+LL + use mul1::Mul;
|
-LL | use mul2::Mul;
+LL + use mul2::Mul;
|
-LL | use std::ops::Mul;
+LL + use std::ops::Mul;
|
error[E0412]: cannot find type `Mul` in this scope
@@ -21,11 +21,11 @@ LL | fn getMul() -> Mul {
|
help: consider importing one of these items
|
-LL | use mul1::Mul;
+LL + use mul1::Mul;
|
-LL | use mul2::Mul;
+LL + use mul2::Mul;
|
-LL | use std::ops::Mul;
+LL + use std::ops::Mul;
|
error[E0405]: cannot find trait `ThisTraitReallyDoesntExistInAnyModuleReally` in this scope
@@ -42,7 +42,7 @@ LL | impl Div for Foo {
|
help: consider importing this trait
|
-LL | use std::ops::Div;
+LL + use std::ops::Div;
|
error: aborting due to 4 previous errors
diff --git a/tests/ui/resolve/issue-21221-2.stderr b/tests/ui/resolve/issue-21221-2.stderr
index d4fd7cb12..9beb62662 100644
--- a/tests/ui/resolve/issue-21221-2.stderr
+++ b/tests/ui/resolve/issue-21221-2.stderr
@@ -6,9 +6,9 @@ LL | impl T for Foo { }
|
help: consider importing one of these items
|
-LL | use baz::T;
+LL + use baz::T;
|
-LL | use foo::bar::T;
+LL + use foo::bar::T;
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-21221-3.stderr b/tests/ui/resolve/issue-21221-3.stderr
index f12e5b09b..0dabdfd9b 100644
--- a/tests/ui/resolve/issue-21221-3.stderr
+++ b/tests/ui/resolve/issue-21221-3.stderr
@@ -6,7 +6,7 @@ LL | impl OuterTrait for Foo {}
|
help: consider importing this trait
|
-LL | use issue_21221_3::outer::OuterTrait;
+LL + use issue_21221_3::outer::OuterTrait;
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-21221-4.stderr b/tests/ui/resolve/issue-21221-4.stderr
index fc15444d0..5af14b1b6 100644
--- a/tests/ui/resolve/issue-21221-4.stderr
+++ b/tests/ui/resolve/issue-21221-4.stderr
@@ -6,7 +6,7 @@ LL | impl T for Foo {}
|
help: consider importing this trait
|
-LL | use issue_21221_4::T;
+LL + use issue_21221_4::T;
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-2356.stderr b/tests/ui/resolve/issue-2356.stderr
index 36f3da7c9..313b3e30d 100644
--- a/tests/ui/resolve/issue-2356.stderr
+++ b/tests/ui/resolve/issue-2356.stderr
@@ -10,7 +10,7 @@ LL | Self::default();
| ~~~~~~~~~~~~~
help: consider importing this function
|
-LL | use std::default::default;
+LL + use std::default::default;
|
error[E0425]: cannot find value `whiskers` in this scope
diff --git a/tests/ui/resolve/issue-26545.stderr b/tests/ui/resolve/issue-26545.stderr
index d3c866925..42a7531c5 100644
--- a/tests/ui/resolve/issue-26545.stderr
+++ b/tests/ui/resolve/issue-26545.stderr
@@ -6,7 +6,7 @@ LL | B(());
|
help: consider importing this tuple struct
|
-LL | use foo::B;
+LL + use foo::B;
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-35675.stderr b/tests/ui/resolve/issue-35675.stderr
index 4a06196d5..44af65b07 100644
--- a/tests/ui/resolve/issue-35675.stderr
+++ b/tests/ui/resolve/issue-35675.stderr
@@ -17,7 +17,7 @@ LL | Apple(5)
|
help: consider importing this tuple variant
|
-LL | use Fruit::Apple;
+LL + use Fruit::Apple;
|
error[E0573]: expected type, found variant `Fruit::Apple`
@@ -37,7 +37,7 @@ LL | Apple(5)
|
help: consider importing this tuple variant
|
-LL | use Fruit::Apple;
+LL + use Fruit::Apple;
|
error[E0573]: expected type, found variant `Ok`
diff --git a/tests/ui/resolve/issue-3907.stderr b/tests/ui/resolve/issue-3907.stderr
index 6fc61cae8..70631a13c 100644
--- a/tests/ui/resolve/issue-3907.stderr
+++ b/tests/ui/resolve/issue-3907.stderr
@@ -10,7 +10,7 @@ LL | trait Foo = dyn issue_3907::Foo;
|
help: consider importing this trait instead
|
-LL | use issue_3907::Foo;
+LL + use issue_3907::Foo;
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/issue-50599.stderr b/tests/ui/resolve/issue-50599.stderr
index b07482c83..d7419b64f 100644
--- a/tests/ui/resolve/issue-50599.stderr
+++ b/tests/ui/resolve/issue-50599.stderr
@@ -6,9 +6,9 @@ LL | const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize;
|
help: consider importing one of these items
|
-LL | use std::f32::consts::LOG10_2;
+LL + use std::f32::consts::LOG10_2;
|
-LL | use std::f64::consts::LOG10_2;
+LL + use std::f64::consts::LOG10_2;
|
help: if you import `LOG10_2`, refer to it directly
|
diff --git a/tests/ui/resolve/issue-73427.stderr b/tests/ui/resolve/issue-73427.stderr
index 4af5f29d8..622de9b39 100644
--- a/tests/ui/resolve/issue-73427.stderr
+++ b/tests/ui/resolve/issue-73427.stderr
@@ -107,9 +107,9 @@ LL | (E::TupleWithFields(/* fields */)).foo();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider importing one of these items instead
|
-LL | use std::f32::consts::E;
+LL + use std::f32::consts::E;
|
-LL | use std::f64::consts::E;
+LL + use std::f64::consts::E;
|
error[E0532]: expected tuple struct or tuple variant, found enum `A`
diff --git a/tests/ui/resolve/issue-90113.stderr b/tests/ui/resolve/issue-90113.stderr
index 1b7872057..5f55d9c24 100644
--- a/tests/ui/resolve/issue-90113.stderr
+++ b/tests/ui/resolve/issue-90113.stderr
@@ -6,7 +6,7 @@ LL | Cons(..) => {}
|
help: consider importing this tuple variant
|
-LL | use list::List::Cons;
+LL + use list::List::Cons;
|
error: aborting due to previous error
diff --git a/tests/ui/resolve/missing-in-namespace.stderr b/tests/ui/resolve/missing-in-namespace.stderr
index fc925ba3b..7a7b749ae 100644
--- a/tests/ui/resolve/missing-in-namespace.stderr
+++ b/tests/ui/resolve/missing-in-namespace.stderr
@@ -6,7 +6,7 @@ LL | let _map = std::hahmap::HashMap::new();
|
help: consider importing this struct
|
-LL | use std::collections::HashMap;
+LL + use std::collections::HashMap;
|
help: if you import `HashMap`, refer to it directly
|
diff --git a/tests/ui/resolve/no-implicit-prelude-nested.stderr b/tests/ui/resolve/no-implicit-prelude-nested.stderr
index 198b630c5..49cf72bfe 100644
--- a/tests/ui/resolve/no-implicit-prelude-nested.stderr
+++ b/tests/ui/resolve/no-implicit-prelude-nested.stderr
@@ -6,7 +6,7 @@ LL | impl Add for Test {}
|
help: consider importing this trait
|
-LL | use std::ops::Add;
+LL + use std::ops::Add;
|
error[E0404]: expected trait, found derive macro `Clone`
@@ -17,7 +17,7 @@ LL | impl Clone for Test {}
|
help: consider importing this trait instead
|
-LL | use std::clone::Clone;
+LL + use std::clone::Clone;
|
error[E0405]: cannot find trait `Iterator` in this scope
@@ -28,7 +28,7 @@ LL | impl Iterator for Test {}
|
help: consider importing this trait
|
-LL | use std::iter::Iterator;
+LL + use std::iter::Iterator;
|
error[E0405]: cannot find trait `ToString` in this scope
@@ -39,7 +39,7 @@ LL | impl ToString for Test {}
|
help: consider importing this trait
|
-LL | use std::string::ToString;
+LL + use std::string::ToString;
|
error[E0405]: cannot find trait `Writer` in this scope
@@ -56,7 +56,7 @@ LL | drop(2)
|
help: consider importing this function
|
-LL | use std::mem::drop;
+LL + use std::mem::drop;
|
error[E0405]: cannot find trait `Add` in this scope
@@ -67,7 +67,7 @@ LL | impl Add for Test {}
|
help: consider importing this trait
|
-LL | use std::ops::Add;
+LL + use std::ops::Add;
|
error[E0404]: expected trait, found derive macro `Clone`
@@ -78,7 +78,7 @@ LL | impl Clone for Test {}
|
help: consider importing this trait instead
|
-LL | use std::clone::Clone;
+LL + use std::clone::Clone;
|
error[E0405]: cannot find trait `Iterator` in this scope
@@ -89,7 +89,7 @@ LL | impl Iterator for Test {}
|
help: consider importing this trait
|
-LL | use std::iter::Iterator;
+LL + use std::iter::Iterator;
|
error[E0405]: cannot find trait `ToString` in this scope
@@ -100,7 +100,7 @@ LL | impl ToString for Test {}
|
help: consider importing this trait
|
-LL | use std::string::ToString;
+LL + use std::string::ToString;
|
error[E0405]: cannot find trait `Writer` in this scope
@@ -117,7 +117,7 @@ LL | drop(2)
|
help: consider importing this function
|
-LL | use std::mem::drop;
+LL + use std::mem::drop;
|
error[E0405]: cannot find trait `Add` in this scope
@@ -128,7 +128,7 @@ LL | impl Add for Test {}
|
help: consider importing this trait
|
-LL | use std::ops::Add;
+LL + use std::ops::Add;
|
error[E0404]: expected trait, found derive macro `Clone`
@@ -139,7 +139,7 @@ LL | impl Clone for Test {}
|
help: consider importing this trait instead
|
-LL | use std::clone::Clone;
+LL + use std::clone::Clone;
|
error[E0405]: cannot find trait `Iterator` in this scope
@@ -150,7 +150,7 @@ LL | impl Iterator for Test {}
|
help: consider importing this trait
|
-LL | use std::iter::Iterator;
+LL + use std::iter::Iterator;
|
error[E0405]: cannot find trait `ToString` in this scope
@@ -161,7 +161,7 @@ LL | impl ToString for Test {}
|
help: consider importing this trait
|
-LL | use std::string::ToString;
+LL + use std::string::ToString;
|
error[E0405]: cannot find trait `Writer` in this scope
@@ -178,7 +178,7 @@ LL | drop(2)
|
help: consider importing this function
|
-LL | use std::mem::drop;
+LL + use std::mem::drop;
|
error: aborting due to 18 previous errors
diff --git a/tests/ui/resolve/no-implicit-prelude.stderr b/tests/ui/resolve/no-implicit-prelude.stderr
index 36a9b65b7..5a759743f 100644
--- a/tests/ui/resolve/no-implicit-prelude.stderr
+++ b/tests/ui/resolve/no-implicit-prelude.stderr
@@ -6,7 +6,7 @@ LL | impl Add for Test {}
|
help: consider importing this trait
|
-LL | use std::ops::Add;
+LL + use std::ops::Add;
|
error[E0404]: expected trait, found derive macro `Clone`
@@ -17,7 +17,7 @@ LL | impl Clone for Test {}
|
help: consider importing this trait instead
|
-LL | use std::clone::Clone;
+LL + use std::clone::Clone;
|
error[E0405]: cannot find trait `Iterator` in this scope
@@ -28,7 +28,7 @@ LL | impl Iterator for Test {}
|
help: consider importing this trait
|
-LL | use std::iter::Iterator;
+LL + use std::iter::Iterator;
|
error[E0405]: cannot find trait `ToString` in this scope
@@ -39,7 +39,7 @@ LL | impl ToString for Test {}
|
help: consider importing this trait
|
-LL | use std::string::ToString;
+LL + use std::string::ToString;
|
error[E0405]: cannot find trait `Writer` in this scope
@@ -56,7 +56,7 @@ LL | drop(2)
|
help: consider importing this function
|
-LL | use std::mem::drop;
+LL + use std::mem::drop;
|
error: aborting due to 6 previous errors
diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr
index 3c051429f..0bb090905 100644
--- a/tests/ui/resolve/privacy-enum-ctor.stderr
+++ b/tests/ui/resolve/privacy-enum-ctor.stderr
@@ -84,9 +84,9 @@ LL | let _: E = m::f;
| ~
help: consider importing one of these items instead
|
-LL | use std::f32::consts::E;
+LL + use std::f32::consts::E;
|
-LL | use std::f64::consts::E;
+LL + use std::f64::consts::E;
|
help: if you import `E`, refer to it directly
|
@@ -121,9 +121,9 @@ LL | let _: E = (E::Fn(/* fields */));
| ~~~~~~~~~~~~~~~~~~~~~
help: consider importing one of these items instead
|
-LL | use std::f32::consts::E;
+LL + use std::f32::consts::E;
|
-LL | use std::f64::consts::E;
+LL + use std::f64::consts::E;
|
error[E0412]: cannot find type `Z` in this scope
diff --git a/tests/ui/resolve/resolve-primitive-fallback.stderr b/tests/ui/resolve/resolve-primitive-fallback.stderr
index f803f9da2..e3a5d4edc 100644
--- a/tests/ui/resolve/resolve-primitive-fallback.stderr
+++ b/tests/ui/resolve/resolve-primitive-fallback.stderr
@@ -12,7 +12,7 @@ LL | let _: ::u8;
|
help: consider importing this builtin type
|
-LL | use std::primitive::u8;
+LL + use std::primitive::u8;
|
help: if you import `u8`, refer to it directly
|
diff --git a/tests/ui/resolve/tool-import.rs b/tests/ui/resolve/tool-import.rs
new file mode 100644
index 000000000..971993332
--- /dev/null
+++ b/tests/ui/resolve/tool-import.rs
@@ -0,0 +1,8 @@
+// edition: 2018
+
+use clippy::time::Instant;
+//~^ `clippy` is a tool module
+
+fn main() {
+ Instant::now();
+}
diff --git a/tests/ui/resolve/tool-import.stderr b/tests/ui/resolve/tool-import.stderr
new file mode 100644
index 000000000..d3bdfc93d
--- /dev/null
+++ b/tests/ui/resolve/tool-import.stderr
@@ -0,0 +1,9 @@
+error[E0433]: failed to resolve: `clippy` is a tool module, not a module
+ --> $DIR/tool-import.rs:3:5
+ |
+LL | use clippy::time::Instant;
+ | ^^^^^^ `clippy` is a tool module, not a module
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/ui/resolve/use_suggestion.stderr b/tests/ui/resolve/use_suggestion.stderr
index 54ad85383..1155f5caa 100644
--- a/tests/ui/resolve/use_suggestion.stderr
+++ b/tests/ui/resolve/use_suggestion.stderr
@@ -6,7 +6,7 @@ LL | let x1 = HashMap::new();
|
help: consider importing this struct
|
-LL | use std::collections::HashMap;
+LL + use std::collections::HashMap;
|
error[E0412]: cannot find type `HashMap` in this scope
@@ -17,7 +17,7 @@ LL | let y1: HashMap;
|
help: consider importing this struct
|
-LL | use std::collections::HashMap;
+LL + use std::collections::HashMap;
|
error[E0412]: cannot find type `GooMap` in this scope
diff --git a/tests/ui/resolve/use_suggestion_placement.stderr b/tests/ui/resolve/use_suggestion_placement.stderr
index 0aadd82f6..3611f9ae6 100644
--- a/tests/ui/resolve/use_suggestion_placement.stderr
+++ b/tests/ui/resolve/use_suggestion_placement.stderr
@@ -6,7 +6,7 @@ LL | type Bar = Path;
|
help: consider importing this struct
|
-LL | use std::path::Path;
+LL + use std::path::Path;
|
error[E0425]: cannot find value `A` in this scope
@@ -17,7 +17,7 @@ LL | let _ = A;
|
help: consider importing this constant
|
-LL | use m::A;
+LL + use m::A;
|
error[E0412]: cannot find type `HashMap` in this scope
@@ -28,7 +28,7 @@ LL | type Dict<K, V> = HashMap<K, V>;
|
help: consider importing this struct
|
-LL | use std::collections::HashMap;
+LL + use std::collections::HashMap;
|
error: aborting due to 3 previous errors
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr
index c73a6cf13..f08ba522a 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be ann
|
LL | WRAP_DIRECT_INLINE => { panic!("WRAP_DIRECT_INLINE matched itself"); }
| ^^^^^^^^^^^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr
index 6fdf9db89..012ccab17 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be ann
|
LL | WRAP_DIRECT_PARAM => { panic!("WRAP_DIRECT_PARAM matched itself"); }
| ^^^^^^^^^^^^^^^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
index 10dd635ff..94ee2216e 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
@@ -6,6 +6,8 @@ LL | WRAP_DOUBLY_INDIRECT_INLINE => { panic!("WRAP_DOUBLY_INDIRECT_INLIN
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
note: the lint level is defined here
--> $DIR/cant-hide-behind-doubly-indirect-embedded.rs:7:9
|
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
index 66aecbc4f..666b7b95e 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
@@ -6,6 +6,8 @@ LL | WRAP_DOUBLY_INDIRECT_PARAM => { panic!("WRAP_DOUBLY_INDIRECT_PARAM
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
note: the lint level is defined here
--> $DIR/cant-hide-behind-doubly-indirect-param.rs:7:9
|
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
index ee92954a6..ecbe83f3d 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
@@ -6,6 +6,8 @@ LL | WRAP_INDIRECT_INLINE => { panic!("WRAP_INDIRECT_INLINE matched itse
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
note: the lint level is defined here
--> $DIR/cant-hide-behind-indirect-struct-embedded.rs:7:9
|
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
index f0c492d6a..211990801 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
@@ -6,6 +6,8 @@ LL | WRAP_INDIRECT_PARAM => { panic!("WRAP_INDIRECT_PARAM matched itself
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
note: the lint level is defined here
--> $DIR/cant-hide-behind-indirect-struct-param.rs:7:9
|
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr
index 0bf369fa8..46600e7b2 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `B` in a pattern, `B` must be annotated with `#
|
LL | A => (),
| ^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
index 955ab4b54..435812306 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
@@ -6,6 +6,8 @@ LL | RR_B1 => { println!("CLAIM RR0: {:?} matches {:?}", RR_B1, RR_B0);
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
note: the lint level is defined here
--> $DIR/issue-62307-match-ref-ref-forbidden-without-eq.rs:13:9
|
@@ -20,6 +22,8 @@ LL | RR_B1 => { println!("CLAIM RR1: {:?} matches {:?}", RR_B1, RR_B1);
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
warning: 2 warnings emitted
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
index 616ed9e48..1c4fb9146 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated wit
|
LL | FOO => { }
| ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
warning: floating-point types cannot be used in patterns
--> $DIR/match-forbidden-without-eq.rs:18:9
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr
index 371f8a0aa..6adebada0 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `B` in a pattern, `B` must be annotated with `#
|
LL | FOO => { }
| ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr b/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr
index 4157cf652..f5b10f062 100644
--- a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr
+++ b/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr
@@ -3,6 +3,9 @@ error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated wit
|
LL | FOO => { }
| ^^^
+ |
+ = note: the traits must be derived, manual `impl`s are not sufficient
+ = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
error: aborting due to previous error
diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.stderr b/tests/ui/rfc-1937-termination-trait/issue-103052-2.current.stderr
index a700c72ea..f72b3ab02 100644
--- a/tests/ui/rfc-1937-termination-trait/issue-103052-2.stderr
+++ b/tests/ui/rfc-1937-termination-trait/issue-103052-2.current.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `Something: Termination` is not satisfied
- --> $DIR/issue-103052-2.rs:12:22
+ --> $DIR/issue-103052-2.rs:15:22
|
LL | fn main() -> Something {
| ^^^^^^^^^ the trait `Termination` is not implemented for `Something`
|
note: required by a bound in `Main::main::{opaque#0}`
- --> $DIR/issue-103052-2.rs:6:27
+ --> $DIR/issue-103052-2.rs:9:27
|
LL | fn main() -> impl std::process::Termination;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Main::main::{opaque#0}`
diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr b/tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr
new file mode 100644
index 000000000..8b01941b4
--- /dev/null
+++ b/tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `Something: Termination` is not satisfied
+ --> $DIR/issue-103052-2.rs:15:22
+ |
+LL | fn main() -> Something {
+ | ^^^^^^^^^ the trait `Termination` is not implemented for `Something`
+ |
+note: required by a bound in `Main::{opaque#0}`
+ --> $DIR/issue-103052-2.rs:9:27
+ |
+LL | fn main() -> impl std::process::Termination;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Main::{opaque#0}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.rs b/tests/ui/rfc-1937-termination-trait/issue-103052-2.rs
index fa9182b6d..ca5fa6df2 100644
--- a/tests/ui/rfc-1937-termination-trait/issue-103052-2.rs
+++ b/tests/ui/rfc-1937-termination-trait/issue-103052-2.rs
@@ -1,3 +1,6 @@
+// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
+// revisions: current next
+
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
@@ -9,7 +12,8 @@ mod child {
struct Something;
impl Main for () {
- fn main() -> Something { //~ ERROR the trait bound `Something: Termination` is not satisfied
+ fn main() -> Something {
+ //~^ ERROR the trait bound `Something: Termination` is not satisfied
Something
}
}
diff --git a/tests/ui/rfc-2005-default-binding-mode/slice.stderr b/tests/ui/rfc-2005-default-binding-mode/slice.stderr
index 60c1f5420..5b51dc5ac 100644
--- a/tests/ui/rfc-2005-default-binding-mode/slice.stderr
+++ b/tests/ui/rfc-2005-default-binding-mode/slice.stderr
@@ -7,7 +7,7 @@ LL | match sl {
= note: the matched value is of type `&[u8]`
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 ~ [first, remainder @ ..] => {}
+LL ~ [first, remainder @ ..] => {},
LL ~ &[] => todo!(),
|
diff --git a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs b/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs
index d8f07bb8f..3482af747 100644
--- a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs
+++ b/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs
@@ -184,4 +184,28 @@ fn main() {
// OK: both unstable and stable fields are matched with feature on
#[warn(non_exhaustive_omitted_patterns)]
let UnstableStruct { stable, stable2, unstable, .. } = UnstableStruct::default();
+
+ // Ok: local bindings are allowed
+ #[deny(non_exhaustive_omitted_patterns)]
+ let local = NonExhaustiveEnum::Unit;
+
+ // Ok: missing patterns will be blocked by the pattern being refutable
+ #[deny(non_exhaustive_omitted_patterns)]
+ let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit;
+ //~^ refutable pattern in local binding
+
+ // Check that matching on a reference results in a correctly spanned diagnostic
+ #[deny(non_exhaustive_omitted_patterns)]
+ match &non_enum {
+ NonExhaustiveEnum::Unit => {}
+ NonExhaustiveEnum::Tuple(_) => {}
+ _ => {}
+ }
+ //~^^ some variants are not matched explicitly
+}
+
+#[deny(non_exhaustive_omitted_patterns)]
+// Ok: Pattern in a param is always wildcard
+pub fn takes_non_exhaustive(_: NonExhaustiveEnum) {
+ let _closure = |_: NonExhaustiveEnum| {};
}
diff --git a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr b/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr
index 996bd4a12..923394474 100644
--- a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr
+++ b/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr
@@ -184,5 +184,34 @@ note: the lint level is defined here
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 8 previous errors; 6 warnings emitted
+error[E0005]: refutable pattern in local binding
+ --> $DIR/omitted-patterns.rs:194:9
+ |
+LL | let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit;
+ | ^^^^^^^^^^^^^^^ pattern `_` not covered
+ |
+ = 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 `NonExhaustiveEnum`
+help: you might want to use `let else` to handle the variant that isn't matched
+ |
+LL | let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit else { todo!() };
+ | ++++++++++++++++
+
+error: some variants are not matched explicitly
+ --> $DIR/omitted-patterns.rs:202:9
+ |
+LL | _ => {}
+ | ^ pattern `NonExhaustiveEnum::Struct { .. }` not covered
+ |
+ = help: ensure that all variants are matched explicitly by adding the suggested match arms
+ = note: the matched value is of type `NonExhaustiveEnum` and the `non_exhaustive_omitted_patterns` attribute was found
+note: the lint level is defined here
+ --> $DIR/omitted-patterns.rs:198:12
+ |
+LL | #[deny(non_exhaustive_omitted_patterns)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 10 previous errors; 6 warnings emitted
+For more information about this error, try `rustc --explain E0005`.
diff --git a/tests/ui/rfc-2008-non-exhaustive/struct.stderr b/tests/ui/rfc-2008-non-exhaustive/struct.stderr
index 2cb9ba0d1..39b1ef1e0 100644
--- a/tests/ui/rfc-2008-non-exhaustive/struct.stderr
+++ b/tests/ui/rfc-2008-non-exhaustive/struct.stderr
@@ -10,14 +10,11 @@ error[E0603]: tuple struct constructor `TupleStruct` is private
LL | let ts_explicit = structs::TupleStruct(640, 480);
| ^^^^^^^^^^^ private tuple struct constructor
|
- ::: $DIR/auxiliary/structs.rs:12:24
- |
-LL | pub struct TupleStruct(pub u16, pub u16);
- | ---------------- a constructor is private if any of the fields is private
- |
note: the tuple struct constructor `TupleStruct` is defined here
--> $DIR/auxiliary/structs.rs:12:1
|
+LL | #[non_exhaustive]
+ | ----------------- cannot be constructed because it is `#[non_exhaustive]`
LL | pub struct TupleStruct(pub u16, pub u16);
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -30,6 +27,8 @@ LL | let us_explicit = structs::UnitStruct;
note: the unit struct `UnitStruct` is defined here
--> $DIR/auxiliary/structs.rs:9:1
|
+LL | #[non_exhaustive]
+ | ----------------- cannot be constructed because it is `#[non_exhaustive]`
LL | pub struct UnitStruct;
| ^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/rfc-2008-non-exhaustive/variant.stderr b/tests/ui/rfc-2008-non-exhaustive/variant.stderr
index 720b7b119..4083f57a9 100644
--- a/tests/ui/rfc-2008-non-exhaustive/variant.stderr
+++ b/tests/ui/rfc-2008-non-exhaustive/variant.stderr
@@ -8,7 +8,9 @@ note: the tuple variant `Tuple` is defined here
--> $DIR/auxiliary/variants.rs:5:23
|
LL | #[non_exhaustive] Tuple(u32),
- | ^^^^^
+ | ----------------- ^^^^^
+ | |
+ | cannot be constructed because it is `#[non_exhaustive]`
error[E0603]: unit variant `Unit` is private
--> $DIR/variant.rs:14:47
@@ -20,7 +22,9 @@ note: the unit variant `Unit` is defined here
--> $DIR/auxiliary/variants.rs:4:23
|
LL | #[non_exhaustive] Unit,
- | ^^^^
+ | ----------------- ^^^^
+ | |
+ | cannot be constructed because it is `#[non_exhaustive]`
error[E0603]: unit variant `Unit` is private
--> $DIR/variant.rs:18:32
@@ -32,7 +36,9 @@ note: the unit variant `Unit` is defined here
--> $DIR/auxiliary/variants.rs:4:23
|
LL | #[non_exhaustive] Unit,
- | ^^^^
+ | ----------------- ^^^^
+ | |
+ | cannot be constructed because it is `#[non_exhaustive]`
error[E0603]: tuple variant `Tuple` is private
--> $DIR/variant.rs:20:32
@@ -44,7 +50,9 @@ note: the tuple variant `Tuple` is defined here
--> $DIR/auxiliary/variants.rs:5:23
|
LL | #[non_exhaustive] Tuple(u32),
- | ^^^^^
+ | ----------------- ^^^^^
+ | |
+ | cannot be constructed because it is `#[non_exhaustive]`
error[E0603]: tuple variant `Tuple` is private
--> $DIR/variant.rs:26:35
@@ -56,7 +64,9 @@ note: the tuple variant `Tuple` is defined here
--> $DIR/auxiliary/variants.rs:5:23
|
LL | #[non_exhaustive] Tuple(u32),
- | ^^^^^
+ | ----------------- ^^^^^
+ | |
+ | cannot be constructed because it is `#[non_exhaustive]`
error[E0639]: cannot create non-exhaustive variant using struct expression
--> $DIR/variant.rs:8:26
diff --git a/tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs b/tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs
index 87e52881c..23d2a4b0a 100644
--- a/tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs
+++ b/tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs
@@ -1,5 +1,6 @@
// run-pass
// revisions: default mir-opt
+//[default] compile-flags: -Zinline-mir=no
//[mir-opt] compile-flags: -Zmir-opt-level=4
macro_rules! caller_location_from_macro {
@@ -9,13 +10,13 @@ macro_rules! caller_location_from_macro {
fn main() {
let loc = core::panic::Location::caller();
assert_eq!(loc.file(), file!());
- assert_eq!(loc.line(), 10);
+ assert_eq!(loc.line(), 11);
assert_eq!(loc.column(), 15);
// `Location::caller()` in a macro should behave similarly to `file!` and `line!`,
// i.e. point to where the macro was invoked, instead of the macro itself.
let loc2 = caller_location_from_macro!();
assert_eq!(loc2.file(), file!());
- assert_eq!(loc2.line(), 17);
+ assert_eq!(loc2.line(), 18);
assert_eq!(loc2.column(), 16);
}
diff --git a/tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs b/tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs
new file mode 100644
index 000000000..a2e8eb27e
--- /dev/null
+++ b/tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs
@@ -0,0 +1,23 @@
+// run-pass
+// revisions: default mir-opt
+//[default] compile-flags: -Zinline-mir=no
+//[mir-opt] compile-flags: -Zmir-opt-level=4
+
+use std::panic::Location;
+
+macro_rules! f {
+ () => {
+ Location::caller()
+ };
+}
+
+#[inline(always)]
+fn g() -> &'static Location<'static> {
+ f!()
+}
+
+fn main() {
+ let loc = g();
+ assert_eq!(loc.line(), 16);
+ assert_eq!(loc.column(), 5);
+}
diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr b/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr
index d8b5a9e63..ce165e646 100644
--- a/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr
+++ b/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr
@@ -9,7 +9,8 @@ LL | let _: NotDebug = dbg!(NotDebug);
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `dbg` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `NotDebug` with `#[derive(Debug)]`
|
-LL | #[derive(Debug)]
+LL + #[derive(Debug)]
+LL | struct NotDebug;
|
error: aborting due to previous error
diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr b/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
index 706f52343..a28d6ce05 100644
--- a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
@@ -1,21 +1,14 @@
error[E0277]: the trait bound `S: ~const Foo` is not satisfied
- --> $DIR/call-generic-method-nonconst.rs:23:34
+ --> $DIR/call-generic-method-nonconst.rs:23:22
|
LL | pub const EQ: bool = equals_self(&S);
- | ----------- ^^ the trait `~const Foo` is not implemented for `S`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^^^^^ the trait `~const Foo` is not implemented for `S`
|
note: the trait `Foo` is implemented for `S`, but that implementation is not `const`
- --> $DIR/call-generic-method-nonconst.rs:23:34
+ --> $DIR/call-generic-method-nonconst.rs:23:22
|
LL | pub const EQ: bool = equals_self(&S);
- | ^^
-note: required by a bound in `equals_self`
- --> $DIR/call-generic-method-nonconst.rs:16:25
- |
-LL | const fn equals_self<T: ~const Foo>(t: &T) -> bool {
- | ^^^^^^^^^^ required by this bound in `equals_self`
+ | ^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr b/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
index 4470e287c..ffc24ec6e 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
@@ -1,22 +1,15 @@
error[E0277]: the trait bound `(): ~const Tr` is not satisfied in `fn(()) -> i32 {<() as Tr>::a}`
- --> $DIR/const-closure-trait-method-fail.rs:16:42
+ --> $DIR/const-closure-trait-method-fail.rs:16:23
|
LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
- | ------------------ ^^^^^ within `fn(()) -> i32 {<() as Tr>::a}`, the trait `~const Tr` is not implemented for `()`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ within `fn(()) -> i32 {<() as Tr>::a}`, the trait `~const Tr` is not implemented for `()`
|
note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
- --> $DIR/const-closure-trait-method-fail.rs:16:42
+ --> $DIR/const-closure-trait-method-fail.rs:16:23
|
LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
- | ^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: required because it appears within the type `fn(()) -> i32 {<() as Tr>::a}`
-note: required by a bound in `need_const_closure`
- --> $DIR/const-closure-trait-method-fail.rs:12:32
- |
-LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `need_const_closure`
error: aborting due to previous error
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr
new file mode 100644
index 000000000..bcdc80f82
--- /dev/null
+++ b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr
@@ -0,0 +1,50 @@
+error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
+ --> $DIR/const-drop-fail-2.rs:31:23
+ |
+LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
+ |
+note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+ --> $DIR/const-drop-fail-2.rs:31:23
+ |
+LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `ConstDropImplWithBounds`
+ --> $DIR/const-drop-fail-2.rs:21:35
+ |
+LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
+ | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
+
+error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
+ --> $DIR/const-drop-fail-2.rs:33:5
+ |
+LL | ConstDropImplWithBounds(PhantomData)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
+ |
+note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+ --> $DIR/const-drop-fail-2.rs:33:5
+ |
+LL | ConstDropImplWithBounds(PhantomData)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `ConstDropImplWithBounds`
+ --> $DIR/const-drop-fail-2.rs:21:35
+ |
+LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
+ | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
+
+error[E0367]: `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
+ --> $DIR/const-drop-fail-2.rs:39:9
+ |
+LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
+ | ^^^^^^^^
+ |
+note: the implementor must specify the same requirement
+ --> $DIR/const-drop-fail-2.rs:37:1
+ |
+LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0277, E0367.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs
new file mode 100644
index 000000000..6a252c5d3
--- /dev/null
+++ b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs
@@ -0,0 +1,46 @@
+// revisions: stock precise
+#![feature(const_trait_impl)]
+#![feature(const_mut_refs)]
+#![cfg_attr(precise, feature(const_precise_live_drops))]
+
+use std::marker::{Destruct, PhantomData};
+
+struct NonTrivialDrop;
+
+impl Drop for NonTrivialDrop {
+ fn drop(&mut self) {
+ println!("Non trivial drop");
+ }
+}
+
+#[const_trait]
+trait A { fn a() { } }
+
+impl A for NonTrivialDrop {}
+
+struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
+
+impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
+ fn drop(&mut self) {
+ T::a();
+ }
+}
+
+const fn check<T: ~const Destruct>(_: T) {}
+
+const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
+ //~^ ERROR the trait bound
+ ConstDropImplWithBounds(PhantomData)
+ //~^ ERROR the trait bound
+);
+
+struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
+
+impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
+//~^ ERROR `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
+ fn drop(&mut self) {
+ T::a();
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr
new file mode 100644
index 000000000..bcdc80f82
--- /dev/null
+++ b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr
@@ -0,0 +1,50 @@
+error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
+ --> $DIR/const-drop-fail-2.rs:31:23
+ |
+LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
+ |
+note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+ --> $DIR/const-drop-fail-2.rs:31:23
+ |
+LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `ConstDropImplWithBounds`
+ --> $DIR/const-drop-fail-2.rs:21:35
+ |
+LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
+ | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
+
+error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
+ --> $DIR/const-drop-fail-2.rs:33:5
+ |
+LL | ConstDropImplWithBounds(PhantomData)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
+ |
+note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+ --> $DIR/const-drop-fail-2.rs:33:5
+ |
+LL | ConstDropImplWithBounds(PhantomData)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `ConstDropImplWithBounds`
+ --> $DIR/const-drop-fail-2.rs:21:35
+ |
+LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
+ | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
+
+error[E0367]: `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
+ --> $DIR/const-drop-fail-2.rs:39:9
+ |
+LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
+ | ^^^^^^^^
+ |
+note: the implementor must specify the same requirement
+ --> $DIR/const-drop-fail-2.rs:37:1
+ |
+LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0277, E0367.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
index 796c0d388..40caada51 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
@@ -1,99 +1,58 @@
error[E0277]: can't drop `NonTrivialDrop` in const contexts
- --> $DIR/const-drop-fail.rs:44:5
+ --> $DIR/const-drop-fail.rs:26:23
|
-LL | const _: () = check($exp);
- | ----- required by a bound introduced by this call
+LL | const _: () = check($exp);
+ | ^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
...
-LL | NonTrivialDrop,
- | ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
+LL | / check_all! {
+LL | | NonTrivialDrop,
+LL | | ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+ | |_- in this macro invocation
|
- = note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied
-note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:35:19
- |
-LL | const fn check<T: ~const Destruct>(_: T) {}
- | ^^^^^^^^^^^^^^^ required by this bound in `check`
-help: consider borrowing here
+note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+ --> $DIR/const-drop-fail.rs:26:23
|
-LL | &NonTrivialDrop,
- | +
-LL | &mut NonTrivialDrop,
- | ++++
+LL | const _: () = check($exp);
+ | ^^^^^^^^^^^
+...
+LL | / check_all! {
+LL | | NonTrivialDrop,
+LL | | ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+ | |_- in this macro invocation
+ = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: can't drop `NonTrivialDrop` in const contexts
- --> $DIR/const-drop-fail.rs:46:5
+ --> $DIR/const-drop-fail.rs:26:23
|
-LL | const _: () = check($exp);
- | ----- required by a bound introduced by this call
+LL | const _: () = check($exp);
+ | ^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
...
-LL | ConstImplWithDropGlue(NonTrivialDrop),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
+LL | / check_all! {
+LL | | NonTrivialDrop,
+LL | | ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+ | |_- in this macro invocation
|
note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
- --> $DIR/const-drop-fail.rs:46:5
+ --> $DIR/const-drop-fail.rs:26:23
|
-LL | ConstImplWithDropGlue(NonTrivialDrop),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | const _: () = check($exp);
+ | ^^^^^^^^^^^
+...
+LL | / check_all! {
+LL | | NonTrivialDrop,
+LL | | ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+ | |_- in this macro invocation
note: required because it appears within the type `ConstImplWithDropGlue`
--> $DIR/const-drop-fail.rs:16:8
|
LL | struct ConstImplWithDropGlue(NonTrivialDrop);
| ^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:35:19
- |
-LL | const fn check<T: ~const Destruct>(_: T) {}
- | ^^^^^^^^^^^^^^^ required by this bound in `check`
-
-error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
- --> $DIR/const-drop-fail.rs:48:47
- |
-LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
- | |
- | required by a bound introduced by this call
- |
-note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
- --> $DIR/const-drop-fail.rs:48:47
- |
-LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ^^^^^^^^^^^
-note: required by a bound in `ConstDropImplWithBounds`
- --> $DIR/const-drop-fail.rs:27:35
- |
-LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
- | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
-
-error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
- --> $DIR/const-drop-fail.rs:48:5
- |
-LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
- |
-note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
- --> $DIR/const-drop-fail.rs:48:5
- |
-LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `ConstDropImplWithBounds`
- --> $DIR/const-drop-fail.rs:27:35
- |
-LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
- | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
-
-error[E0367]: `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
- --> $DIR/const-drop-fail.rs:55:9
- |
-LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
- | ^^^^^^^^
- |
-note: the implementor must specify the same requirement
- --> $DIR/const-drop-fail.rs:53:1
- |
-LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0277, E0367.
-For more information about an error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
index d36c7f81c..c4bdb9ef5 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
+++ b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
@@ -19,44 +19,19 @@ impl const Drop for ConstImplWithDropGlue {
fn drop(&mut self) {}
}
-#[const_trait]
-trait A { fn a() { } }
-
-impl A for NonTrivialDrop {}
-
-struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
-
-impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
- fn drop(&mut self) {
- T::a();
- }
-}
-
const fn check<T: ~const Destruct>(_: T) {}
macro_rules! check_all {
($($exp:expr),*$(,)?) => {$(
const _: () = check($exp);
+ //~^ ERROR can't drop
+ //~| ERROR can't drop
)*};
}
check_all! {
NonTrivialDrop,
- //~^ ERROR can't drop
ConstImplWithDropGlue(NonTrivialDrop),
- //~^ ERROR can't drop
- ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- //~^ ERROR the trait bound
- //~| ERROR the trait bound
-}
-
-struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
-
-impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
-//~^ ERROR `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
- fn drop(&mut self) {
- T::a();
- }
}
fn main() {}
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
index 796c0d388..40caada51 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
@@ -1,99 +1,58 @@
error[E0277]: can't drop `NonTrivialDrop` in const contexts
- --> $DIR/const-drop-fail.rs:44:5
+ --> $DIR/const-drop-fail.rs:26:23
|
-LL | const _: () = check($exp);
- | ----- required by a bound introduced by this call
+LL | const _: () = check($exp);
+ | ^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
...
-LL | NonTrivialDrop,
- | ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
+LL | / check_all! {
+LL | | NonTrivialDrop,
+LL | | ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+ | |_- in this macro invocation
|
- = note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied
-note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:35:19
- |
-LL | const fn check<T: ~const Destruct>(_: T) {}
- | ^^^^^^^^^^^^^^^ required by this bound in `check`
-help: consider borrowing here
+note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+ --> $DIR/const-drop-fail.rs:26:23
|
-LL | &NonTrivialDrop,
- | +
-LL | &mut NonTrivialDrop,
- | ++++
+LL | const _: () = check($exp);
+ | ^^^^^^^^^^^
+...
+LL | / check_all! {
+LL | | NonTrivialDrop,
+LL | | ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+ | |_- in this macro invocation
+ = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: can't drop `NonTrivialDrop` in const contexts
- --> $DIR/const-drop-fail.rs:46:5
+ --> $DIR/const-drop-fail.rs:26:23
|
-LL | const _: () = check($exp);
- | ----- required by a bound introduced by this call
+LL | const _: () = check($exp);
+ | ^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
...
-LL | ConstImplWithDropGlue(NonTrivialDrop),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
+LL | / check_all! {
+LL | | NonTrivialDrop,
+LL | | ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+ | |_- in this macro invocation
|
note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
- --> $DIR/const-drop-fail.rs:46:5
+ --> $DIR/const-drop-fail.rs:26:23
|
-LL | ConstImplWithDropGlue(NonTrivialDrop),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | const _: () = check($exp);
+ | ^^^^^^^^^^^
+...
+LL | / check_all! {
+LL | | NonTrivialDrop,
+LL | | ConstImplWithDropGlue(NonTrivialDrop),
+LL | | }
+ | |_- in this macro invocation
note: required because it appears within the type `ConstImplWithDropGlue`
--> $DIR/const-drop-fail.rs:16:8
|
LL | struct ConstImplWithDropGlue(NonTrivialDrop);
| ^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:35:19
- |
-LL | const fn check<T: ~const Destruct>(_: T) {}
- | ^^^^^^^^^^^^^^^ required by this bound in `check`
-
-error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
- --> $DIR/const-drop-fail.rs:48:47
- |
-LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
- | |
- | required by a bound introduced by this call
- |
-note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
- --> $DIR/const-drop-fail.rs:48:47
- |
-LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ^^^^^^^^^^^
-note: required by a bound in `ConstDropImplWithBounds`
- --> $DIR/const-drop-fail.rs:27:35
- |
-LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
- | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
-
-error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
- --> $DIR/const-drop-fail.rs:48:5
- |
-LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
- |
-note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
- --> $DIR/const-drop-fail.rs:48:5
- |
-LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `ConstDropImplWithBounds`
- --> $DIR/const-drop-fail.rs:27:35
- |
-LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
- | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
-
-error[E0367]: `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
- --> $DIR/const-drop-fail.rs:55:9
- |
-LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
- | ^^^^^^^^
- |
-note: the implementor must specify the same requirement
- --> $DIR/const-drop-fail.rs:53:1
- |
-LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0277, E0367.
-For more information about an error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs b/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs
index 92843a8a2..ed6699f37 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs
+++ b/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs
@@ -9,5 +9,6 @@ impl Default for A {
#[derive_const(Default)]
pub struct S(A);
//~^ cannot call non-const fn
+//~| the trait bound
fn main() {}
diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr b/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
index 96e0c78b9..653037ef3 100644
--- a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr
@@ -1,3 +1,25 @@
+error[E0277]: the trait bound `A: Default` is not satisfied
+ --> $DIR/derive-const-non-const-type.rs:10:14
+ |
+LL | #[derive_const(Default)]
+ | ------- in this derive macro expansion
+LL | pub struct S(A);
+ | ^ the trait `~const Default` is not implemented for `A`
+ |
+note: the trait `Default` is implemented for `A`, but that implementation is not `const`
+ --> $DIR/derive-const-non-const-type.rs:10:14
+ |
+LL | #[derive_const(Default)]
+ | ------- in this derive macro expansion
+LL | pub struct S(A);
+ | ^
+ = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider annotating `A` with `#[derive(Default)]`
+ |
+LL + #[derive(Default)]
+LL | pub struct A;
+ |
+
error[E0015]: cannot call non-const fn `<A as Default>::default` in constant functions
--> $DIR/derive-const-non-const-type.rs:10:14
|
@@ -10,6 +32,7 @@ LL | pub struct S(A);
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to previous error
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr b/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
index a244ab10c..26644f72c 100644
--- a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
@@ -1,19 +1,14 @@
error[E0277]: the trait bound `(): ~const Tr` is not satisfied
- --> $DIR/default-method-body-is-const-body-checking.rs:12:15
+ --> $DIR/default-method-body-is-const-body-checking.rs:12:9
|
LL | foo::<()>();
- | ^^ the trait `~const Tr` is not implemented for `()`
+ | ^^^^^^^^^^^ the trait `~const Tr` is not implemented for `()`
|
note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
- --> $DIR/default-method-body-is-const-body-checking.rs:12:15
+ --> $DIR/default-method-body-is-const-body-checking.rs:12:9
|
LL | foo::<()>();
- | ^^
-note: required by a bound in `foo`
- --> $DIR/default-method-body-is-const-body-checking.rs:7:28
- |
-LL | const fn foo<T>() where T: ~const Tr {}
- | ^^^^^^^^^ required by this bound in `foo`
+ | ^^^^^^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs b/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs
index 1726cf82e..60790e297 100644
--- a/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs
+++ b/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs
@@ -1,8 +1,15 @@
// check-pass
+#![feature(const_trait_impl)]
-type I32Cmp = fn(&i32, &i32) -> core::cmp::Ordering;
-pub const fn min_by_i32() -> fn(i32, i32, I32Cmp) -> i32 {
- core::cmp::min_by
+#[const_trait]
+pub trait Test {}
+
+impl Test for () {}
+
+pub const fn test<T: ~const Test>() {}
+
+pub const fn min_by_i32() -> fn() {
+ test::<()>
}
fn main() {}
diff --git a/tests/ui/rfc-2632-const-trait-impl/gate.rs b/tests/ui/rfc-2632-const-trait-impl/gate.rs
index f2cd26c91..d1c93ab9f 100644
--- a/tests/ui/rfc-2632-const-trait-impl/gate.rs
+++ b/tests/ui/rfc-2632-const-trait-impl/gate.rs
@@ -1,5 +1,13 @@
// gate-test-const_closures
+
fn main() {
(const || {})();
//~^ ERROR: const closures are experimental
}
+
+macro_rules! e {
+ ($e:expr) => {}
+}
+
+e!((const || {}));
+//~^ ERROR const closures are experimental
diff --git a/tests/ui/rfc-2632-const-trait-impl/gate.stderr b/tests/ui/rfc-2632-const-trait-impl/gate.stderr
index 30edc4127..11cc2cd56 100644
--- a/tests/ui/rfc-2632-const-trait-impl/gate.stderr
+++ b/tests/ui/rfc-2632-const-trait-impl/gate.stderr
@@ -1,12 +1,21 @@
error[E0658]: const closures are experimental
- --> $DIR/gate.rs:3:6
+ --> $DIR/gate.rs:4:6
|
LL | (const || {})();
- | ^^^^^^^^^^^
+ | ^^^^^
|
= note: see issue #106003 <https://github.com/rust-lang/rust/issues/106003> for more information
= help: add `#![feature(const_closures)]` to the crate attributes to enable
-error: aborting due to previous error
+error[E0658]: const closures are experimental
+ --> $DIR/gate.rs:12:5
+ |
+LL | e!((const || {}));
+ | ^^^^^
+ |
+ = note: see issue #106003 <https://github.com/rust-lang/rust/issues/106003> for more information
+ = help: add `#![feature(const_closures)]` 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/rfc-2632-const-trait-impl/nested-closure.rs b/tests/ui/rfc-2632-const-trait-impl/nested-closure.rs
index a85113600..0b423b340 100644
--- a/tests/ui/rfc-2632-const-trait-impl/nested-closure.rs
+++ b/tests/ui/rfc-2632-const-trait-impl/nested-closure.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(const_trait_impl, once_cell)]
+#![feature(const_trait_impl, lazy_cell)]
use std::sync::LazyLock;
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.rs
new file mode 100644
index 000000000..0d59e5026
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.rs
@@ -0,0 +1,7 @@
+// only-x86_64
+
+#![feature(target_feature_11)]
+
+#[target_feature(enable = "avx2")]
+fn main() {}
+//~^ ERROR `main` function is not allowed to have `#[target_feature]`
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.stderr
new file mode 100644
index 000000000..cfafbd522
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.stderr
@@ -0,0 +1,8 @@
+error: `main` function is not allowed to have `#[target_feature]`
+ --> $DIR/issue-108645-target-feature-on-main.rs:6:1
+ |
+LL | fn main() {}
+ | ^^^^^^^^^ `main` function is not allowed to have `#[target_feature]`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs
new file mode 100644
index 000000000..50e8ce2fd
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs
@@ -0,0 +1,9 @@
+// only-x86_64
+
+#![feature(start)]
+#![feature(target_feature_11)]
+
+#[start]
+#[target_feature(enable = "avx2")]
+//~^ ERROR `start` is not allowed to have `#[target_feature]`
+fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 }
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.stderr
new file mode 100644
index 000000000..07687f3c7
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.stderr
@@ -0,0 +1,11 @@
+error: `start` is not allowed to have `#[target_feature]`
+ --> $DIR/issue-108645-target-feature-on-start.rs:7:1
+ |
+LL | #[target_feature(enable = "avx2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 }
+ | -------------------------------------------------------- `start` is not allowed to have `#[target_feature]`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs
index 7314fa8cc..9108f27b5 100644
--- a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.rs
@@ -18,4 +18,10 @@ impl Foo for Bar {
unsafe fn unsf_foo(&self) {}
}
+trait Qux {
+ #[target_feature(enable = "sse2")]
+ //~^ ERROR cannot be applied to safe trait method
+ fn foo(&self) {}
+}
+
fn main() {}
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr
index 07d6e0900..eb0f18edd 100644
--- a/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr
@@ -1,4 +1,13 @@
error: `#[target_feature(..)]` cannot be applied to safe trait method
+ --> $DIR/trait-impl.rs:22:5
+ |
+LL | #[target_feature(enable = "sse2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be applied to safe trait method
+LL |
+LL | fn foo(&self) {}
+ | ------------- not an `unsafe` function
+
+error: `#[target_feature(..)]` cannot be applied to safe trait method
--> $DIR/trait-impl.rs:13:5
|
LL | #[target_feature(enable = "sse2")]
@@ -7,5 +16,5 @@ LL |
LL | fn foo(&self) {}
| ------------- not an `unsafe` function
-error: aborting due to previous error
+error: aborting due to 2 previous errors
diff --git a/tests/ui/runtime/backtrace-debuginfo.rs b/tests/ui/runtime/backtrace-debuginfo.rs
index 8b5466b6c..5d233b38d 100644
--- a/tests/ui/runtime/backtrace-debuginfo.rs
+++ b/tests/ui/runtime/backtrace-debuginfo.rs
@@ -9,7 +9,6 @@
// compile-flags:-g -Copt-level=0 -Cllvm-args=-enable-tail-merge=0
// compile-flags:-Cforce-frame-pointers=yes
// compile-flags:-Cstrip=none
-// ignore-pretty issue #37195
// ignore-emscripten spawning processes is not supported
// ignore-sgx no processes
// ignore-fuchsia Backtrace not symbolized, trace different line alignment
diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed
index 85d106bc1..ede0c2e8e 100644
--- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed
+++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed
@@ -18,9 +18,11 @@ mod foo {
fn main() {
let _: <foo::Baz as crate::foo::Foo>::Bar = ();
//~^ ERROR absolute paths must start with
- //~| this is accepted in the current edition
+ //~| WARN this is accepted in the current edition
+ //~| ERROR absolute paths must start with
+ //~| WARN this is accepted in the current edition
let _: <crate::foo::Baz as foo::Foo>::Bar = ();
//~^ ERROR absolute paths must start with
- //~| this is accepted in the current edition
+ //~| WARN this is accepted in the current edition
}
diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs
index 9ff3c2e5f..48b091ddb 100644
--- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs
+++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs
@@ -18,9 +18,11 @@ mod foo {
fn main() {
let _: <foo::Baz as ::foo::Foo>::Bar = ();
//~^ ERROR absolute paths must start with
- //~| this is accepted in the current edition
+ //~| WARN this is accepted in the current edition
+ //~| ERROR absolute paths must start with
+ //~| WARN this is accepted in the current edition
let _: <::foo::Baz as foo::Foo>::Bar = ();
//~^ ERROR absolute paths must start with
- //~| this is accepted in the current edition
+ //~| WARN this is accepted in the current edition
}
diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
index e1709db09..497ee440d 100644
--- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
+++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
@@ -13,7 +13,16 @@ LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
- --> $DIR/edition-lint-fully-qualified-paths.rs:23:13
+ --> $DIR/edition-lint-fully-qualified-paths.rs:19:25
+ |
+LL | let _: <foo::Baz as ::foo::Foo>::Bar = ();
+ | ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo`
+ |
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
+
+error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
+ --> $DIR/edition-lint-fully-qualified-paths.rs:25:13
|
LL | let _: <::foo::Baz as foo::Foo>::Bar = ();
| ^^^^^^^^^^ help: use `crate`: `crate::foo::Baz`
@@ -21,5 +30,5 @@ LL | let _: <::foo::Baz as foo::Foo>::Bar = ();
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
diff --git a/tests/ui/rust-2018/issue-52202-use-suggestions.stderr b/tests/ui/rust-2018/issue-52202-use-suggestions.stderr
index 38cd9713d..9933b9243 100644
--- a/tests/ui/rust-2018/issue-52202-use-suggestions.stderr
+++ b/tests/ui/rust-2018/issue-52202-use-suggestions.stderr
@@ -6,13 +6,13 @@ LL | let _d = Drain {};
|
help: consider importing one of these items
|
-LL | use crate::plumbing::Drain;
+LL + use crate::plumbing::Drain;
|
-LL | use std::collections::binary_heap::Drain;
+LL + use std::collections::binary_heap::Drain;
|
-LL | use std::collections::hash_map::Drain;
+LL + use std::collections::hash_map::Drain;
|
-LL | use std::collections::hash_set::Drain;
+LL + use std::collections::hash_set::Drain;
|
and 3 other candidates
diff --git a/tests/ui/rust-2018/trait-import-suggestions.stderr b/tests/ui/rust-2018/trait-import-suggestions.stderr
index 6454b6045..325c5976e 100644
--- a/tests/ui/rust-2018/trait-import-suggestions.stderr
+++ b/tests/ui/rust-2018/trait-import-suggestions.stderr
@@ -10,7 +10,7 @@ LL | x.foobar();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use crate::foo::foobar::Foobar;
+LL + use crate::foo::foobar::Foobar;
|
error[E0599]: no method named `bar` found for type `u32` in the current scope
@@ -25,7 +25,7 @@ LL | x.bar();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use crate::foo::Bar;
+LL + use crate::foo::Bar;
|
error[E0599]: no method named `baz` found for type `u32` in the current scope
@@ -43,7 +43,7 @@ LL | let y = u32::from_str("33");
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use std::str::FromStr;
+LL + use std::str::FromStr;
|
help: there is an associated function with a similar name
|
diff --git a/tests/ui/rust-2018/uniform-paths/issue-87932.stderr b/tests/ui/rust-2018/uniform-paths/issue-87932.stderr
index b52720ae3..ac2baa359 100644
--- a/tests/ui/rust-2018/uniform-paths/issue-87932.stderr
+++ b/tests/ui/rust-2018/uniform-paths/issue-87932.stderr
@@ -10,7 +10,7 @@ LL | A::deserialize();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use <crate::A as issue_87932_a::Deserialize>::deserialize::_a::Deserialize;
+LL + use <crate::A as issue_87932_a::Deserialize>::deserialize::_a::Deserialize;
|
error: aborting due to previous error
diff --git a/tests/ui/rust-2021/future-prelude-collision-shadow.stderr b/tests/ui/rust-2021/future-prelude-collision-shadow.stderr
index 3d21b735a..9dfaf13e2 100644
--- a/tests/ui/rust-2021/future-prelude-collision-shadow.stderr
+++ b/tests/ui/rust-2021/future-prelude-collision-shadow.stderr
@@ -8,9 +8,9 @@ LL | let _: u32 = 3u8.try_into().unwrap();
= note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
|
-LL | use crate::m::TryIntoU32;
+LL + use crate::m::TryIntoU32;
|
-LL | use std::convert::TryInto;
+LL + use std::convert::TryInto;
|
error: aborting due to previous error
diff --git a/tests/ui/rustdoc/doc-primitive.rs b/tests/ui/rustdoc/doc-primitive.rs
new file mode 100644
index 000000000..4336961e3
--- /dev/null
+++ b/tests/ui/rustdoc/doc-primitive.rs
@@ -0,0 +1,8 @@
+#![deny(invalid_doc_attributes)]
+
+#[doc(primitive = "foo")]
+//~^ ERROR unknown `doc` attribute `primitive`
+//~| WARN
+mod bar {}
+
+fn main() {}
diff --git a/tests/ui/rustdoc/doc-primitive.stderr b/tests/ui/rustdoc/doc-primitive.stderr
new file mode 100644
index 000000000..d61eb3816
--- /dev/null
+++ b/tests/ui/rustdoc/doc-primitive.stderr
@@ -0,0 +1,16 @@
+error: unknown `doc` attribute `primitive`
+ --> $DIR/doc-primitive.rs:3:7
+ |
+LL | #[doc(primitive = "foo")]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = 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-primitive.rs:1:9
+ |
+LL | #![deny(invalid_doc_attributes)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/rustdoc/feature-gate-doc_primitive.rs b/tests/ui/rustdoc/feature-gate-doc_primitive.rs
index 18e99e72f..78fcd9075 100644
--- a/tests/ui/rustdoc/feature-gate-doc_primitive.rs
+++ b/tests/ui/rustdoc/feature-gate-doc_primitive.rs
@@ -1,7 +1,5 @@
-// check-pass
-#[doc(primitive = "usize")]
-//~^ WARNING `doc(primitive)` should never have been stable
-//~| WARNING hard error in a future release
+#[rustc_doc_primitive = "usize"]
+//~^ ERROR `rustc_doc_primitive` is a rustc internal attribute
/// Some docs
mod usize {}
diff --git a/tests/ui/rustdoc/feature-gate-doc_primitive.stderr b/tests/ui/rustdoc/feature-gate-doc_primitive.stderr
index 194b2d87d..592088067 100644
--- a/tests/ui/rustdoc/feature-gate-doc_primitive.stderr
+++ b/tests/ui/rustdoc/feature-gate-doc_primitive.stderr
@@ -1,12 +1,11 @@
-warning: `doc(primitive)` should never have been stable
- --> $DIR/feature-gate-doc_primitive.rs:2:7
+error[E0658]: `rustc_doc_primitive` is a rustc internal attribute
+ --> $DIR/feature-gate-doc_primitive.rs:1:1
|
-LL | #[doc(primitive = "usize")]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #[rustc_doc_primitive = "usize"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = 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: `#[warn(invalid_doc_attributes)]` on by default
+ = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
-warning: 1 warning emitted
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/self/arbitrary_self_types_trait.rs b/tests/ui/self/arbitrary_self_types_trait.rs
index 973c7cae8..c4651ec71 100644
--- a/tests/ui/self/arbitrary_self_types_trait.rs
+++ b/tests/ui/self/arbitrary_self_types_trait.rs
@@ -1,4 +1,5 @@
// run-pass
+#![allow(unused_allocation)]
use std::rc::Rc;
@@ -13,7 +14,7 @@ impl Trait for Vec<i32> {
}
fn main() {
- let v = vec![1,2,3];
+ let v = vec![1, 2, 3];
- assert_eq!(&[1,2,3], Box::new(Rc::new(v)).trait_method());
+ assert_eq!(&[1, 2, 3], Box::new(Rc::new(v)).trait_method());
}
diff --git a/tests/ui/self/class-missing-self.stderr b/tests/ui/self/class-missing-self.stderr
index 063c3f013..3c37d8197 100644
--- a/tests/ui/self/class-missing-self.stderr
+++ b/tests/ui/self/class-missing-self.stderr
@@ -16,7 +16,7 @@ LL | self.sleep();
| +++++
help: consider importing this function
|
-LL | use std::thread::sleep;
+LL + use std::thread::sleep;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/shadowed/shadowed-trait-methods.stderr b/tests/ui/shadowed/shadowed-trait-methods.stderr
index c3b9084af..1af0400c8 100644
--- a/tests/ui/shadowed/shadowed-trait-methods.stderr
+++ b/tests/ui/shadowed/shadowed-trait-methods.stderr
@@ -10,7 +10,7 @@ LL | ().f()
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use foo::T;
+LL + use foo::T;
|
error: aborting due to previous error
diff --git a/tests/ui/simd/monomorphize-heterogeneous.rs b/tests/ui/simd/monomorphize-heterogeneous.rs
new file mode 100644
index 000000000..42e380dbb
--- /dev/null
+++ b/tests/ui/simd/monomorphize-heterogeneous.rs
@@ -0,0 +1,9 @@
+#![feature(repr_simd)]
+
+#[repr(simd)]
+struct I64F64(i64, f64);
+//~^ ERROR SIMD vector should be homogeneous
+
+static X: I64F64 = I64F64(1, 2.0);
+
+fn main() {}
diff --git a/tests/ui/simd/monomorphize-heterogeneous.stderr b/tests/ui/simd/monomorphize-heterogeneous.stderr
new file mode 100644
index 000000000..e7b41cd78
--- /dev/null
+++ b/tests/ui/simd/monomorphize-heterogeneous.stderr
@@ -0,0 +1,9 @@
+error[E0076]: SIMD vector should be homogeneous
+ --> $DIR/monomorphize-heterogeneous.rs:4:1
+ |
+LL | struct I64F64(i64, f64);
+ | ^^^^^^^^^^^^^ SIMD elements must have the same type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0076`.
diff --git a/tests/ui/simple_global_asm.rs b/tests/ui/simple_global_asm.rs
index 3c69379ff..c3b2f2e0b 100644
--- a/tests/ui/simple_global_asm.rs
+++ b/tests/ui/simple_global_asm.rs
@@ -1,4 +1,5 @@
// run-pass
+// needs-asm-support
#![feature(naked_functions)]
#![allow(dead_code)]
diff --git a/tests/ui/span/E0204.rs b/tests/ui/span/E0204.rs
index 174de8cdd..8793a05c8 100644
--- a/tests/ui/span/E0204.rs
+++ b/tests/ui/span/E0204.rs
@@ -2,9 +2,9 @@ struct Foo {
foo: Vec<u32>,
}
-impl Copy for Foo { } //~ ERROR may not be implemented for this type
+impl Copy for Foo { } //~ ERROR cannot be implemented for this type
-#[derive(Copy)] //~ ERROR may not be implemented for this type
+#[derive(Copy)] //~ ERROR cannot be implemented for this type
struct Foo2<'a> {
ty: &'a mut bool,
}
@@ -14,9 +14,9 @@ enum EFoo {
Baz,
}
-impl Copy for EFoo { } //~ ERROR may not be implemented for this type
+impl Copy for EFoo { } //~ ERROR cannot be implemented for this type
-#[derive(Copy)] //~ ERROR may not be implemented for this type
+#[derive(Copy)] //~ ERROR cannot be implemented for this type
enum EFoo2<'a> {
Bar(&'a mut bool),
Baz,
diff --git a/tests/ui/span/E0204.stderr b/tests/ui/span/E0204.stderr
index 0b2166eed..3a0afb541 100644
--- a/tests/ui/span/E0204.stderr
+++ b/tests/ui/span/E0204.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/E0204.rs:5:15
|
LL | foo: Vec<u32>,
@@ -7,7 +7,7 @@ LL | foo: Vec<u32>,
LL | impl Copy for Foo { }
| ^^^
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/E0204.rs:7:10
|
LL | #[derive(Copy)]
@@ -18,7 +18,7 @@ LL | ty: &'a mut bool,
|
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/E0204.rs:17:15
|
LL | Bar { x: Vec<u32> },
@@ -27,7 +27,7 @@ LL | Bar { x: Vec<u32> },
LL | impl Copy for EFoo { }
| ^^^^
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/E0204.rs:19:10
|
LL | #[derive(Copy)]
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 37b2f4138..60433e1c2 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
@@ -15,7 +15,7 @@ LL | interval: Duration,
|
help: consider importing this struct
|
-LL | use std::time::Duration;
+LL + use std::time::Duration;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/span/issue-35987.stderr b/tests/ui/span/issue-35987.stderr
index 057d40ac0..88c86d2a9 100644
--- a/tests/ui/span/issue-35987.stderr
+++ b/tests/ui/span/issue-35987.stderr
@@ -11,7 +11,7 @@ LL | impl<T: Clone, Add> Add for Foo<T> {
|
help: consider importing this trait instead
|
-LL | use std::ops::Add;
+LL + use std::ops::Add;
|
error: aborting due to previous error
diff --git a/tests/ui/span/issue-71363.stderr b/tests/ui/span/issue-71363.stderr
index cb5cc3202..90b623e89 100644
--- a/tests/ui/span/issue-71363.stderr
+++ b/tests/ui/span/issue-71363.stderr
@@ -21,7 +21,8 @@ note: required by a bound in `std::error::Error`
--> $SRC_DIR/core/src/error.rs:LL:COL
help: consider annotating `MyError` with `#[derive(Debug)]`
|
-3 | #[derive(Debug)]
+3 + #[derive(Debug)]
+4 | struct MyError;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/specialization/issue-59435.stderr b/tests/ui/specialization/issue-59435.stderr
index 211459406..e8a12e4d9 100644
--- a/tests/ui/specialization/issue-59435.stderr
+++ b/tests/ui/specialization/issue-59435.stderr
@@ -11,7 +11,8 @@ LL | type MyType: Default;
| ^^^^^^^ required by this bound in `MyTrait::MyType`
help: consider annotating `MyStruct` with `#[derive(Default)]`
|
-LL | #[derive(Default)]
+LL + #[derive(Default)]
+LL | struct MyStruct {}
|
error: aborting due to previous error
diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs
new file mode 100644
index 000000000..5fd7c647c
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs
@@ -0,0 +1,12 @@
+#![feature(min_specialization)]
+
+// An impl that has an erroneous const substitution should not specialize one
+// that is well-formed.
+#[derive(Clone)]
+struct S<const L: usize>;
+
+impl<const N: i32> Copy for S<N> {}
+//~^ ERROR the constant `N` is not of type `usize`
+impl<const M: usize> Copy for S<M> {}
+
+fn main() {}
diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr
new file mode 100644
index 000000000..83f311efd
--- /dev/null
+++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr
@@ -0,0 +1,14 @@
+error: the constant `N` is not of type `usize`
+ --> $DIR/bad-const-wf-doesnt-specialize.rs:8:29
+ |
+LL | impl<const N: i32> Copy for S<N> {}
+ | ^^^^ expected `usize`, found `i32`
+ |
+note: required by a bound in `S`
+ --> $DIR/bad-const-wf-doesnt-specialize.rs:6:10
+ |
+LL | struct S<const L: usize>;
+ | ^^^^^^^^^^^^^^ required by this bound in `S`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/stability-attribute/auxiliary/const-stability-attribute-implies.rs b/tests/ui/stability-attribute/auxiliary/const-stability-attribute-implies.rs
new file mode 100644
index 000000000..f78871b5a
--- /dev/null
+++ b/tests/ui/stability-attribute/auxiliary/const-stability-attribute-implies.rs
@@ -0,0 +1,12 @@
+#![crate_type = "lib"]
+#![feature(staged_api)]
+#![stable(feature = "stability_attribute_implies", since = "1.0.0")]
+#![rustc_const_stable(feature = "stability_attribute_implies", since = "1.0.0")]
+
+#[stable(feature = "stability_attribute_implies", since = "1.0.0")]
+#[rustc_const_stable(feature = "const_foo", since = "1.62.0")]
+pub const fn foo() {}
+
+#[stable(feature = "stability_attribute_implies", since = "1.0.0")]
+#[rustc_const_unstable(feature = "const_foobar", issue = "1", implied_by = "const_foo")]
+pub const fn foobar() {}
diff --git a/tests/ui/stability-attribute/auxiliary/similar-unstable-method.rs b/tests/ui/stability-attribute/auxiliary/similar-unstable-method.rs
new file mode 100644
index 000000000..8804186ee
--- /dev/null
+++ b/tests/ui/stability-attribute/auxiliary/similar-unstable-method.rs
@@ -0,0 +1,13 @@
+#![feature(staged_api)]
+#![stable(feature = "libfoo", since = "1.0.0")]
+
+#[unstable(feature = "foo", reason = "...", issue = "none")]
+pub fn foo() {}
+
+#[stable(feature = "libfoo", since = "1.0.0")]
+pub struct Foo;
+
+impl Foo {
+ #[unstable(feature = "foo", reason = "...", issue = "none")]
+ pub fn foo(&self) {}
+}
diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-missing.rs b/tests/ui/stability-attribute/const-stability-attribute-implies-missing.rs
new file mode 100644
index 000000000..6d6d793c6
--- /dev/null
+++ b/tests/ui/stability-attribute/const-stability-attribute-implies-missing.rs
@@ -0,0 +1,16 @@
+#![crate_type = "lib"]
+#![feature(staged_api)]
+#![stable(feature = "stability_attribute_implies", since = "1.0.0")]
+#![rustc_const_stable(feature = "stability_attribute_implies", since = "1.0.0")]
+
+// Tests that `implied_by = "const_bar"` results in an error being emitted if `const_bar` does not
+// exist.
+
+#[stable(feature = "stability_attribute_implies", since = "1.0.0")]
+#[rustc_const_unstable(feature = "const_foobar", issue = "1", implied_by = "const_bar")]
+//~^ ERROR feature `const_bar` implying `const_foobar` does not exist
+pub const fn foobar() -> u32 {
+ 0
+}
+
+const VAR: u32 = foobar();
diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-missing.stderr b/tests/ui/stability-attribute/const-stability-attribute-implies-missing.stderr
new file mode 100644
index 000000000..6d8b01a54
--- /dev/null
+++ b/tests/ui/stability-attribute/const-stability-attribute-implies-missing.stderr
@@ -0,0 +1,8 @@
+error: feature `const_bar` implying `const_foobar` does not exist
+ --> $DIR/const-stability-attribute-implies-missing.rs:10:1
+ |
+LL | #[rustc_const_unstable(feature = "const_foobar", issue = "1", implied_by = "const_bar")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-no-feature.rs b/tests/ui/stability-attribute/const-stability-attribute-implies-no-feature.rs
new file mode 100644
index 000000000..47e8d2b36
--- /dev/null
+++ b/tests/ui/stability-attribute/const-stability-attribute-implies-no-feature.rs
@@ -0,0 +1,16 @@
+// aux-build:const-stability-attribute-implies.rs
+#![crate_type = "lib"]
+
+// Tests that despite the `const_foobar` feature being implied by now-stable feature `const_foo`,
+// if `const_foobar` isn't allowed in this crate then an error will be emitted.
+
+extern crate const_stability_attribute_implies;
+use const_stability_attribute_implies::{foo, foobar};
+
+pub const fn bar() -> u32 {
+ foo(); // no error - stable
+ foobar(); //~ ERROR `foobar` is not yet stable as a const fn
+ 0
+}
+
+pub const VAR: u32 = bar();
diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-no-feature.stderr b/tests/ui/stability-attribute/const-stability-attribute-implies-no-feature.stderr
new file mode 100644
index 000000000..8ef5a364e
--- /dev/null
+++ b/tests/ui/stability-attribute/const-stability-attribute-implies-no-feature.stderr
@@ -0,0 +1,10 @@
+error: `foobar` is not yet stable as a const fn
+ --> $DIR/const-stability-attribute-implies-no-feature.rs:12:5
+ |
+LL | foobar();
+ | ^^^^^^^^
+ |
+ = help: add `#![feature(const_foobar)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.rs b/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.rs
new file mode 100644
index 000000000..ffaa171d8
--- /dev/null
+++ b/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.rs
@@ -0,0 +1,19 @@
+// aux-build:const-stability-attribute-implies.rs
+#![crate_type = "lib"]
+#![deny(stable_features)]
+#![feature(const_foo)]
+//~^ ERROR the feature `const_foo` has been partially stabilized since 1.62.0 and is succeeded by the feature `const_foobar`
+
+// Tests that the use of `implied_by` in the `#[rustc_const_unstable]` attribute results in a
+// diagnostic mentioning partial stabilization, and that given the implied unstable feature is
+// unused (there is no `foobar` call), that the compiler suggests removing the flag.
+
+extern crate const_stability_attribute_implies;
+use const_stability_attribute_implies::foo;
+
+pub const fn bar() -> u32 {
+ foo();
+ 0
+}
+
+pub const VAR: u32 = bar();
diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.stderr b/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.stderr
new file mode 100644
index 000000000..f6a099cd2
--- /dev/null
+++ b/tests/ui/stability-attribute/const-stability-attribute-implies-using-stable.stderr
@@ -0,0 +1,22 @@
+error: the feature `const_foo` has been partially stabilized since 1.62.0 and is succeeded by the feature `const_foobar`
+ --> $DIR/const-stability-attribute-implies-using-stable.rs:4:12
+ |
+LL | #![feature(const_foo)]
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/const-stability-attribute-implies-using-stable.rs:3:9
+ |
+LL | #![deny(stable_features)]
+ | ^^^^^^^^^^^^^^^
+help: if you are using features which are still unstable, change to using `const_foobar`
+ |
+LL | #![feature(const_foobar)]
+ | ~~~~~~~~~~~~
+help: if you are using features which are now stable, remove this line
+ |
+LL - #![feature(const_foo)]
+ |
+
+error: aborting due to previous error
+
diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.rs b/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.rs
new file mode 100644
index 000000000..2061c5c75
--- /dev/null
+++ b/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.rs
@@ -0,0 +1,21 @@
+// aux-build:const-stability-attribute-implies.rs
+#![crate_type = "lib"]
+#![deny(stable_features)]
+#![feature(const_foo)]
+//~^ ERROR the feature `const_foo` has been partially stabilized since 1.62.0 and is succeeded by the feature `const_foobar`
+
+// Tests that the use of `implied_by` in the `#[rustc_const_unstable]` attribute results in a
+// diagnostic mentioning partial stabilization and that given the implied unstable feature is
+// used (there is a `const_foobar` call), that the compiler suggests changing to that feature and
+// doesn't error about its use.
+
+extern crate const_stability_attribute_implies;
+use const_stability_attribute_implies::{foo, foobar};
+
+pub const fn bar() -> u32 {
+ foo();
+ foobar(); // no error!
+ 0
+}
+
+pub const VAR: u32 = bar();
diff --git a/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.stderr b/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.stderr
new file mode 100644
index 000000000..063856676
--- /dev/null
+++ b/tests/ui/stability-attribute/const-stability-attribute-implies-using-unstable.stderr
@@ -0,0 +1,22 @@
+error: the feature `const_foo` has been partially stabilized since 1.62.0 and is succeeded by the feature `const_foobar`
+ --> $DIR/const-stability-attribute-implies-using-unstable.rs:4:12
+ |
+LL | #![feature(const_foo)]
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/const-stability-attribute-implies-using-unstable.rs:3:9
+ |
+LL | #![deny(stable_features)]
+ | ^^^^^^^^^^^^^^^
+help: if you are using features which are still unstable, change to using `const_foobar`
+ |
+LL | #![feature(const_foobar)]
+ | ~~~~~~~~~~~~
+help: if you are using features which are now stable, remove this line
+ |
+LL - #![feature(const_foo)]
+ |
+
+error: aborting due to previous error
+
diff --git a/tests/ui/stability-attribute/issue-109177.rs b/tests/ui/stability-attribute/issue-109177.rs
new file mode 100644
index 000000000..6d052779c
--- /dev/null
+++ b/tests/ui/stability-attribute/issue-109177.rs
@@ -0,0 +1,13 @@
+// aux-build: similar-unstable-method.rs
+
+extern crate similar_unstable_method;
+
+fn main() {
+ // FIXME: this function should not suggest the `foo` function.
+ similar_unstable_method::foo1();
+ //~^ ERROR cannot find function `foo1` in crate `similar_unstable_method` [E0425]
+
+ let foo = similar_unstable_method::Foo;
+ foo.foo1();
+ //~^ ERROR no method named `foo1` found for struct `Foo` in the current scope [E0599]
+}
diff --git a/tests/ui/stability-attribute/issue-109177.stderr b/tests/ui/stability-attribute/issue-109177.stderr
new file mode 100644
index 000000000..9c2ac591a
--- /dev/null
+++ b/tests/ui/stability-attribute/issue-109177.stderr
@@ -0,0 +1,21 @@
+error[E0425]: cannot find function `foo1` in crate `similar_unstable_method`
+ --> $DIR/issue-109177.rs:7:30
+ |
+LL | similar_unstable_method::foo1();
+ | ^^^^ help: a function with a similar name exists: `foo`
+ |
+ ::: $DIR/auxiliary/similar-unstable-method.rs:5:1
+ |
+LL | pub fn foo() {}
+ | ------------ similarly named function `foo` defined here
+
+error[E0599]: no method named `foo1` found for struct `Foo` in the current scope
+ --> $DIR/issue-109177.rs:11:9
+ |
+LL | foo.foo1();
+ | ^^^^ method not found in `Foo`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0425, E0599.
+For more information about an error, try `rustc --explain E0425`.
diff --git a/tests/ui/static/static-mut-not-constant.rs b/tests/ui/static/static-mut-not-constant.rs
index 2091fffd4..d501e5c29 100644
--- a/tests/ui/static/static-mut-not-constant.rs
+++ b/tests/ui/static/static-mut-not-constant.rs
@@ -1,6 +1,4 @@
-#![feature(box_syntax)]
-
-static mut a: Box<isize> = box 3;
-//~^ ERROR allocations are not allowed in statics
+static mut a: Box<isize> = Box::new(3);
+//~^ ERROR cannot call non-const fn
fn main() {}
diff --git a/tests/ui/static/static-mut-not-constant.stderr b/tests/ui/static/static-mut-not-constant.stderr
index a0fa24515..8411a1557 100644
--- a/tests/ui/static/static-mut-not-constant.stderr
+++ b/tests/ui/static/static-mut-not-constant.stderr
@@ -1,9 +1,12 @@
-error[E0010]: allocations are not allowed in statics
- --> $DIR/static-mut-not-constant.rs:3:28
+error[E0015]: cannot call non-const fn `Box::<isize>::new` in statics
+ --> $DIR/static-mut-not-constant.rs:1:28
|
-LL | static mut a: Box<isize> = box 3;
- | ^^^^^ allocation not allowed in statics
+LL | static mut a: Box<isize> = Box::new(3);
+ | ^^^^^^^^^^^
+ |
+ = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+ = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0010`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/statics/uninhabited-static.stderr b/tests/ui/statics/uninhabited-static.stderr
index 437053a44..35fdcae6a 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(()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
+ | ^^^^^^^^^^^^^^^^^^^^^^^ 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(()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
+ | ^^^^^^^^^^^^^^^^^^^^^^^ 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/stats/hir-stats.stderr b/tests/ui/stats/hir-stats.stderr
index ee62d8f2d..d723ff538 100644
--- a/tests/ui/stats/hir-stats.stderr
+++ b/tests/ui/stats/hir-stats.stderr
@@ -15,45 +15,45 @@ ast-stats-1 Arm 96 ( 1.5%) 2 48
ast-stats-1 ForeignItem 96 ( 1.5%) 1 96
ast-stats-1 - Fn 96 ( 1.5%) 1
ast-stats-1 FnDecl 120 ( 1.8%) 5 24
-ast-stats-1 FieldDef 160 ( 2.4%) 2 80
-ast-stats-1 Stmt 160 ( 2.4%) 5 32
+ast-stats-1 FieldDef 160 ( 2.5%) 2 80
+ast-stats-1 Stmt 160 ( 2.5%) 5 32
ast-stats-1 - Local 32 ( 0.5%) 1
ast-stats-1 - MacCall 32 ( 0.5%) 1
ast-stats-1 - Expr 96 ( 1.5%) 3
-ast-stats-1 Param 160 ( 2.4%) 4 40
-ast-stats-1 Block 192 ( 2.9%) 6 32
+ast-stats-1 Param 160 ( 2.5%) 4 40
+ast-stats-1 Block 192 ( 3.0%) 6 32
ast-stats-1 Variant 208 ( 3.2%) 2 104
-ast-stats-1 GenericBound 224 ( 3.4%) 4 56
-ast-stats-1 - Trait 224 ( 3.4%) 4
-ast-stats-1 AssocItem 416 ( 6.3%) 4 104
-ast-stats-1 - Type 208 ( 3.2%) 2
-ast-stats-1 - Fn 208 ( 3.2%) 2
-ast-stats-1 GenericParam 480 ( 7.3%) 5 96
-ast-stats-1 Pat 504 ( 7.7%) 7 72
+ast-stats-1 GenericBound 224 ( 3.5%) 4 56
+ast-stats-1 - Trait 224 ( 3.5%) 4
+ast-stats-1 AssocItem 352 ( 5.4%) 4 88
+ast-stats-1 - Type 176 ( 2.7%) 2
+ast-stats-1 - Fn 176 ( 2.7%) 2
+ast-stats-1 GenericParam 480 ( 7.4%) 5 96
+ast-stats-1 Pat 504 ( 7.8%) 7 72
ast-stats-1 - Struct 72 ( 1.1%) 1
ast-stats-1 - Wild 72 ( 1.1%) 1
ast-stats-1 - Ident 360 ( 5.5%) 5
-ast-stats-1 Expr 576 ( 8.8%) 8 72
+ast-stats-1 Expr 576 ( 8.9%) 8 72
ast-stats-1 - Path 72 ( 1.1%) 1
ast-stats-1 - Match 72 ( 1.1%) 1
ast-stats-1 - Struct 72 ( 1.1%) 1
ast-stats-1 - Lit 144 ( 2.2%) 2
ast-stats-1 - Block 216 ( 3.3%) 3
-ast-stats-1 PathSegment 720 (11.0%) 30 24
-ast-stats-1 Ty 896 (13.7%) 14 64
+ast-stats-1 PathSegment 720 (11.1%) 30 24
+ast-stats-1 Ty 896 (13.8%) 14 64
ast-stats-1 - Ptr 64 ( 1.0%) 1
ast-stats-1 - Ref 64 ( 1.0%) 1
ast-stats-1 - ImplicitSelf 128 ( 2.0%) 2
-ast-stats-1 - Path 640 ( 9.8%) 10
-ast-stats-1 Item 1_224 (18.7%) 9 136
+ast-stats-1 - Path 640 ( 9.9%) 10
+ast-stats-1 Item 1_224 (18.9%) 9 136
ast-stats-1 - Trait 136 ( 2.1%) 1
ast-stats-1 - Enum 136 ( 2.1%) 1
ast-stats-1 - ForeignMod 136 ( 2.1%) 1
ast-stats-1 - Impl 136 ( 2.1%) 1
ast-stats-1 - Fn 272 ( 4.2%) 2
-ast-stats-1 - Use 408 ( 6.2%) 3
+ast-stats-1 - Use 408 ( 6.3%) 3
ast-stats-1 ----------------------------------------------------------------
-ast-stats-1 Total 6_552
+ast-stats-1 Total 6_488
ast-stats-1
ast-stats-2 POST EXPANSION AST STATS
ast-stats-2 Name Accumulated Size Count Item Size
@@ -65,32 +65,32 @@ ast-stats-2 ExprField 48 ( 0.7%) 1 48
ast-stats-2 WherePredicate 56 ( 0.8%) 1 56
ast-stats-2 - BoundPredicate 56 ( 0.8%) 1
ast-stats-2 Local 72 ( 1.0%) 1 72
-ast-stats-2 Arm 96 ( 1.3%) 2 48
-ast-stats-2 ForeignItem 96 ( 1.3%) 1 96
-ast-stats-2 - Fn 96 ( 1.3%) 1
+ast-stats-2 Arm 96 ( 1.4%) 2 48
+ast-stats-2 ForeignItem 96 ( 1.4%) 1 96
+ast-stats-2 - Fn 96 ( 1.4%) 1
ast-stats-2 InlineAsm 120 ( 1.7%) 1 120
ast-stats-2 FnDecl 120 ( 1.7%) 5 24
ast-stats-2 Attribute 128 ( 1.8%) 4 32
-ast-stats-2 - DocComment 32 ( 0.4%) 1
-ast-stats-2 - Normal 96 ( 1.3%) 3
-ast-stats-2 FieldDef 160 ( 2.2%) 2 80
-ast-stats-2 Stmt 160 ( 2.2%) 5 32
-ast-stats-2 - Local 32 ( 0.4%) 1
-ast-stats-2 - Semi 32 ( 0.4%) 1
-ast-stats-2 - Expr 96 ( 1.3%) 3
-ast-stats-2 Param 160 ( 2.2%) 4 40
+ast-stats-2 - DocComment 32 ( 0.5%) 1
+ast-stats-2 - Normal 96 ( 1.4%) 3
+ast-stats-2 FieldDef 160 ( 2.3%) 2 80
+ast-stats-2 Stmt 160 ( 2.3%) 5 32
+ast-stats-2 - Local 32 ( 0.5%) 1
+ast-stats-2 - Semi 32 ( 0.5%) 1
+ast-stats-2 - Expr 96 ( 1.4%) 3
+ast-stats-2 Param 160 ( 2.3%) 4 40
ast-stats-2 Block 192 ( 2.7%) 6 32
ast-stats-2 Variant 208 ( 2.9%) 2 104
-ast-stats-2 GenericBound 224 ( 3.1%) 4 56
-ast-stats-2 - Trait 224 ( 3.1%) 4
-ast-stats-2 AssocItem 416 ( 5.8%) 4 104
-ast-stats-2 - Type 208 ( 2.9%) 2
-ast-stats-2 - Fn 208 ( 2.9%) 2
-ast-stats-2 GenericParam 480 ( 6.7%) 5 96
-ast-stats-2 Pat 504 ( 7.0%) 7 72
+ast-stats-2 GenericBound 224 ( 3.2%) 4 56
+ast-stats-2 - Trait 224 ( 3.2%) 4
+ast-stats-2 AssocItem 352 ( 5.0%) 4 88
+ast-stats-2 - Type 176 ( 2.5%) 2
+ast-stats-2 - Fn 176 ( 2.5%) 2
+ast-stats-2 GenericParam 480 ( 6.8%) 5 96
+ast-stats-2 Pat 504 ( 7.1%) 7 72
ast-stats-2 - Struct 72 ( 1.0%) 1
ast-stats-2 - Wild 72 ( 1.0%) 1
-ast-stats-2 - Ident 360 ( 5.0%) 5
+ast-stats-2 - Ident 360 ( 5.1%) 5
ast-stats-2 Expr 648 ( 9.1%) 9 72
ast-stats-2 - Path 72 ( 1.0%) 1
ast-stats-2 - Match 72 ( 1.0%) 1
@@ -98,22 +98,22 @@ ast-stats-2 - Struct 72 ( 1.0%) 1
ast-stats-2 - InlineAsm 72 ( 1.0%) 1
ast-stats-2 - Lit 144 ( 2.0%) 2
ast-stats-2 - Block 216 ( 3.0%) 3
-ast-stats-2 PathSegment 792 (11.1%) 33 24
-ast-stats-2 Ty 896 (12.5%) 14 64
+ast-stats-2 PathSegment 792 (11.2%) 33 24
+ast-stats-2 Ty 896 (12.6%) 14 64
ast-stats-2 - Ptr 64 ( 0.9%) 1
ast-stats-2 - Ref 64 ( 0.9%) 1
ast-stats-2 - ImplicitSelf 128 ( 1.8%) 2
-ast-stats-2 - Path 640 ( 8.9%) 10
-ast-stats-2 Item 1_496 (20.9%) 11 136
+ast-stats-2 - Path 640 ( 9.0%) 10
+ast-stats-2 Item 1_496 (21.1%) 11 136
ast-stats-2 - Trait 136 ( 1.9%) 1
ast-stats-2 - Enum 136 ( 1.9%) 1
ast-stats-2 - ExternCrate 136 ( 1.9%) 1
ast-stats-2 - ForeignMod 136 ( 1.9%) 1
ast-stats-2 - Impl 136 ( 1.9%) 1
ast-stats-2 - Fn 272 ( 3.8%) 2
-ast-stats-2 - Use 544 ( 7.6%) 4
+ast-stats-2 - Use 544 ( 7.7%) 4
ast-stats-2 ----------------------------------------------------------------
-ast-stats-2 Total 7_152
+ast-stats-2 Total 7_088
ast-stats-2
hir-stats HIR STATS
hir-stats Name Accumulated Size Count Item Size
diff --git a/tests/ui-fulldeps/std/issue-15149.rs b/tests/ui/std/issue-15149.rs
index 064472f57..064472f57 100644
--- a/tests/ui-fulldeps/std/issue-15149.rs
+++ b/tests/ui/std/issue-15149.rs
diff --git a/tests/ui-fulldeps/std/issue-81357-unsound-file-methods.rs b/tests/ui/std/issue-81357-unsound-file-methods.rs
index fdf1150f8..fdf1150f8 100644
--- a/tests/ui-fulldeps/std/issue-81357-unsound-file-methods.rs
+++ b/tests/ui/std/issue-81357-unsound-file-methods.rs
diff --git a/tests/ui-fulldeps/std/stdio-from.rs b/tests/ui/std/stdio-from.rs
index fef9f27fc..fef9f27fc 100644
--- a/tests/ui-fulldeps/std/stdio-from.rs
+++ b/tests/ui/std/stdio-from.rs
diff --git a/tests/ui-fulldeps/std/switch-stdout.rs b/tests/ui/std/switch-stdout.rs
index e9501a809..2d936d96b 100644
--- a/tests/ui-fulldeps/std/switch-stdout.rs
+++ b/tests/ui/std/switch-stdout.rs
@@ -1,4 +1,5 @@
// run-pass
+// ignore-wasm (needs file descriptors and env variables)
use std::env;
use std::fs::File;
diff --git a/tests/ui/str/str-escape.rs b/tests/ui/str/str-escape.rs
index 0264632fd..10a72421f 100644
--- a/tests/ui/str/str-escape.rs
+++ b/tests/ui/str/str-escape.rs
@@ -1,11 +1,31 @@
// check-pass
+// ignore-tidy-tab
+
fn main() {
let s = "\
";
//~^^^ WARNING multiple lines skipped by escaped newline
+ assert_eq!(s, "");
+
let s = "foo\
  bar
";
- //~^^^ WARNING non-ASCII whitespace symbol '\u{a0}' is not skipped
+ //~^^^ WARNING whitespace symbol '\u{a0}' is not skipped
+ assert_eq!(s, "foo  bar\n ");
+
+ let s = "a\
+ b";
+ assert_eq!(s, "ab");
+
+ let s = "a\
+ b";
+ assert_eq!(s, "ab");
+
+ let s = "a\
+ b";
+ //~^^ WARNING whitespace symbol '\u{c}' is not skipped
+ // '\x0c' is ASCII whitespace, but it may not need skipped
+ // discussion: https://github.com/rust-lang/rust/pull/108403
+ assert_eq!(s, "a\x0cb");
}
diff --git a/tests/ui/str/str-escape.stderr b/tests/ui/str/str-escape.stderr
index b2501f1a2..43b4f7e36 100644
--- a/tests/ui/str/str-escape.stderr
+++ b/tests/ui/str/str-escape.stderr
@@ -1,5 +1,5 @@
warning: multiple lines skipped by escaped newline
- --> $DIR/str-escape.rs:3:14
+ --> $DIR/str-escape.rs:5:14
|
LL | let s = "\
| ______________^
@@ -7,15 +7,25 @@ LL | |
LL | | ";
| |_____________^ skipping everything up to and including this point
-warning: non-ASCII whitespace symbol '\u{a0}' is not skipped
- --> $DIR/str-escape.rs:7:17
+warning: whitespace symbol '\u{a0}' is not skipped
+ --> $DIR/str-escape.rs:11:17
|
LL | let s = "foo\
| _________________^
LL | |   bar
- | | ^ non-ASCII whitespace symbol '\u{a0}' is not skipped
+ | | ^ whitespace symbol '\u{a0}' is not skipped
| |___|
|
-warning: 2 warnings emitted
+warning: whitespace symbol '\u{c}' is not skipped
+ --> $DIR/str-escape.rs:25:15
+ |
+LL | let s = "a\
+ | _______________^
+LL | | b";
+ | | ^- whitespace symbol '\u{c}' is not skipped
+ | |____|
+ |
+
+warning: 3 warnings emitted
diff --git a/tests/ui/structs-enums/align-struct.rs b/tests/ui/structs-enums/align-struct.rs
index f5418e754..54092542f 100644
--- a/tests/ui/structs-enums/align-struct.rs
+++ b/tests/ui/structs-enums/align-struct.rs
@@ -1,5 +1,5 @@
// run-pass
-#![allow(dead_code)]
+#![allow(dead_code, unused_allocation)]
use std::mem;
@@ -20,7 +20,6 @@ struct AlignMany(i32);
// Raising alignment may not alter size.
#[repr(align(8))]
-#[allow(dead_code)]
struct Align8Many {
a: i32,
b: i32,
@@ -29,9 +28,8 @@ struct Align8Many {
}
enum Enum {
- #[allow(dead_code)]
A(i32),
- B(Align16)
+ B(Align16),
}
// Nested alignment - use `#[repr(C)]` to suppress field reordering for sizeof test
@@ -73,7 +71,7 @@ struct AlignLarge {
union UnionContainsAlign {
a: Align16,
- b: f32
+ b: f32,
}
impl Align16 {
@@ -158,7 +156,7 @@ pub fn main() {
// Note that the size of Nested may change if struct field re-ordering is enabled
assert_eq!(mem::align_of::<Nested>(), 16);
assert_eq!(mem::size_of::<Nested>(), 48);
- let a = Nested{ a: 1, b: 2, c: Align16(3), d: 4};
+ let a = Nested { a: 1, b: 2, c: Align16(3), d: 4 };
assert_eq!(mem::align_of_val(&a), 16);
assert_eq!(mem::align_of_val(&a.b), 4);
assert_eq!(mem::align_of_val(&a.c), 16);
@@ -179,8 +177,8 @@ pub fn main() {
assert_eq!(a.0, 15);
assert_eq!(mem::align_of_val(a), 16);
assert_eq!(mem::size_of_val(a), 16);
- },
- _ => ()
+ }
+ _ => (),
}
assert!(is_aligned_to(&e, 16));
@@ -197,8 +195,8 @@ pub fn main() {
}
// arrays of aligned elements should also be aligned
- assert_eq!(mem::align_of::<[Align16;2]>(), 16);
- assert_eq!(mem::size_of::<[Align16;2]>(), 32);
+ assert_eq!(mem::align_of::<[Align16; 2]>(), 16);
+ assert_eq!(mem::size_of::<[Align16; 2]>(), 32);
let a = [Align16(0), Align16(1)];
assert_eq!(mem::align_of_val(&a[0]), 16);
@@ -209,7 +207,7 @@ pub fn main() {
assert_eq!(mem::align_of_val(Box::new(Align16(0)).as_ref()), 16);
// check heap array is aligned
- let a = vec!(Align16(0), Align16(1));
+ let a = vec![Align16(0), Align16(1)];
assert_eq!(mem::align_of_val(&a[0]), 16);
assert_eq!(mem::align_of_val(&a[1]), 16);
@@ -224,16 +222,14 @@ pub fn main() {
assert_eq!(mem::align_of::<AlignContainsPacked4C>(), 16);
assert_eq!(mem::size_of::<AlignContainsPacked4C>(), 32);
- let a = AlignContainsPacked4C { a: Packed4C{ a: 1, b: 2 }, b: 3 };
+ let a = AlignContainsPacked4C { a: Packed4C { a: 1, b: 2 }, b: 3 };
assert_eq!(mem::align_of_val(&a), 16);
assert_eq!(mem::align_of_val(&a.a), 4);
assert_eq!(mem::align_of_val(&a.b), mem::align_of::<u64>());
assert_eq!(mem::size_of_val(&a), 32);
assert!(is_aligned_to(&a, 16));
- let mut large = Box::new(AlignLarge {
- stuff: [0; 0x10000],
- });
+ let mut large = Box::new(AlignLarge { stuff: [0; 0x10000] });
large.stuff[0] = 132;
*large.stuff.last_mut().unwrap() = 102;
assert_eq!(large.stuff[0], 132);
diff --git a/tests/ui/structs/struct-path-alias-bounds.stderr b/tests/ui/structs/struct-path-alias-bounds.stderr
index 266291f62..5b01208c5 100644
--- a/tests/ui/structs/struct-path-alias-bounds.stderr
+++ b/tests/ui/structs/struct-path-alias-bounds.stderr
@@ -11,7 +11,8 @@ LL | struct S<T: Clone> { a: T }
| ^^^^^ required by this bound in `S`
help: consider annotating `NoClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NoClone;
|
error: aborting due to previous error
diff --git a/tests/ui/structs/struct-tuple-field-names.rs b/tests/ui/structs/struct-tuple-field-names.rs
index 7bd54af1d..33f264aa2 100644
--- a/tests/ui/structs/struct-tuple-field-names.rs
+++ b/tests/ui/structs/struct-tuple-field-names.rs
@@ -12,4 +12,7 @@ fn main() {
match y {
S { } => {} //~ ERROR: tuple variant `S` written as struct variant [E0769]
}
+
+ if let E::S { 0: a } = x { //~ ERROR: pattern does not mention field `1`
+ }
}
diff --git a/tests/ui/structs/struct-tuple-field-names.stderr b/tests/ui/structs/struct-tuple-field-names.stderr
index 5494c29a6..0b837a47a 100644
--- a/tests/ui/structs/struct-tuple-field-names.stderr
+++ b/tests/ui/structs/struct-tuple-field-names.stderr
@@ -20,6 +20,22 @@ help: use the tuple variant pattern syntax instead
LL | S(_, _) => {}
| ~~~~~~
-error: aborting due to 2 previous errors
+error[E0027]: pattern does not mention field `1`
+ --> $DIR/struct-tuple-field-names.rs:16:12
+ |
+LL | if let E::S { 0: a } = x {
+ | ^^^^^^^^^^^^^ missing field `1`
+ |
+help: include the missing field in the pattern
+ |
+LL | if let E::S { 0: a, 1: _ } = x {
+ | ~~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | if let E::S { 0: a, .. } = x {
+ | ~~~~~~
+
+error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0769`.
+Some errors have detailed explanations: E0027, E0769.
+For more information about an error, try `rustc --explain E0027`.
diff --git a/tests/ui/suggestions/bad-infer-in-trait-impl.rs b/tests/ui/suggestions/bad-infer-in-trait-impl.rs
new file mode 100644
index 000000000..87db2636f
--- /dev/null
+++ b/tests/ui/suggestions/bad-infer-in-trait-impl.rs
@@ -0,0 +1,10 @@
+trait Foo {
+ fn bar();
+}
+
+impl Foo for () {
+ fn bar(s: _) {}
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for functions
+}
+
+fn main() {}
diff --git a/tests/ui/suggestions/bad-infer-in-trait-impl.stderr b/tests/ui/suggestions/bad-infer-in-trait-impl.stderr
new file mode 100644
index 000000000..418690ff8
--- /dev/null
+++ b/tests/ui/suggestions/bad-infer-in-trait-impl.stderr
@@ -0,0 +1,14 @@
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/bad-infer-in-trait-impl.rs:6:15
+ |
+LL | fn bar(s: _) {}
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn bar<T>(s: T) {}
+ | +++ ~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/tests/ui/suggestions/chain-method-call-mutation-in-place.rs b/tests/ui/suggestions/chain-method-call-mutation-in-place.rs
index cb92ab87a..7a4c74796 100644
--- a/tests/ui/suggestions/chain-method-call-mutation-in-place.rs
+++ b/tests/ui/suggestions/chain-method-call-mutation-in-place.rs
@@ -1,4 +1,8 @@
-fn main() {}
+fn main() {
+ let x: Vec<i32> = vec![1, 2, 3].into_iter().collect::<Vec<i32>>().sort_by_key(|i| i); //~ ERROR mismatched types
+ vec![1, 2, 3].into_iter().collect::<Vec<i32>>().sort_by_key(|i| i).sort(); //~ ERROR no method named `sort` found for unit type `()` in the current scope
+}
+
fn foo(mut s: String) -> String {
s.push_str("asdf") //~ ERROR mismatched types
}
diff --git a/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr b/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr
index 11d9b8391..128160f10 100644
--- a/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr
+++ b/tests/ui/suggestions/chain-method-call-mutation-in-place.stderr
@@ -1,5 +1,33 @@
error[E0308]: mismatched types
- --> $DIR/chain-method-call-mutation-in-place.rs:3:5
+ --> $DIR/chain-method-call-mutation-in-place.rs:2:23
+ |
+LL | let x: Vec<i32> = vec![1, 2, 3].into_iter().collect::<Vec<i32>>().sort_by_key(|i| i);
+ | -------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Vec<i32>`, found `()`
+ | |
+ | expected due to this
+ |
+ = note: expected struct `Vec<i32>`
+ found unit type `()`
+note: method `sort_by_key` modifies its receiver in-place, it is not meant to be used in method chains.
+ --> $DIR/chain-method-call-mutation-in-place.rs:2:71
+ |
+LL | let x: Vec<i32> = vec![1, 2, 3].into_iter().collect::<Vec<i32>>().sort_by_key(|i| i);
+ | ^^^^^^^^^^^ this call modifies its receiver in-place
+
+error[E0599]: no method named `sort` found for unit type `()` in the current scope
+ --> $DIR/chain-method-call-mutation-in-place.rs:3:72
+ |
+LL | vec![1, 2, 3].into_iter().collect::<Vec<i32>>().sort_by_key(|i| i).sort();
+ | ^^^^ method not found in `()`
+ |
+note: method `sort_by_key` modifies its receiver in-place, it is not meant to be used in method chains.
+ --> $DIR/chain-method-call-mutation-in-place.rs:3:53
+ |
+LL | vec![1, 2, 3].into_iter().collect::<Vec<i32>>().sort_by_key(|i| i).sort();
+ | ^^^^^^^^^^^ this call modifies its receiver in-place
+
+error[E0308]: mismatched types
+ --> $DIR/chain-method-call-mutation-in-place.rs:7:5
|
LL | fn foo(mut s: String) -> String {
| ------ expected `String` because of return type
@@ -7,7 +35,7 @@ LL | s.push_str("asdf")
| ^^^^^^^^^^^^^^^^^^ expected `String`, found `()`
|
note: method `push_str` modifies its receiver in-place
- --> $DIR/chain-method-call-mutation-in-place.rs:3:7
+ --> $DIR/chain-method-call-mutation-in-place.rs:7:7
|
LL | s.push_str("asdf")
| - ^^^^^^^^ this call modifies `s` in-place
@@ -15,6 +43,7 @@ LL | s.push_str("asdf")
| you probably want to use this value after calling the method...
= note: ...instead of the `()` output of method `push_str`
-error: aborting due to previous error
+error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0308`.
+Some errors have detailed explanations: E0308, E0599.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr
index 45593035b..0716005c6 100644
--- a/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr
+++ b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr
@@ -35,7 +35,8 @@ LL | t.clone()
| ^
help: consider annotating `Foo` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct Foo;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
index 15f08486f..af47ba8ba 100644
--- a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
+++ b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
@@ -2,10 +2,9 @@ fn main() {
let A = 3;
//~^ ERROR refutable pattern in local binding
//~| patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered
- //~| missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
+ //~| missing patterns are not covered because `A` is interpreted as a constant pattern, not a new variable
//~| HELP introduce a variable instead
- //~| SUGGESTION a_var
+ //~| SUGGESTION A_var
const A: i32 = 2;
- //~^ constant defined here
}
diff --git a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr
index 1c1cab25f..9ee3e6eb2 100644
--- a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr
+++ b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr
@@ -5,12 +5,11 @@ LL | let A = 3;
| ^
| |
| patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered
- | missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
- | help: introduce a variable instead: `a_var`
-...
-LL | const A: i32 = 2;
- | ------------ constant defined here
+ | missing patterns are not covered because `A` is interpreted as a constant pattern, not a new variable
+ | help: introduce a variable instead: `A_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 previous error
diff --git a/tests/ui/suggestions/core-std-import-order-issue-83564.stderr b/tests/ui/suggestions/core-std-import-order-issue-83564.stderr
index e4e1fc591..48ee44a74 100644
--- a/tests/ui/suggestions/core-std-import-order-issue-83564.stderr
+++ b/tests/ui/suggestions/core-std-import-order-issue-83564.stderr
@@ -6,9 +6,9 @@ LL | let _x = NonZeroU32::new(5).unwrap();
|
help: consider importing one of these items
|
-LL | use core::num::NonZeroU32;
+LL + use core::num::NonZeroU32;
|
-LL | use std::num::NonZeroU32;
+LL + use std::num::NonZeroU32;
|
error: aborting due to previous error
diff --git a/tests/ui/suggestions/correct-binder-for-arbitrary-bound-sugg.rs b/tests/ui/suggestions/correct-binder-for-arbitrary-bound-sugg.rs
new file mode 100644
index 000000000..e56c8622e
--- /dev/null
+++ b/tests/ui/suggestions/correct-binder-for-arbitrary-bound-sugg.rs
@@ -0,0 +1,16 @@
+trait Foo
+where
+ for<'a> &'a Self: Bar,
+{
+}
+
+impl Foo for () {}
+
+trait Bar {}
+
+impl Bar for &() {}
+
+fn foo<T: Foo>() {}
+//~^ ERROR the trait bound `for<'a> &'a T: Bar` is not satisfied
+
+fn main() {}
diff --git a/tests/ui/suggestions/correct-binder-for-arbitrary-bound-sugg.stderr b/tests/ui/suggestions/correct-binder-for-arbitrary-bound-sugg.stderr
new file mode 100644
index 000000000..2298e7f4e
--- /dev/null
+++ b/tests/ui/suggestions/correct-binder-for-arbitrary-bound-sugg.stderr
@@ -0,0 +1,22 @@
+error[E0277]: the trait bound `for<'a> &'a T: Bar` is not satisfied
+ --> $DIR/correct-binder-for-arbitrary-bound-sugg.rs:13:11
+ |
+LL | fn foo<T: Foo>() {}
+ | ^^^ the trait `for<'a> Bar` is not implemented for `&'a T`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/correct-binder-for-arbitrary-bound-sugg.rs:3:23
+ |
+LL | trait Foo
+ | --- required by a bound in this trait
+LL | where
+LL | for<'a> &'a Self: Bar,
+ | ^^^ required by this bound in `Foo`
+help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
+ |
+LL | fn foo<T: Foo>() where for<'a> &'a T: Bar {}
+ | ++++++++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/suggestions/derive-macro-missing-bounds.stderr b/tests/ui/suggestions/derive-macro-missing-bounds.stderr
index 79036279d..c3f305c17 100644
--- a/tests/ui/suggestions/derive-macro-missing-bounds.stderr
+++ b/tests/ui/suggestions/derive-macro-missing-bounds.stderr
@@ -11,7 +11,8 @@ LL | struct Outer<T>(Inner<T>);
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `a::Inner<T>` with `#[derive(Debug)]`
|
-LL | #[derive(Debug)]
+LL + #[derive(Debug)]
+LL | struct Inner<T>(T);
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
diff --git a/tests/ui/suggestions/derive-trait-for-method-call.stderr b/tests/ui/suggestions/derive-trait-for-method-call.stderr
index 924b26a8c..e2db0da74 100644
--- a/tests/ui/suggestions/derive-trait-for-method-call.stderr
+++ b/tests/ui/suggestions/derive-trait-for-method-call.stderr
@@ -32,7 +32,8 @@ note: the trait `Default` must be implemented
--> $SRC_DIR/core/src/default.rs:LL:COL
help: consider annotating `Enum` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | enum Enum {
|
error[E0599]: the method `test` exists for struct `Foo<Struct, CloneStruct>`, but its trait bounds were not satisfied
@@ -67,11 +68,13 @@ LL | impl<X: Clone + Default + , Y: Clone + Default> Foo<X, Y> {
| unsatisfied trait bound introduced here
help: consider annotating `CloneStruct` with `#[derive(Default)]`
|
-LL | #[derive(Default)]
+LL + #[derive(Default)]
+LL | struct CloneStruct {
|
help: consider annotating `Struct` with `#[derive(Clone, Default)]`
|
-LL | #[derive(Clone, Default)]
+LL + #[derive(Clone, Default)]
+LL | struct Struct {
|
error[E0599]: the method `test` exists for struct `Foo<Vec<Enum>, Instant>`, but its trait bounds were not satisfied
diff --git a/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr
index 4658ecb3a..85fbb8b88 100644
--- a/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr
+++ b/tests/ui/suggestions/dont-wrap-ambiguous-receivers.stderr
@@ -10,9 +10,9 @@ LL | banana::Chaenomeles.pick()
= help: items from traits can only be used if the trait is in scope
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
|
-LL | use banana::Apple;
+LL + use banana::Apple;
|
-LL | use banana::Peach;
+LL + use banana::Peach;
|
error: aborting due to previous error
diff --git a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
index 90ea06239..0232d4c8d 100644
--- a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
+++ b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
@@ -50,7 +50,8 @@ LL | Pin::new(x)
| |
| required by a bound introduced by this call
|
- = note: consider using `Box::pin`
+ = note: consider using the `pin!` macro
+ consider using `Box::pin` if you need to access the pinned value outside of the current scope
note: required by a bound in `Pin::<P>::new`
--> $SRC_DIR/core/src/pin.rs:LL:COL
@@ -62,25 +63,23 @@ LL | Pin::new(Box::new(x))
| |
| required by a bound introduced by this call
|
- = note: consider using `Box::pin`
+ = note: consider using the `pin!` macro
+ consider using `Box::pin` if you need to access the pinned value outside of the current scope
note: required by a bound in `Pin::<P>::new`
--> $SRC_DIR/core/src/pin.rs:LL:COL
error[E0308]: mismatched types
--> $DIR/expected-boxed-future-isnt-pinned.rs:28:5
|
+LL | fn zap() -> BoxFuture<'static, i32> {
+ | ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type
LL | / async {
LL | | 42
LL | | }
- | | ^
- | | |
- | |_____expected `Pin<Box<...>>`, found `async` block
- | arguments to this function are incorrect
+ | |_____^ expected `Pin<Box<...>>`, found `async` block
|
- = note: expected struct `Pin<Box<dyn Future<Output = i32> + Send>>`
+ = note: expected struct `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>`
found `async` block `[async block@$DIR/expected-boxed-future-isnt-pinned.rs:28:5: 30:6]`
-note: function defined here
- --> $SRC_DIR/core/src/future/mod.rs:LL:COL
help: you need to pin and box this expression
|
LL ~ Box::pin(async {
diff --git a/tests/ui/suggestions/import-trait-for-method-call.stderr b/tests/ui/suggestions/import-trait-for-method-call.stderr
index f159b51a2..3f54daf13 100644
--- a/tests/ui/suggestions/import-trait-for-method-call.stderr
+++ b/tests/ui/suggestions/import-trait-for-method-call.stderr
@@ -10,7 +10,7 @@ LL | h.finish()
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use std::hash::Hasher;
+LL + use std::hash::Hasher;
|
error[E0599]: the method `as_ref` exists for reference `&dyn Bar`, but its trait bounds were not satisfied
diff --git a/tests/ui/suggestions/invalid-bin-op.stderr b/tests/ui/suggestions/invalid-bin-op.stderr
index 08502dfeb..e291cedb8 100644
--- a/tests/ui/suggestions/invalid-bin-op.stderr
+++ b/tests/ui/suggestions/invalid-bin-op.stderr
@@ -13,7 +13,8 @@ LL | struct S<T>(T);
| ^^^^^^^^^^^ must implement `PartialEq<_>`
help: consider annotating `S<T>` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct S<T>(T);
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
diff --git a/tests/ui/suggestions/issue-107860.rs b/tests/ui/suggestions/issue-107860.rs
new file mode 100644
index 000000000..a6449cd44
--- /dev/null
+++ b/tests/ui/suggestions/issue-107860.rs
@@ -0,0 +1,6 @@
+// edition: 2021
+
+async fn str<T>(T: &str) -> &str { &str }
+//~^ ERROR mismatched types
+
+fn main() {}
diff --git a/tests/ui/suggestions/issue-107860.stderr b/tests/ui/suggestions/issue-107860.stderr
new file mode 100644
index 000000000..92e3cf8c4
--- /dev/null
+++ b/tests/ui/suggestions/issue-107860.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-107860.rs:3:36
+ |
+LL | async fn str<T>(T: &str) -> &str { &str }
+ | ^^^^ expected `&str`, found `&fn(&str) -> ... {str::<...>}`
+ |
+ = note: expected reference `&str`
+ found reference `&for<'a> fn(&'a str) -> impl Future<Output = &'a str> {str::<_>}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/issue-108470.fixed b/tests/ui/suggestions/issue-108470.fixed
new file mode 100644
index 000000000..9d15c4a8f
--- /dev/null
+++ b/tests/ui/suggestions/issue-108470.fixed
@@ -0,0 +1,29 @@
+// run-rustfix
+#![allow(dead_code)]
+
+struct Foo {
+ t: Thing
+}
+
+#[derive(Clone)]
+struct Thing;
+
+fn test_clone() {
+ let t = &Thing;
+ let _f = Foo {
+ t: t.clone() //~ ERROR mismatched types
+ };
+}
+
+struct Bar {
+ t: bool
+}
+
+fn test_is_some() {
+ let t = Option::<i32>::Some(1);
+ let _f = Bar {
+ t: t.is_some() //~ ERROR mismatched types
+ };
+}
+
+fn main() {}
diff --git a/tests/ui/suggestions/issue-108470.rs b/tests/ui/suggestions/issue-108470.rs
new file mode 100644
index 000000000..bda39085d
--- /dev/null
+++ b/tests/ui/suggestions/issue-108470.rs
@@ -0,0 +1,29 @@
+// run-rustfix
+#![allow(dead_code)]
+
+struct Foo {
+ t: Thing
+}
+
+#[derive(Clone)]
+struct Thing;
+
+fn test_clone() {
+ let t = &Thing;
+ let _f = Foo {
+ t //~ ERROR mismatched types
+ };
+}
+
+struct Bar {
+ t: bool
+}
+
+fn test_is_some() {
+ let t = Option::<i32>::Some(1);
+ let _f = Bar {
+ t //~ ERROR mismatched types
+ };
+}
+
+fn main() {}
diff --git a/tests/ui/suggestions/issue-108470.stderr b/tests/ui/suggestions/issue-108470.stderr
new file mode 100644
index 000000000..4e561eca7
--- /dev/null
+++ b/tests/ui/suggestions/issue-108470.stderr
@@ -0,0 +1,27 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-108470.rs:14:9
+ |
+LL | t
+ | ^ expected `Thing`, found `&Thing`
+ |
+help: consider using clone here
+ |
+LL | t: t.clone()
+ | +++++++++++
+
+error[E0308]: mismatched types
+ --> $DIR/issue-108470.rs:25:9
+ |
+LL | t
+ | ^ expected `bool`, found `Option<i32>`
+ |
+ = note: expected type `bool`
+ found enum `Option<i32>`
+help: use `Option::is_some` to test if the `Option` has a value
+ |
+LL | t: t.is_some()
+ | +++++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/issue-109291.rs b/tests/ui/suggestions/issue-109291.rs
new file mode 100644
index 000000000..1947b16a3
--- /dev/null
+++ b/tests/ui/suggestions/issue-109291.rs
@@ -0,0 +1,4 @@
+fn main() {
+ println!("Custom backtrace: {}", std::backtrace::Backtrace::forced_capture());
+ //~^ ERROR no function or associated item name
+}
diff --git a/tests/ui/suggestions/issue-109291.stderr b/tests/ui/suggestions/issue-109291.stderr
new file mode 100644
index 000000000..4ef5948d9
--- /dev/null
+++ b/tests/ui/suggestions/issue-109291.stderr
@@ -0,0 +1,12 @@
+error[E0599]: no function or associated item named `forced_capture` found for struct `Backtrace` in the current scope
+ --> $DIR/issue-109291.rs:2:65
+ |
+LL | println!("Custom backtrace: {}", std::backtrace::Backtrace::forced_capture());
+ | ^^^^^^^^^^^^^^
+ | |
+ | function or associated item not found in `Backtrace`
+ | help: there is an associated function with a similar name: `force_capture`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/suggestions/issue-109396.rs b/tests/ui/suggestions/issue-109396.rs
new file mode 100644
index 000000000..b6c464d45
--- /dev/null
+++ b/tests/ui/suggestions/issue-109396.rs
@@ -0,0 +1,12 @@
+fn main() {
+ {
+ let mut mutex = std::mem::zeroed(
+ //~^ ERROR this function takes 0 arguments but 4 arguments were supplied
+ file.as_raw_fd(),
+ //~^ ERROR expected value, found macro `file`
+ 0,
+ 0,
+ 0,
+ );
+ }
+}
diff --git a/tests/ui/suggestions/issue-109396.stderr b/tests/ui/suggestions/issue-109396.stderr
new file mode 100644
index 000000000..d4956872a
--- /dev/null
+++ b/tests/ui/suggestions/issue-109396.stderr
@@ -0,0 +1,34 @@
+error[E0423]: expected value, found macro `file`
+ --> $DIR/issue-109396.rs:5:13
+ |
+LL | file.as_raw_fd(),
+ | ^^^^ not a value
+
+error[E0061]: this function takes 0 arguments but 4 arguments were supplied
+ --> $DIR/issue-109396.rs:3:25
+ |
+LL | let mut mutex = std::mem::zeroed(
+ | ^^^^^^^^^^^^^^^^
+LL |
+LL | file.as_raw_fd(),
+ | ---------------- unexpected argument
+LL |
+LL | 0,
+ | - unexpected argument of type `{integer}`
+LL | 0,
+ | - unexpected argument of type `{integer}`
+LL | 0,
+ | - unexpected argument of type `{integer}`
+ |
+note: function defined here
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+help: remove the extra arguments
+ |
+LL - file.as_raw_fd(),
+LL + );
+ |
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0061, E0423.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/tests/ui/suggestions/issue-109436.rs b/tests/ui/suggestions/issue-109436.rs
new file mode 100644
index 000000000..e45ee5991
--- /dev/null
+++ b/tests/ui/suggestions/issue-109436.rs
@@ -0,0 +1,13 @@
+struct Foo;
+struct Bar;
+
+impl From<&Foo> for Bar {
+ fn from(foo: &Foo) -> Bar {
+ Bar
+ }
+}
+
+fn main() {
+ let foo = Foo;
+ let b: Bar = foo.into(); //~ ERROR E0277
+}
diff --git a/tests/ui/suggestions/issue-109436.stderr b/tests/ui/suggestions/issue-109436.stderr
new file mode 100644
index 000000000..48518b33d
--- /dev/null
+++ b/tests/ui/suggestions/issue-109436.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `Foo: Into<_>` is not satisfied
+ --> $DIR/issue-109436.rs:12:22
+ |
+LL | let b: Bar = foo.into();
+ | ^^^^ the trait `~const Into<_>` is not implemented for `Foo`
+ |
+ = note: required for `Foo` to implement `Into<Bar>`
+help: consider borrowing here
+ |
+LL | let b: Bar = (&foo).into();
+ | ++ +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/suggestions/issue-84973-blacklist.stderr b/tests/ui/suggestions/issue-84973-blacklist.stderr
index c20cc8164..4de9da89c 100644
--- a/tests/ui/suggestions/issue-84973-blacklist.stderr
+++ b/tests/ui/suggestions/issue-84973-blacklist.stderr
@@ -27,7 +27,8 @@ LL | fn f_clone<T: Clone>(t: T) {}
| ^^^^^ required by this bound in `f_clone`
help: consider annotating `S` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct S;
|
error[E0277]: `[static generator@$DIR/issue-84973-blacklist.rs:17:13: 17:22]` cannot be unpinned
@@ -38,7 +39,8 @@ LL | f_unpin(static || { yield; });
| |
| required by a bound introduced by this call
|
- = note: consider using `Box::pin`
+ = note: consider using the `pin!` macro
+ consider using `Box::pin` if you need to access the pinned value outside of the current scope
note: required by a bound in `f_unpin`
--> $DIR/issue-84973-blacklist.rs:8:15
|
diff --git a/tests/ui/suggestions/issue-97760.stderr b/tests/ui/suggestions/issue-97760.stderr
index bbcc3693f..5415c247c 100644
--- a/tests/ui/suggestions/issue-97760.stderr
+++ b/tests/ui/suggestions/issue-97760.stderr
@@ -1,8 +1,8 @@
error[E0277]: `<impl IntoIterator as IntoIterator>::Item` doesn't implement `std::fmt::Display`
- --> $DIR/issue-97760.rs:4:20
+ --> $DIR/issue-97760.rs:4:19
|
LL | println!("{x}");
- | ^ `<impl IntoIterator as IntoIterator>::Item` cannot be formatted with the default formatter
+ | ^^^ `<impl IntoIterator as IntoIterator>::Item` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `<impl IntoIterator as IntoIterator>::Item`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed
index 304360d48..47b35b412 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed
@@ -7,7 +7,7 @@ pub struct Vector2<T: Debug + Copy + Clone>{
pub y: T
}
-#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented for this type
+#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented for this type
pub struct AABB<K: Copy + Debug>{
pub loc: Vector2<K>,
pub size: Vector2<K>
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs
index 14e1fbb33..771e9105c 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.rs
@@ -7,7 +7,7 @@ pub struct Vector2<T: Debug + Copy + Clone>{
pub y: T
}
-#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented for this type
+#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented for this type
pub struct AABB<K: Copy>{
pub loc: Vector2<K>,
pub size: Vector2<K>
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr
index faf730a5c..09696e061 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/missing-bound-in-derive-copy-impl-3.rs:10:17
|
LL | #[derive(Debug, Copy, Clone)]
@@ -6,16 +6,12 @@ LL | #[derive(Debug, Copy, Clone)]
LL | pub struct AABB<K: Copy>{
LL | pub loc: Vector2<K>,
| ------------------- this field does not implement `Copy`
-LL | pub size: Vector2<K>
- | -------------------- this field does not implement `Copy`
|
note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
--> $DIR/missing-bound-in-derive-copy-impl-3.rs:12:14
|
LL | pub loc: Vector2<K>,
| ^^^^^^^^^^
-LL | pub size: Vector2<K>
- | ^^^^^^^^^^
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
|
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs
index 52163bddd..9c7b7ba09 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.rs
@@ -6,7 +6,7 @@ pub struct Vector2<T: Debug + Copy + Clone>{
pub y: T
}
-#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented for this type
+#[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented for this type
pub struct AABB<K>{
pub loc: Vector2<K>,
pub size: Vector2<K>
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
index 11bc54099..8585fe47b 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/missing-bound-in-derive-copy-impl.rs:9:17
|
LL | #[derive(Debug, Copy, Clone)]
@@ -6,16 +6,12 @@ LL | #[derive(Debug, Copy, Clone)]
LL | pub struct AABB<K>{
LL | pub loc: Vector2<K>,
| ------------------- this field does not implement `Copy`
-LL | pub size: Vector2<K>
- | -------------------- this field does not implement `Copy`
|
note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
--> $DIR/missing-bound-in-derive-copy-impl.rs:11:14
|
LL | pub loc: Vector2<K>,
| ^^^^^^^^^^
-LL | pub size: Vector2<K>
- | ^^^^^^^^^^
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `K`
|
diff --git a/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed
index 691e7553a..f32c61a99 100644
--- a/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed
+++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed
@@ -14,6 +14,6 @@ impl<T: std::fmt::Display> Clone for OnlyCopyIfDisplay<T> {
impl<T: std::fmt::Display> Copy for OnlyCopyIfDisplay<T> {}
impl<S: std::fmt::Display> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
fn main() {}
diff --git a/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs
index e3185e7ef..d7725f4a3 100644
--- a/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs
+++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs
@@ -14,6 +14,6 @@ impl<T: std::fmt::Display> Clone for OnlyCopyIfDisplay<T> {
impl<T: std::fmt::Display> Copy for OnlyCopyIfDisplay<T> {}
impl<S> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
fn main() {}
diff --git a/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr
index 9e6f0d9eb..856d8db38 100644
--- a/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr
+++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/missing-bound-in-manual-copy-impl-2.rs:16:18
|
LL | struct Wrapper<T>(T);
diff --git a/tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed
index 32a7215c5..1139b3153 100644
--- a/tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed
+++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.fixed
@@ -4,6 +4,6 @@
struct Wrapper<T>(T);
impl<S: Copy> Copy for Wrapper<S> {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
fn main() {}
diff --git a/tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs
index c688f4d41..19549248e 100644
--- a/tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs
+++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.rs
@@ -4,6 +4,6 @@
struct Wrapper<T>(T);
impl<S> Copy for Wrapper<S> {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
fn main() {}
diff --git a/tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr
index fe2d133c8..ec3e4f23a 100644
--- a/tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr
+++ b/tests/ui/suggestions/missing-bound-in-manual-copy-impl.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/missing-bound-in-manual-copy-impl.rs:6:18
|
LL | struct Wrapper<T>(T);
diff --git a/tests/ui/suggestions/multiline-multipart-suggestion.rs b/tests/ui/suggestions/multiline-multipart-suggestion.rs
new file mode 100644
index 000000000..77d0322d0
--- /dev/null
+++ b/tests/ui/suggestions/multiline-multipart-suggestion.rs
@@ -0,0 +1,19 @@
+// compile-flags: --error-format=human --color=always
+// ignore-windows
+
+fn short(foo_bar: &Vec<&i32>) -> &i32 { //~ ERROR missing lifetime specifier
+ &12
+}
+
+fn long( //~ ERROR missing lifetime specifier
+ foo_bar: &Vec<&i32>,
+ something_very_long_so_that_the_line_will_wrap_around__________: i32,
+) -> &i32 {
+ &12
+}
+
+fn long2( //~ ERROR missing lifetime specifier
+ foo_bar: &Vec<&i32>) -> &i32 {
+ &12
+}
+fn main() {}
diff --git a/tests/ui/suggestions/multiline-multipart-suggestion.stderr b/tests/ui/suggestions/multiline-multipart-suggestion.stderr
new file mode 100644
index 000000000..045a86b4f
--- /dev/null
+++ b/tests/ui/suggestions/multiline-multipart-suggestion.stderr
@@ -0,0 +1,46 @@
+error[E0106]: missing lifetime specifier
+ --> $DIR/multiline-multipart-suggestion.rs:4:34
+ |
+LL | fn short(foo_bar: &Vec<&i32>) -> &i32 {
+ |  ---------- ^ expected named lifetime parameter
+ |
+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from
+help: consider introducing a named lifetime parameter
+ |
+LL | fn short<'a>(foo_bar: &'a Vec<&'a i32>) -> &'a i32 {
+ | ++++ ++ ++ ++
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/multiline-multipart-suggestion.rs:11:6
+ |
+LL |  foo_bar: &Vec<&i32>,
+ |  ----------
+LL |  something_very_long_so_that_the_line_will_wrap_around__________: i32,
+LL | ) -> &i32 {
+ |  ^ expected named lifetime parameter
+ |
+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from
+help: consider introducing a named lifetime parameter
+ |
+LL ~ fn long<'a>(
+LL ~  foo_bar: &'a Vec<&'a i32>,
+LL |  something_very_long_so_that_the_line_will_wrap_around__________: i32,
+LL ~ ) -> &'a i32 {
+ |
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/multiline-multipart-suggestion.rs:16:29
+ |
+LL |  foo_bar: &Vec<&i32>) -> &i32 {
+ |  ---------- ^ expected named lifetime parameter
+ |
+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from
+help: consider introducing a named lifetime parameter
+ |
+LL ~ fn long2<'a>(
+LL ~  foo_bar: &'a Vec<&'a i32>) -> &'a i32 {
+ |
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr b/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr
index 6910b77d9..94710f450 100644
--- a/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr
+++ b/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr
@@ -21,18 +21,22 @@ note: required by a bound in `BufWriter`
--> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn Write>`, but its trait bounds were not satisfied
- --> $DIR/mut-borrow-needed-by-trait.rs:21:5
+ --> $DIR/mut-borrow-needed-by-trait.rs:21:14
|
LL | writeln!(fp, "hello world").unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn Write>` due to unsatisfied trait bounds
+ | ---------^^---------------- method cannot be called on `BufWriter<&dyn Write>` due to unsatisfied trait bounds
--> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
|
= note: doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write`
|
+note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
+ --> $DIR/mut-borrow-needed-by-trait.rs:21:14
+ |
+LL | writeln!(fp, "hello world").unwrap();
+ | ^^
= note: the following trait bounds were not satisfied:
`&dyn std::io::Write: std::io::Write`
which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
- = note: this error originates in the macro `writeln` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors
diff --git a/tests/ui/suggestions/no-extern-crate-in-type.stderr b/tests/ui/suggestions/no-extern-crate-in-type.stderr
index 876eef2b6..68100e56c 100644
--- a/tests/ui/suggestions/no-extern-crate-in-type.stderr
+++ b/tests/ui/suggestions/no-extern-crate-in-type.stderr
@@ -6,7 +6,7 @@ LL | type Output = Option<Foo>;
|
help: consider importing this struct
|
-LL | use foo::Foo;
+LL + use foo::Foo;
|
error: aborting due to previous error
diff --git a/tests/ui/suggestions/raw-name-use-suggestion.stderr b/tests/ui/suggestions/raw-name-use-suggestion.stderr
index 95c26b9ad..fb070ffc3 100644
--- a/tests/ui/suggestions/raw-name-use-suggestion.stderr
+++ b/tests/ui/suggestions/raw-name-use-suggestion.stderr
@@ -28,7 +28,7 @@ LL | r#break();
|
help: consider importing this function
|
-LL | use foo::r#break;
+LL + use foo::r#break;
|
error: aborting due to 3 previous errors
diff --git a/tests/ui/suggestions/ref-pattern-binding.stderr b/tests/ui/suggestions/ref-pattern-binding.stderr
index 7b1942593..69ce5d440 100644
--- a/tests/ui/suggestions/ref-pattern-binding.stderr
+++ b/tests/ui/suggestions/ref-pattern-binding.stderr
@@ -2,9 +2,8 @@ error: borrow of moved value
--> $DIR/ref-pattern-binding.rs:10:9
|
LL | let _moved @ ref _from = String::from("foo");
- | ------^^^---------
- | | |
- | | value borrowed here after move
+ | ^^^^^^ --------- value borrowed here after move
+ | |
| value moved into `_moved` here
| move occurs because `_moved` has type `String` which does not implement the `Copy` trait
|
@@ -17,27 +16,24 @@ error: cannot move out of value because it is borrowed
--> $DIR/ref-pattern-binding.rs:11:9
|
LL | let ref _moved @ _from = String::from("foo");
- | ----------^^^-----
- | | |
- | | value is moved into `_from` here
+ | ^^^^^^^^^^ ----- value is moved into `_from` here
+ | |
| value is borrowed by `_moved` here
error: cannot move out of value because it is borrowed
--> $DIR/ref-pattern-binding.rs:15:9
|
LL | let ref _moved @ S { f } = S { f: String::from("foo") };
- | ----------^^^^^^^-^^
- | | |
- | | value is moved into `f` here
+ | ^^^^^^^^^^ - value is moved into `f` here
+ | |
| value is borrowed by `_moved` here
error: borrow of moved value
--> $DIR/ref-pattern-binding.rs:18:9
|
LL | let _moved @ S { ref f } = S { f: String::from("foo") };
- | ------^^^^^^^-----^^
- | | |
- | | value borrowed here after move
+ | ^^^^^^ ----- value borrowed here after move
+ | |
| value moved into `_moved` here
| move occurs because `_moved` has type `S` which does not implement the `Copy` trait
|
diff --git a/tests/ui/suggestions/suggest-pin-macro.rs b/tests/ui/suggestions/suggest-pin-macro.rs
new file mode 100644
index 000000000..f5b962159
--- /dev/null
+++ b/tests/ui/suggestions/suggest-pin-macro.rs
@@ -0,0 +1,23 @@
+use std::pin::Pin;
+use std::marker::PhantomPinned;
+
+#[derive(Debug)]
+struct Test {
+ _marker: PhantomPinned,
+}
+impl Test {
+ fn new() -> Self {
+ Test {
+ _marker: PhantomPinned, // This makes our type `!Unpin`
+ }
+ }
+}
+
+fn dummy(_: &mut Test) {}
+
+pub fn main() {
+ let mut test1 = Test::new();
+ let mut test1 = unsafe { Pin::new_unchecked(&mut test1) };
+
+ dummy(test1.get_mut()); //~ ERROR E0277
+}
diff --git a/tests/ui/suggestions/suggest-pin-macro.stderr b/tests/ui/suggestions/suggest-pin-macro.stderr
new file mode 100644
index 000000000..1220cf650
--- /dev/null
+++ b/tests/ui/suggestions/suggest-pin-macro.stderr
@@ -0,0 +1,19 @@
+error[E0277]: `PhantomPinned` cannot be unpinned
+ --> $DIR/suggest-pin-macro.rs:22:17
+ |
+LL | dummy(test1.get_mut());
+ | ^^^^^^^ within `Test`, the trait `Unpin` is not implemented for `PhantomPinned`
+ |
+ = note: consider using the `pin!` macro
+ consider using `Box::pin` if you need to access the pinned value outside of the current scope
+note: required because it appears within the type `Test`
+ --> $DIR/suggest-pin-macro.rs:5:8
+ |
+LL | struct Test {
+ | ^^^^
+note: required by a bound in `Pin::<&'a mut T>::get_mut`
+ --> $SRC_DIR/core/src/pin.rs:LL:COL
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/suggestions/suggest-ret-on-async-w-late.rs b/tests/ui/suggestions/suggest-ret-on-async-w-late.rs
new file mode 100644
index 000000000..459b94f94
--- /dev/null
+++ b/tests/ui/suggestions/suggest-ret-on-async-w-late.rs
@@ -0,0 +1,11 @@
+// edition: 2021
+
+// Make sure we don't ICE when suggesting a return type
+// for an async fn that has late-bound vars...
+
+async fn ice(_: &i32) {
+ true
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/tests/ui/suggestions/suggest-ret-on-async-w-late.stderr b/tests/ui/suggestions/suggest-ret-on-async-w-late.stderr
new file mode 100644
index 000000000..bff864b22
--- /dev/null
+++ b/tests/ui/suggestions/suggest-ret-on-async-w-late.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/suggest-ret-on-async-w-late.rs:7:5
+ |
+LL | async fn ice(_: &i32) {
+ | - help: try adding a return type: `-> bool`
+LL | true
+ | ^^^^ expected `()`, found `bool`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/suggest-tryinto-edition-change.stderr b/tests/ui/suggestions/suggest-tryinto-edition-change.stderr
index 018083f9e..671f5efdd 100644
--- a/tests/ui/suggestions/suggest-tryinto-edition-change.stderr
+++ b/tests/ui/suggestions/suggest-tryinto-edition-change.stderr
@@ -8,9 +8,9 @@ LL | let _i: i16 = TryFrom::try_from(0_i32).unwrap();
= note: 'core::convert::TryFrom' is included in the prelude starting in Edition 2021
help: consider importing one of these items
|
-LL | use core::convert::TryFrom;
+LL + use core::convert::TryFrom;
|
-LL | use std::convert::TryFrom;
+LL + use std::convert::TryFrom;
|
error[E0433]: failed to resolve: use of undeclared type `TryInto`
@@ -23,9 +23,9 @@ LL | let _i: i16 = TryInto::try_into(0_i32).unwrap();
= note: 'core::convert::TryInto' is included in the prelude starting in Edition 2021
help: consider importing one of these items
|
-LL | use core::convert::TryInto;
+LL + use core::convert::TryInto;
|
-LL | use std::convert::TryInto;
+LL + use std::convert::TryInto;
|
error[E0433]: failed to resolve: use of undeclared type `FromIterator`
@@ -42,9 +42,9 @@ LL | let _v: Vec<_> = IntoIterator::from_iter(&[1]);
| ~~~~~~~~~~~~
help: consider importing one of these items
|
-LL | use core::iter::FromIterator;
+LL + use core::iter::FromIterator;
|
-LL | use std::iter::FromIterator;
+LL + use std::iter::FromIterator;
|
error[E0599]: no method named `try_into` found for type `i32` in the current scope
@@ -60,7 +60,7 @@ LL | let _i: i16 = 0_i32.try_into().unwrap();
= note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use std::convert::TryInto;
+LL + use std::convert::TryInto;
|
error: aborting due to 4 previous errors
diff --git a/tests/ui/suggestions/use-placement-resolve.stderr b/tests/ui/suggestions/use-placement-resolve.stderr
index 9da9e8e27..77724e7e2 100644
--- a/tests/ui/suggestions/use-placement-resolve.stderr
+++ b/tests/ui/suggestions/use-placement-resolve.stderr
@@ -6,7 +6,7 @@ LL | fn foobar<T: Debug>(x: T) {}
|
help: consider importing this trait instead
|
-LL | use std::fmt::Debug;
+LL + use std::fmt::Debug;
|
error: aborting due to previous error
diff --git a/tests/ui/suggestions/use-placement-typeck.stderr b/tests/ui/suggestions/use-placement-typeck.stderr
index 3b2749773..e900e12b7 100644
--- a/tests/ui/suggestions/use-placement-typeck.stderr
+++ b/tests/ui/suggestions/use-placement-typeck.stderr
@@ -13,7 +13,7 @@ LL | pub struct S;
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use m::Foo;
+LL + use m::Foo;
|
error: aborting due to previous error
diff --git a/tests/ui/symbol-names/basic.legacy.stderr b/tests/ui/symbol-names/basic.legacy.stderr
index fe490a600..c1cbefac8 100644
--- a/tests/ui/symbol-names/basic.legacy.stderr
+++ b/tests/ui/symbol-names/basic.legacy.stderr
@@ -1,10 +1,10 @@
-error: symbol-name(_ZN5basic4main17he9f658e438f1cac0E)
+error: symbol-name(_ZN5basic4main17h6fc0c8d27b1a289fE)
--> $DIR/basic.rs:8:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(basic::main::he9f658e438f1cac0)
+error: demangling(basic::main::h6fc0c8d27b1a289f)
--> $DIR/basic.rs:8:1
|
LL | #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/basic.v0.stderr b/tests/ui/symbol-names/basic.v0.stderr
index 1f0278136..17c6d0ce7 100644
--- a/tests/ui/symbol-names/basic.v0.stderr
+++ b/tests/ui/symbol-names/basic.v0.stderr
@@ -4,7 +4,7 @@ error: symbol-name(_RNvCsCRATE_HASH_5basic4main)
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(basic[b751b4a00e2291d9]::main)
+error: demangling(basic[a90d658f4748b9d1]::main)
--> $DIR/basic.rs:8:1
|
LL | #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/foreign-types.stderr b/tests/ui/symbol-names/foreign-types.stderr
index d6ee388dd..9c8633742 100644
--- a/tests/ui/symbol-names/foreign-types.stderr
+++ b/tests/ui/symbol-names/foreign-types.stderr
@@ -4,7 +4,7 @@ error: symbol-name(_RMCsCRATE_HASH_13foreign_typesINtB<REF>_5CheckNvB<REF>_11For
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<foreign_types[49eeeb51f120b431]::Check<foreign_types[49eeeb51f120b431]::ForeignType>>)
+error: demangling(<foreign_types[fcdd87e190ad88e3]::Check<foreign_types[fcdd87e190ad88e3]::ForeignType>>)
--> $DIR/foreign-types.rs:13:1
|
LL | #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/impl1.v0.stderr b/tests/ui/symbol-names/impl1.v0.stderr
index 33caad71f..a7cc5fc8e 100644
--- a/tests/ui/symbol-names/impl1.v0.stderr
+++ b/tests/ui/symbol-names/impl1.v0.stderr
@@ -4,7 +4,7 @@ error: symbol-name(_RNvMNtCsCRATE_HASH_5impl13fooNtB<REF>_3Foo3bar)
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<impl1[2c09c4f1c7c8e90c]::foo::Foo>::bar)
+error: demangling(<impl1[d5591eb39db23cbb]::foo::Foo>::bar)
--> $DIR/impl1.rs:14:9
|
LL | #[rustc_symbol_name]
@@ -28,7 +28,7 @@ error: symbol-name(_RNvMNtCsCRATE_HASH_5impl13barNtNtB<REF>_3foo3Foo3baz)
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<impl1[2c09c4f1c7c8e90c]::foo::Foo>::baz)
+error: demangling(<impl1[d5591eb39db23cbb]::foo::Foo>::baz)
--> $DIR/impl1.rs:32:9
|
LL | #[rustc_symbol_name]
@@ -52,7 +52,7 @@ error: symbol-name(_RNvXNCNvCsCRATE_HASH_5impl14mains_0ARDNtB<REF>_3Foop5AssocFG
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<[&dyn impl1[2c09c4f1c7c8e90c]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[2c09c4f1c7c8e90c]::AutoTrait; 3usize] as impl1[2c09c4f1c7c8e90c]::main::{closure#1}::Bar>::method)
+error: demangling(<[&dyn impl1[d5591eb39db23cbb]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[d5591eb39db23cbb]::AutoTrait; 3usize] as impl1[d5591eb39db23cbb]::main::{closure#1}::Bar>::method)
--> $DIR/impl1.rs:62:13
|
LL | #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/issue-60925.legacy.stderr b/tests/ui/symbol-names/issue-60925.legacy.stderr
index 29b42f48d..7dd68e6e3 100644
--- a/tests/ui/symbol-names/issue-60925.legacy.stderr
+++ b/tests/ui/symbol-names/issue-60925.legacy.stderr
@@ -1,10 +1,10 @@
-error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h13209029be24b923E)
+error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17hab58a402db4ebf3aE)
--> $DIR/issue-60925.rs:21:9
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::h13209029be24b923)
+error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::hab58a402db4ebf3a)
--> $DIR/issue-60925.rs:21:9
|
LL | #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/issue-60925.v0.stderr b/tests/ui/symbol-names/issue-60925.v0.stderr
index 408c957c6..77449becc 100644
--- a/tests/ui/symbol-names/issue-60925.v0.stderr
+++ b/tests/ui/symbol-names/issue-60925.v0.stderr
@@ -4,7 +4,7 @@ error: symbol-name(_RNvMNtCsCRATE_HASH_11issue_609253fooINtB<REF>_3FooNtNtB<REF>
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<issue_60925[775bc577f14ef671]::foo::Foo<issue_60925[775bc577f14ef671]::llvm::Foo>>::foo)
+error: demangling(<issue_60925[294a1bee3c0c9a2f]::foo::Foo<issue_60925[294a1bee3c0c9a2f]::llvm::Foo>>::foo)
--> $DIR/issue-60925.rs:21:9
|
LL | #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/issue-75326.v0.stderr b/tests/ui/symbol-names/issue-75326.v0.stderr
index 3d7803a0c..fb742f5e4 100644
--- a/tests/ui/symbol-names/issue-75326.v0.stderr
+++ b/tests/ui/symbol-names/issue-75326.v0.stderr
@@ -4,7 +4,7 @@ error: symbol-name(_RNvXINICsCRATE_HASH_11issue_75326s_0pppEINtB<REF>_3FooppENtB
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<issue_75326[e8e253d78520f2a2]::Foo<_, _> as issue_75326[e8e253d78520f2a2]::Iterator2>::next)
+error: demangling(<issue_75326[189ebc60e18860d7]::Foo<_, _> as issue_75326[189ebc60e18860d7]::Iterator2>::next)
--> $DIR/issue-75326.rs:41:5
|
LL | #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/trait-objects.v0.stderr b/tests/ui/symbol-names/trait-objects.v0.stderr
index 47192ce5b..84f2bce66 100644
--- a/tests/ui/symbol-names/trait-objects.v0.stderr
+++ b/tests/ui/symbol-names/trait-objects.v0.stderr
@@ -4,7 +4,7 @@ error: symbol-name(_RNvXCsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4cor
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> as trait_objects[7260a56bea9f357b]::Bar>::method)
+error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> as trait_objects[3c073c57f94bedc2]::Bar>::method)
--> $DIR/trait-objects.rs:15:5
|
LL | #[rustc_symbol_name]
@@ -22,7 +22,7 @@ error: symbol-name(_RNvXs_CsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4c
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[7260a56bea9f357b]::Foo>::method)
+error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[3c073c57f94bedc2]::Foo>::method)
--> $DIR/trait-objects.rs:27:5
|
LL | #[rustc_symbol_name]
@@ -40,7 +40,7 @@ error: symbol-name(_RNvXs0_CsCRATE_HASH_13trait_objectsRDG_INtNtNtCsCRATE_HASH_4
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[7260a56bea9f357b]::Baz>::method)
+error: demangling(<&dyn for<'a> core[HASH]::ops::function::FnMut<(&'a u8,), Output = ()> + core[HASH]::marker::Send as trait_objects[3c073c57f94bedc2]::Baz>::method)
--> $DIR/trait-objects.rs:39:5
|
LL | #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/x86-stdcall.rs b/tests/ui/symbol-names/x86-stdcall.rs
index 9948488c0..43c086dc6 100644
--- a/tests/ui/symbol-names/x86-stdcall.rs
+++ b/tests/ui/symbol-names/x86-stdcall.rs
@@ -1,5 +1,7 @@
// build-pass
-// only-x86-windows
+// only-x86
+// only-windows
+// ignore-gnu - vectorcall is not supported by GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89485
#![crate_type = "cdylib"]
#![feature(abi_vectorcall)]
diff --git a/tests/ui/sync/suggest-once-cell.rs b/tests/ui/sync/suggest-once-cell.rs
index 82fca45b1..14f40ad87 100644
--- a/tests/ui/sync/suggest-once-cell.rs
+++ b/tests/ui/sync/suggest-once-cell.rs
@@ -1,5 +1,3 @@
-#![feature(once_cell)]
-
fn require_sync<T: Sync>() {}
//~^ NOTE required by this bound in `require_sync`
//~| NOTE required by a bound in `require_sync`
diff --git a/tests/ui/sync/suggest-once-cell.stderr b/tests/ui/sync/suggest-once-cell.stderr
index fadf05374..20242f4b6 100644
--- a/tests/ui/sync/suggest-once-cell.stderr
+++ b/tests/ui/sync/suggest-once-cell.stderr
@@ -1,5 +1,5 @@
error[E0277]: `OnceCell<()>` cannot be shared between threads safely
- --> $DIR/suggest-once-cell.rs:8:20
+ --> $DIR/suggest-once-cell.rs:6:20
|
LL | require_sync::<std::cell::OnceCell<()>>();
| ^^^^^^^^^^^^^^^^^^^^^^^ `OnceCell<()>` cannot be shared between threads safely
@@ -7,7 +7,7 @@ LL | require_sync::<std::cell::OnceCell<()>>();
= help: the trait `Sync` is not implemented for `OnceCell<()>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::OnceLock` instead
note: required by a bound in `require_sync`
- --> $DIR/suggest-once-cell.rs:3:20
+ --> $DIR/suggest-once-cell.rs:1:20
|
LL | fn require_sync<T: Sync>() {}
| ^^^^ required by this bound in `require_sync`
diff --git a/tests/ui/sync/suggest-ref-cell.rs b/tests/ui/sync/suggest-ref-cell.rs
index 6b972ae09..093a4999c 100644
--- a/tests/ui/sync/suggest-ref-cell.rs
+++ b/tests/ui/sync/suggest-ref-cell.rs
@@ -1,5 +1,3 @@
-#![feature(once_cell)]
-
fn require_sync<T: Sync>() {}
//~^ NOTE required by this bound in `require_sync`
//~| NOTE required by a bound in `require_sync`
diff --git a/tests/ui/sync/suggest-ref-cell.stderr b/tests/ui/sync/suggest-ref-cell.stderr
index 9e8b8fcb4..ca3ae77b1 100644
--- a/tests/ui/sync/suggest-ref-cell.stderr
+++ b/tests/ui/sync/suggest-ref-cell.stderr
@@ -1,5 +1,5 @@
error[E0277]: `RefCell<()>` cannot be shared between threads safely
- --> $DIR/suggest-ref-cell.rs:8:20
+ --> $DIR/suggest-ref-cell.rs:6:20
|
LL | require_sync::<std::cell::RefCell<()>>();
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<()>` cannot be shared between threads safely
@@ -7,7 +7,7 @@ LL | require_sync::<std::cell::RefCell<()>>();
= help: the trait `Sync` is not implemented for `RefCell<()>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
note: required by a bound in `require_sync`
- --> $DIR/suggest-ref-cell.rs:3:20
+ --> $DIR/suggest-ref-cell.rs:1:20
|
LL | fn require_sync<T: Sync>() {}
| ^^^^ required by this bound in `require_sync`
diff --git a/tests/ui/target-feature/gate.rs b/tests/ui/target-feature/gate.rs
index 2382c98f8..2eea087c7 100644
--- a/tests/ui/target-feature/gate.rs
+++ b/tests/ui/target-feature/gate.rs
@@ -6,7 +6,6 @@
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
-// ignore-powerpc64le
// ignore-riscv64
// ignore-sparc
// ignore-sparc64
diff --git a/tests/ui/target-feature/gate.stderr b/tests/ui/target-feature/gate.stderr
index ee542b60a..2d6abcc0a 100644
--- a/tests/ui/target-feature/gate.stderr
+++ b/tests/ui/target-feature/gate.stderr
@@ -1,5 +1,5 @@
error[E0658]: the target feature `avx512bw` is currently unstable
- --> $DIR/gate.rs:32:18
+ --> $DIR/gate.rs:31:18
|
LL | #[target_feature(enable = "avx512bw")]
| ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/target-feature/invalid-attribute.rs b/tests/ui/target-feature/invalid-attribute.rs
index ad1b6e96b..b59ed076f 100644
--- a/tests/ui/target-feature/invalid-attribute.rs
+++ b/tests/ui/target-feature/invalid-attribute.rs
@@ -6,7 +6,6 @@
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
-// ignore-powerpc64le
// ignore-riscv64
// ignore-s390x
// ignore-sparc
@@ -14,6 +13,21 @@
#![warn(unused_attributes)]
+#[target_feature(enable = "sse2")]
+//~^ ERROR attribute should be applied to a function
+extern crate alloc;
+//~^ NOTE not a function
+
+#[target_feature(enable = "sse2")]
+//~^ ERROR attribute should be applied to a function
+use alloc::alloc::alloc;
+//~^ NOTE not a function
+
+#[target_feature(enable = "sse2")]
+//~^ ERROR attribute should be applied to a function
+extern "Rust" {}
+//~^ NOTE not a function
+
#[target_feature = "+sse2"]
//~^ ERROR malformed `target_feature` attribute
#[target_feature(enable = "foo")]
@@ -61,6 +75,11 @@ union Qux {
#[target_feature(enable = "sse2")]
//~^ ERROR attribute should be applied to a function
+type Uwu = ();
+//~^ NOTE not a function
+
+#[target_feature(enable = "sse2")]
+//~^ ERROR attribute should be applied to a function
trait Baz {}
//~^ NOTE not a function
@@ -69,6 +88,21 @@ trait Baz {}
#[target_feature(enable = "sse2")]
unsafe fn test() {}
+#[target_feature(enable = "sse2")]
+//~^ ERROR attribute should be applied to a function
+static A: () = ();
+//~^ NOTE not a function
+
+#[target_feature(enable = "sse2")]
+//~^ ERROR attribute should be applied to a function
+impl Quux for u8 {}
+//~^ NOTE not a function
+
+#[target_feature(enable = "sse2")]
+//~^ ERROR attribute should be applied to a function
+impl Foo {}
+//~^ NOTE not a function
+
trait Quux {
fn foo();
}
diff --git a/tests/ui/target-feature/invalid-attribute.stderr b/tests/ui/target-feature/invalid-attribute.stderr
index a2adfc67f..c36392d43 100644
--- a/tests/ui/target-feature/invalid-attribute.stderr
+++ b/tests/ui/target-feature/invalid-attribute.stderr
@@ -1,11 +1,38 @@
error: malformed `target_feature` attribute input
- --> $DIR/invalid-attribute.rs:17:1
+ --> $DIR/invalid-attribute.rs:31:1
|
LL | #[target_feature = "+sse2"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[target_feature(enable = "name")]`
error: attribute should be applied to a function definition
- --> $DIR/invalid-attribute.rs:34:1
+ --> $DIR/invalid-attribute.rs:16:1
+ |
+LL | #[target_feature(enable = "sse2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | extern crate alloc;
+ | ------------------- not a function definition
+
+error: attribute should be applied to a function definition
+ --> $DIR/invalid-attribute.rs:21:1
+ |
+LL | #[target_feature(enable = "sse2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | use alloc::alloc::alloc;
+ | ------------------------ not a function definition
+
+error: attribute should be applied to a function definition
+ --> $DIR/invalid-attribute.rs:26:1
+ |
+LL | #[target_feature(enable = "sse2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | extern "Rust" {}
+ | ---------------- not a function definition
+
+error: attribute should be applied to a function definition
+ --> $DIR/invalid-attribute.rs:48:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,7 +41,7 @@ LL | mod another {}
| -------------- not a function definition
error: attribute should be applied to a function definition
- --> $DIR/invalid-attribute.rs:39:1
+ --> $DIR/invalid-attribute.rs:53:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +50,7 @@ LL | const FOO: usize = 7;
| --------------------- not a function definition
error: attribute should be applied to a function definition
- --> $DIR/invalid-attribute.rs:44:1
+ --> $DIR/invalid-attribute.rs:58:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +59,7 @@ LL | struct Foo;
| ----------- not a function definition
error: attribute should be applied to a function definition
- --> $DIR/invalid-attribute.rs:49:1
+ --> $DIR/invalid-attribute.rs:63:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -41,7 +68,7 @@ LL | enum Bar {}
| ----------- not a function definition
error: attribute should be applied to a function definition
- --> $DIR/invalid-attribute.rs:54:1
+ --> $DIR/invalid-attribute.rs:68:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,7 +81,16 @@ LL | | }
| |_- not a function definition
error: attribute should be applied to a function definition
- --> $DIR/invalid-attribute.rs:62:1
+ --> $DIR/invalid-attribute.rs:76:1
+ |
+LL | #[target_feature(enable = "sse2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | type Uwu = ();
+ | -------------- not a function definition
+
+error: attribute should be applied to a function definition
+ --> $DIR/invalid-attribute.rs:81:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +99,34 @@ LL | trait Baz {}
| ------------ not a function definition
error: attribute should be applied to a function definition
- --> $DIR/invalid-attribute.rs:85:5
+ --> $DIR/invalid-attribute.rs:91:1
+ |
+LL | #[target_feature(enable = "sse2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | static A: () = ();
+ | ------------------ not a function definition
+
+error: attribute should be applied to a function definition
+ --> $DIR/invalid-attribute.rs:96:1
+ |
+LL | #[target_feature(enable = "sse2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | impl Quux for u8 {}
+ | ------------------- not a function definition
+
+error: attribute should be applied to a function definition
+ --> $DIR/invalid-attribute.rs:101:1
+ |
+LL | #[target_feature(enable = "sse2")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | impl Foo {}
+ | ----------- not a function definition
+
+error: attribute should be applied to a function definition
+ --> $DIR/invalid-attribute.rs:119:5
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -75,7 +138,7 @@ LL | | }
| |_____- not a function definition
error: attribute should be applied to a function definition
- --> $DIR/invalid-attribute.rs:93:5
+ --> $DIR/invalid-attribute.rs:127:5
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,25 +147,25 @@ LL | || {};
| ----- not a function definition
error: the feature named `foo` is not valid for this target
- --> $DIR/invalid-attribute.rs:19:18
+ --> $DIR/invalid-attribute.rs:33:18
|
LL | #[target_feature(enable = "foo")]
| ^^^^^^^^^^^^^^ `foo` is not valid for this target
error: malformed `target_feature` attribute input
- --> $DIR/invalid-attribute.rs:22:18
+ --> $DIR/invalid-attribute.rs:36:18
|
LL | #[target_feature(bar)]
| ^^^ help: must be of the form: `enable = ".."`
error: malformed `target_feature` attribute input
- --> $DIR/invalid-attribute.rs:24:18
+ --> $DIR/invalid-attribute.rs:38:18
|
LL | #[target_feature(disable = "baz")]
| ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."`
error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
- --> $DIR/invalid-attribute.rs:28:1
+ --> $DIR/invalid-attribute.rs:42:1
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,13 +177,13 @@ LL | fn bar() {}
= help: add `#![feature(target_feature_11)]` to the crate attributes to enable
error: cannot use `#[inline(always)]` with `#[target_feature]`
- --> $DIR/invalid-attribute.rs:67:1
+ --> $DIR/invalid-attribute.rs:86:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
- --> $DIR/invalid-attribute.rs:77:5
+ --> $DIR/invalid-attribute.rs:111:5
|
LL | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -131,6 +194,6 @@ LL | fn foo() {}
= note: see issue #69098 <https://github.com/rust-lang/rust/issues/69098> for more information
= help: add `#![feature(target_feature_11)]` to the crate attributes to enable
-error: aborting due to 15 previous errors
+error: aborting due to 22 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/test-attrs/custom-test-frameworks/issue-107454.rs b/tests/ui/test-attrs/custom-test-frameworks/issue-107454.rs
new file mode 100644
index 000000000..2bb133e8b
--- /dev/null
+++ b/tests/ui/test-attrs/custom-test-frameworks/issue-107454.rs
@@ -0,0 +1,10 @@
+// compile-flags: --test
+
+#![feature(custom_test_frameworks)]
+#![deny(unnameable_test_items)]
+
+fn foo() {
+ #[test_case]
+ //~^ ERROR cannot test inner items [unnameable_test_items]
+ fn test2() {}
+}
diff --git a/tests/ui/test-attrs/custom-test-frameworks/issue-107454.stderr b/tests/ui/test-attrs/custom-test-frameworks/issue-107454.stderr
new file mode 100644
index 000000000..bd604afb7
--- /dev/null
+++ b/tests/ui/test-attrs/custom-test-frameworks/issue-107454.stderr
@@ -0,0 +1,15 @@
+error: cannot test inner items
+ --> $DIR/issue-107454.rs:7:5
+ |
+LL | #[test_case]
+ | ^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/issue-107454.rs:4:9
+ |
+LL | #![deny(unnameable_test_items)]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the attribute macro `test_case` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
diff --git a/tests/ui/test-attrs/issue-109816.rs b/tests/ui/test-attrs/issue-109816.rs
new file mode 100644
index 000000000..21fe5bc53
--- /dev/null
+++ b/tests/ui/test-attrs/issue-109816.rs
@@ -0,0 +1,7 @@
+// compile-flags: --test
+
+fn align_offset_weird_strides() {
+ #[test]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
+ struct A5(u32, u8);
+}
diff --git a/tests/ui/test-attrs/issue-109816.stderr b/tests/ui/test-attrs/issue-109816.stderr
new file mode 100644
index 000000000..e69932875
--- /dev/null
+++ b/tests/ui/test-attrs/issue-109816.stderr
@@ -0,0 +1,16 @@
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/issue-109816.rs:4:5
+ |
+LL | #[test]
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+LL |
+LL | struct A5(u32, u8);
+ | ------------------- expected a non-associated function, found a struct
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+LL | #[cfg(test)]
+ |
+
+error: aborting due to previous error
+
diff --git a/tests/ui/test-attrs/test-attr-non-associated-functions.rs b/tests/ui/test-attrs/test-attr-non-associated-functions.rs
index 31e567c39..2481919b6 100644
--- a/tests/ui/test-attrs/test-attr-non-associated-functions.rs
+++ b/tests/ui/test-attrs/test-attr-non-associated-functions.rs
@@ -1,18 +1,16 @@
-// #[test] attribute is not allowed on associated functions or methods
-// reworded error message
// compile-flags:--test
struct A {}
impl A {
#[test]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
fn new() -> A {
- //~^ ERROR `#[test]` attribute is only allowed on non associated functions
A {}
}
#[test]
+ //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
fn recovery_witness() -> A {
- //~^ ERROR `#[test]` attribute is only allowed on non associated functions
A {}
}
}
diff --git a/tests/ui/test-attrs/test-attr-non-associated-functions.stderr b/tests/ui/test-attrs/test-attr-non-associated-functions.stderr
index a81b8f398..3e3a951af 100644
--- a/tests/ui/test-attrs/test-attr-non-associated-functions.stderr
+++ b/tests/ui/test-attrs/test-attr-non-associated-functions.stderr
@@ -1,20 +1,24 @@
-error: `#[test]` attribute is only allowed on non associated functions
- --> $DIR/test-attr-non-associated-functions.rs:9:5
- |
-LL | / fn new() -> A {
-LL | |
-LL | | A {}
-LL | | }
- | |_____^
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/test-attr-non-associated-functions.rs:6:5
+ |
+LL | #[test]
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+LL | #[cfg(test)]
+ |
-error: `#[test]` attribute is only allowed on non associated functions
- --> $DIR/test-attr-non-associated-functions.rs:14:5
- |
-LL | / fn recovery_witness() -> A {
-LL | |
-LL | | A {}
-LL | | }
- | |_____^
+error: the `#[test]` attribute may only be used on a non-associated function
+ --> $DIR/test-attr-non-associated-functions.rs:11:5
+ |
+LL | #[test]
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
+ |
+help: replace with conditional compilation to make the item only exist when tests are being run
+ |
+LL | #[cfg(test)]
+ |
error: aborting due to 2 previous errors
diff --git a/tests/ui/test-attrs/test-on-not-fn.stderr b/tests/ui/test-attrs/test-on-not-fn.stderr
index fc2c5f62b..7a9913fbc 100644
--- a/tests/ui/test-attrs/test-on-not-fn.stderr
+++ b/tests/ui/test-attrs/test-on-not-fn.stderr
@@ -2,7 +2,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:3:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | mod test {}
| ----------- expected a non-associated function, found a module
|
@@ -15,7 +15,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:6:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | / mod loooooooooooooong_teeeeeeeeeest {
LL | | /*
LL | | this is a comment
@@ -34,7 +34,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:20:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | extern "C" {}
| ------------- expected a non-associated function, found an extern block
|
@@ -47,7 +47,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:23:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | trait Foo {}
| ------------ expected a non-associated function, found a trait
|
@@ -60,7 +60,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:26:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | impl Foo for i32 {}
| ------------------- expected a non-associated function, found an implementation
|
@@ -73,7 +73,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:29:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | const FOO: i32 = -1_i32;
| ------------------------ expected a non-associated function, found a constant item
|
@@ -86,7 +86,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:32:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | static BAR: u64 = 10_000_u64;
| ----------------------------- expected a non-associated function, found a static item
|
@@ -99,7 +99,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:35:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | / enum MyUnit {
LL | | Unit,
LL | | }
@@ -114,7 +114,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:40:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | struct NewI32(i32);
| ------------------- expected a non-associated function, found a struct
|
@@ -127,7 +127,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:43:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | / union Spooky {
LL | | x: i32,
LL | | y: u32,
@@ -143,7 +143,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:50:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | #[derive(Copy, Clone, Debug)]
LL | / struct MoreAttrs {
LL | | a: i32,
@@ -160,7 +160,7 @@ warning: the `#[test]` attribute may only be used on a non-associated function
--> $DIR/test-on-not-fn.rs:61:1
|
LL | #[test]
- | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
LL | foo!();
| ------- expected a non-associated function, found an item macro invocation
|
diff --git a/tests/ui/test-attrs/tests-listing-format-default.rs b/tests/ui/test-attrs/tests-listing-format-default.rs
new file mode 100644
index 000000000..d5df4b57b
--- /dev/null
+++ b/tests/ui/test-attrs/tests-listing-format-default.rs
@@ -0,0 +1,18 @@
+// no-prefer-dynamic
+// compile-flags: --test
+// run-flags: --list
+// run-pass
+// check-run-results
+
+// Checks the listing of tests with no --format arguments.
+
+#![cfg(test)]
+#[test]
+fn m_test() {}
+
+#[test]
+#[ignore = "not yet implemented"]
+fn z_test() {}
+
+#[test]
+fn a_test() {}
diff --git a/tests/ui/test-attrs/tests-listing-format-default.run.stdout b/tests/ui/test-attrs/tests-listing-format-default.run.stdout
new file mode 100644
index 000000000..72337daf0
--- /dev/null
+++ b/tests/ui/test-attrs/tests-listing-format-default.run.stdout
@@ -0,0 +1,5 @@
+a_test: test
+m_test: test
+z_test: test
+
+3 tests, 0 benchmarks
diff --git a/tests/ui/test-attrs/tests-listing-format-json-without-unstableopts.rs b/tests/ui/test-attrs/tests-listing-format-json-without-unstableopts.rs
new file mode 100644
index 000000000..5247f1f8f
--- /dev/null
+++ b/tests/ui/test-attrs/tests-listing-format-json-without-unstableopts.rs
@@ -0,0 +1,18 @@
+// no-prefer-dynamic
+// compile-flags: --test
+// run-flags: --list --format json
+// run-fail
+// check-run-results
+
+// Checks that --format json does not work without -Zunstable-options.
+
+#![cfg(test)]
+#[test]
+fn m_test() {}
+
+#[test]
+#[ignore = "not yet implemented"]
+fn z_test() {}
+
+#[test]
+fn a_test() {}
diff --git a/tests/ui/test-attrs/tests-listing-format-json-without-unstableopts.run.stderr b/tests/ui/test-attrs/tests-listing-format-json-without-unstableopts.run.stderr
new file mode 100644
index 000000000..9f6276300
--- /dev/null
+++ b/tests/ui/test-attrs/tests-listing-format-json-without-unstableopts.run.stderr
@@ -0,0 +1 @@
+error: The "json" format is only accepted on the nightly compiler
diff --git a/tests/ui/test-attrs/tests-listing-format-json.rs b/tests/ui/test-attrs/tests-listing-format-json.rs
new file mode 100644
index 000000000..5afc2746f
--- /dev/null
+++ b/tests/ui/test-attrs/tests-listing-format-json.rs
@@ -0,0 +1,21 @@
+// no-prefer-dynamic
+// compile-flags: --test
+// run-flags: --list --format json -Zunstable-options
+// run-pass
+// check-run-results
+// only-nightly
+// normalize-stdout-test: "fake-test-src-base/test-attrs/" -> "$$DIR/"
+// normalize-stdout-test: "fake-test-src-base\\test-attrs\\" -> "$$DIR/"
+
+// Checks the listing of tests with --format json.
+
+#![cfg(test)]
+#[test]
+fn m_test() {}
+
+#[test]
+#[ignore = "not yet implemented"]
+fn z_test() {}
+
+#[test]
+fn a_test() {}
diff --git a/tests/ui/test-attrs/tests-listing-format-json.run.stdout b/tests/ui/test-attrs/tests-listing-format-json.run.stdout
new file mode 100644
index 000000000..b4131e97c
--- /dev/null
+++ b/tests/ui/test-attrs/tests-listing-format-json.run.stdout
@@ -0,0 +1,5 @@
+{ "type": "suite", "event": "discovery" }
+{ "type": "test", "event": "discovered", "name": "a_test", "ignore": false, "ignore_message": "", "source_path": "$DIR/tests-listing-format-json.rs", "start_line": 20, "start_col": 4, "end_line": 20, "end_col": 10 }
+{ "type": "test", "event": "discovered", "name": "m_test", "ignore": false, "ignore_message": "", "source_path": "$DIR/tests-listing-format-json.rs", "start_line": 13, "start_col": 4, "end_line": 13, "end_col": 10 }
+{ "type": "test", "event": "discovered", "name": "z_test", "ignore": true, "ignore_message": "not yet implemented", "source_path": "$DIR/tests-listing-format-json.rs", "start_line": 17, "start_col": 4, "end_line": 17, "end_col": 10 }
+{ "type": "suite", "event": "completed", "tests": 3, "benchmarks": 0, "total": 3, "ignored": 1 }
diff --git a/tests/ui/test-attrs/tests-listing-format-terse.rs b/tests/ui/test-attrs/tests-listing-format-terse.rs
new file mode 100644
index 000000000..7835f7175
--- /dev/null
+++ b/tests/ui/test-attrs/tests-listing-format-terse.rs
@@ -0,0 +1,18 @@
+// no-prefer-dynamic
+// compile-flags: --test
+// run-flags: --list --format terse
+// run-pass
+// check-run-results
+
+// Checks the listing of tests with --format terse.
+
+#![cfg(test)]
+#[test]
+fn m_test() {}
+
+#[test]
+#[ignore = "not yet implemented"]
+fn z_test() {}
+
+#[test]
+fn a_test() {}
diff --git a/tests/ui/test-attrs/tests-listing-format-terse.run.stdout b/tests/ui/test-attrs/tests-listing-format-terse.run.stdout
new file mode 100644
index 000000000..22afe104b
--- /dev/null
+++ b/tests/ui/test-attrs/tests-listing-format-terse.run.stdout
@@ -0,0 +1,3 @@
+a_test: test
+m_test: test
+z_test: test
diff --git a/tests/ui/thir-print/thir-flat.stdout b/tests/ui/thir-print/thir-flat.stdout
index 910c0da27..9d467f73d 100644
--- a/tests/ui/thir-print/thir-flat.stdout
+++ b/tests/ui/thir-print/thir-flat.stdout
@@ -1,4 +1,4 @@
-DefId(0:3 ~ thir_flat[45a6]::main):
+DefId(0:3 ~ thir_flat[7b97]::main):
Thir {
body_type: Fn(
([]; c_variadic: false)->(),
@@ -30,7 +30,7 @@ Thir {
kind: Scope {
region_scope: Node(2),
lint_level: Explicit(
- HirId(DefId(0:3 ~ thir_flat[45a6]::main).2),
+ HirId(DefId(0:3 ~ thir_flat[7b97]::main).2),
),
value: e0,
},
diff --git a/tests/ui/thir-print/thir-tree-match.stdout b/tests/ui/thir-print/thir-tree-match.stdout
index d6174ec26..eea04c095 100644
--- a/tests/ui/thir-print/thir-tree-match.stdout
+++ b/tests/ui/thir-print/thir-tree-match.stdout
@@ -1,10 +1,10 @@
-DefId(0:16 ~ thir_tree_match[3c9a]::has_match):
+DefId(0:16 ~ thir_tree_match[fcf8]::has_match):
params: [
Param {
ty: Foo
ty_span: Some($DIR/thir-tree-match.rs:15:19: 15:22 (#0))
self_kind: None
- hir_id: Some(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).1))
+ hir_id: Some(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).1))
param: Some(
Pat: {
ty: Foo
@@ -14,7 +14,7 @@ params: [
mutability: Not
name: "foo"
mode: ByValue
- var: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).2))
+ var: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).2))
ty: Foo
is_primary: true
subpattern: None
@@ -41,7 +41,7 @@ body:
kind:
Scope {
region_scope: Node(26)
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).26))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).26))
value:
Expr {
ty: bool
@@ -63,7 +63,7 @@ body:
kind:
Scope {
region_scope: Node(3)
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).3))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).3))
value:
Expr {
ty: bool
@@ -79,7 +79,7 @@ body:
kind:
Scope {
region_scope: Node(4)
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).4))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).4))
value:
Expr {
ty: Foo
@@ -87,7 +87,7 @@ body:
span: $DIR/thir-tree-match.rs:16:11: 16:14 (#0)
kind:
VarRef {
- id: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).2))
+ id: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).2))
}
}
}
@@ -102,10 +102,10 @@ body:
Variant {
adt_def:
AdtDef {
- did: DefId(0:10 ~ thir_tree_match[3c9a]::Foo)
- variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[3c9a]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[3c9a]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[3c9a]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[3c9a])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[3c9a]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[3c9a]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
+ did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
+ variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
flags: IS_ENUM
- repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 11573694388057581 }
+ repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 }
substs: []
variant_index: 0
subpatterns: [
@@ -116,10 +116,10 @@ body:
Variant {
adt_def:
AdtDef {
- did: DefId(0:3 ~ thir_tree_match[3c9a]::Bar)
- variants: [VariantDef { def_id: DefId(0:4 ~ thir_tree_match[3c9a]::Bar::First), ctor: Some((Const, DefId(0:5 ~ thir_tree_match[3c9a]::Bar::First::{constructor#0}))), name: "First", discr: Relative(0), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:6 ~ thir_tree_match[3c9a]::Bar::Second), ctor: Some((Const, DefId(0:7 ~ thir_tree_match[3c9a]::Bar::Second::{constructor#0}))), name: "Second", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:8 ~ thir_tree_match[3c9a]::Bar::Third), ctor: Some((Const, DefId(0:9 ~ thir_tree_match[3c9a]::Bar::Third::{constructor#0}))), name: "Third", discr: Relative(2), fields: [], flags: NO_VARIANT_FLAGS }]
+ did: DefId(0:3 ~ thir_tree_match[fcf8]::Bar)
+ variants: [VariantDef { def_id: DefId(0:4 ~ thir_tree_match[fcf8]::Bar::First), ctor: Some((Const, DefId(0:5 ~ thir_tree_match[fcf8]::Bar::First::{constructor#0}))), name: "First", discr: Relative(0), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:6 ~ thir_tree_match[fcf8]::Bar::Second), ctor: Some((Const, DefId(0:7 ~ thir_tree_match[fcf8]::Bar::Second::{constructor#0}))), name: "Second", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:8 ~ thir_tree_match[fcf8]::Bar::Third), ctor: Some((Const, DefId(0:9 ~ thir_tree_match[fcf8]::Bar::Third::{constructor#0}))), name: "Third", discr: Relative(2), fields: [], flags: NO_VARIANT_FLAGS }]
flags: IS_ENUM
- repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3125160937860410723 }
+ repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 10333377570083945360 }
substs: []
variant_index: 0
subpatterns: []
@@ -148,7 +148,7 @@ body:
kind:
Scope {
region_scope: Node(13)
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).13))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).13))
value:
Expr {
ty: bool
@@ -162,7 +162,7 @@ body:
}
}
}
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).12))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).12))
scope: Node(12)
span: $DIR/thir-tree-match.rs:17:9: 17:40 (#0)
}
@@ -175,10 +175,10 @@ body:
Variant {
adt_def:
AdtDef {
- did: DefId(0:10 ~ thir_tree_match[3c9a]::Foo)
- variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[3c9a]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[3c9a]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[3c9a]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[3c9a])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[3c9a]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[3c9a]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
+ did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
+ variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
flags: IS_ENUM
- repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 11573694388057581 }
+ repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 }
substs: []
variant_index: 0
subpatterns: [
@@ -211,7 +211,7 @@ body:
kind:
Scope {
region_scope: Node(19)
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).19))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).19))
value:
Expr {
ty: bool
@@ -225,7 +225,7 @@ body:
}
}
}
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).18))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).18))
scope: Node(18)
span: $DIR/thir-tree-match.rs:18:9: 18:32 (#0)
}
@@ -238,10 +238,10 @@ body:
Variant {
adt_def:
AdtDef {
- did: DefId(0:10 ~ thir_tree_match[3c9a]::Foo)
- variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[3c9a]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[3c9a]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[3c9a]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[3c9a])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[3c9a]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[3c9a]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
+ did: DefId(0:10 ~ thir_tree_match[fcf8]::Foo)
+ variants: [VariantDef { def_id: DefId(0:11 ~ thir_tree_match[fcf8]::Foo::FooOne), ctor: Some((Fn, DefId(0:12 ~ thir_tree_match[fcf8]::Foo::FooOne::{constructor#0}))), name: "FooOne", discr: Relative(0), fields: [FieldDef { did: DefId(0:13 ~ thir_tree_match[fcf8]::Foo::FooOne::0), name: "0", vis: Restricted(DefId(0:0 ~ thir_tree_match[fcf8])) }], flags: NO_VARIANT_FLAGS }, VariantDef { def_id: DefId(0:14 ~ thir_tree_match[fcf8]::Foo::FooTwo), ctor: Some((Const, DefId(0:15 ~ thir_tree_match[fcf8]::Foo::FooTwo::{constructor#0}))), name: "FooTwo", discr: Relative(1), fields: [], flags: NO_VARIANT_FLAGS }]
flags: IS_ENUM
- repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 11573694388057581 }
+ repr: ReprOptions { int: None, align: None, pack: None, flags: (empty), field_shuffle_seed: 3477539199540094892 }
substs: []
variant_index: 1
subpatterns: []
@@ -266,7 +266,7 @@ body:
kind:
Scope {
region_scope: Node(24)
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).24))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).24))
value:
Expr {
ty: bool
@@ -280,7 +280,7 @@ body:
}
}
}
- lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).23))
+ lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[fcf8]::has_match).23))
scope: Node(23)
span: $DIR/thir-tree-match.rs:19:9: 19:28 (#0)
}
@@ -297,7 +297,7 @@ body:
}
-DefId(0:17 ~ thir_tree_match[3c9a]::main):
+DefId(0:17 ~ thir_tree_match[fcf8]::main):
params: [
]
body:
@@ -317,7 +317,7 @@ body:
kind:
Scope {
region_scope: Node(2)
- lint_level: Explicit(HirId(DefId(0:17 ~ thir_tree_match[3c9a]::main).2))
+ lint_level: Explicit(HirId(DefId(0:17 ~ thir_tree_match[fcf8]::main).2))
value:
Expr {
ty: ()
diff --git a/tests/ui/thir-print/thir-tree.stdout b/tests/ui/thir-print/thir-tree.stdout
index 0a35d9fb7..1b478dbef 100644
--- a/tests/ui/thir-print/thir-tree.stdout
+++ b/tests/ui/thir-print/thir-tree.stdout
@@ -1,4 +1,4 @@
-DefId(0:3 ~ thir_tree[8f1d]::main):
+DefId(0:3 ~ thir_tree[7aaa]::main):
params: [
]
body:
@@ -18,7 +18,7 @@ body:
kind:
Scope {
region_scope: Node(2)
- lint_level: Explicit(HirId(DefId(0:3 ~ thir_tree[8f1d]::main).2))
+ lint_level: Explicit(HirId(DefId(0:3 ~ thir_tree[7aaa]::main).2))
value:
Expr {
ty: ()
diff --git a/tests/ui/thread-local/auxiliary/tls-export.rs b/tests/ui/thread-local/auxiliary/tls-export.rs
new file mode 100644
index 000000000..027213bc0
--- /dev/null
+++ b/tests/ui/thread-local/auxiliary/tls-export.rs
@@ -0,0 +1,17 @@
+#![crate_type = "dylib"]
+#![feature(thread_local)]
+#![feature(cfg_target_thread_local)]
+
+extern crate tls_rlib;
+
+pub use tls_rlib::*;
+
+#[cfg(target_thread_local)]
+#[thread_local]
+pub static FOO: bool = true;
+
+#[cfg(target_thread_local)]
+#[inline(never)]
+pub fn foo_addr() -> usize {
+ &FOO as *const bool as usize
+}
diff --git a/tests/ui/thread-local/auxiliary/tls-rlib.rs b/tests/ui/thread-local/auxiliary/tls-rlib.rs
new file mode 100644
index 000000000..20bc998ec
--- /dev/null
+++ b/tests/ui/thread-local/auxiliary/tls-rlib.rs
@@ -0,0 +1,15 @@
+// no-prefer-dynamic
+
+#![crate_type = "rlib"]
+#![feature(thread_local)]
+#![feature(cfg_target_thread_local)]
+
+#[cfg(target_thread_local)]
+#[thread_local]
+pub static BAR: bool = true;
+
+#[cfg(target_thread_local)]
+#[inline(never)]
+pub fn bar_addr() -> usize {
+ &BAR as *const bool as usize
+}
diff --git a/tests/ui/thread-local-mutation.rs b/tests/ui/thread-local/thread-local-mutation.rs
index e738225ce..e738225ce 100644
--- a/tests/ui/thread-local-mutation.rs
+++ b/tests/ui/thread-local/thread-local-mutation.rs
diff --git a/tests/ui/thread-local-mutation.stderr b/tests/ui/thread-local/thread-local-mutation.stderr
index e5dc0e72e..e5dc0e72e 100644
--- a/tests/ui/thread-local-mutation.stderr
+++ b/tests/ui/thread-local/thread-local-mutation.stderr
diff --git a/tests/ui/thread-local-static.rs b/tests/ui/thread-local/thread-local-static.rs
index c7fee9e6b..c7fee9e6b 100644
--- a/tests/ui/thread-local-static.rs
+++ b/tests/ui/thread-local/thread-local-static.rs
diff --git a/tests/ui/thread-local-static.stderr b/tests/ui/thread-local/thread-local-static.stderr
index 712050a25..712050a25 100644
--- a/tests/ui/thread-local-static.stderr
+++ b/tests/ui/thread-local/thread-local-static.stderr
diff --git a/tests/ui/thread-local/tls-dylib-access.rs b/tests/ui/thread-local/tls-dylib-access.rs
new file mode 100644
index 000000000..12c46113c
--- /dev/null
+++ b/tests/ui/thread-local/tls-dylib-access.rs
@@ -0,0 +1,19 @@
+// aux-build: tls-rlib.rs
+// aux-build: tls-export.rs
+// run-pass
+
+#![feature(cfg_target_thread_local)]
+
+#[cfg(target_thread_local)]
+extern crate tls_export;
+
+fn main() {
+ #[cfg(target_thread_local)]
+ {
+ // Check that we get the real address of the `FOO` TLS in the dylib
+ assert_eq!(&tls_export::FOO as *const bool as usize, tls_export::foo_addr());
+
+ // Check that we get the real address of the `BAR` TLS in the rlib linked into the dylib
+ assert_eq!(&tls_export::BAR as *const bool as usize, tls_export::bar_addr());
+ }
+}
diff --git a/tests/ui/threads-sendsync/issue-43733-2.rs b/tests/ui/threads-sendsync/issue-43733-2.rs
index 32baeec43..8f7a9c083 100644
--- a/tests/ui/threads-sendsync/issue-43733-2.rs
+++ b/tests/ui/threads-sendsync/issue-43733-2.rs
@@ -21,7 +21,7 @@ impl<T> Key<T> {
}
#[cfg(target_thread_local)]
-use std::thread::__FastLocalKeyInner as Key;
+use std::thread::__LocalKeyInner as Key;
static __KEY: Key<()> = Key::new();
//~^ ERROR `UnsafeCell<Option<()>>` cannot be shared between threads
diff --git a/tests/ui/threads-sendsync/issue-43733.rs b/tests/ui/threads-sendsync/issue-43733.rs
index 935e02944..0eadef3e3 100644
--- a/tests/ui/threads-sendsync/issue-43733.rs
+++ b/tests/ui/threads-sendsync/issue-43733.rs
@@ -1,8 +1,8 @@
// ignore-wasm32
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
-// normalize-stderr-test: "__FastLocalKeyInner::<T>::get" -> "$$LOCALKEYINNER::<T>::get"
-// normalize-stderr-test: "__OsLocalKeyInner::<T>::get" -> "$$LOCALKEYINNER::<T>::get"
+// normalize-stderr-test: "__LocalKeyInner::<T>::get" -> "$$LOCALKEYINNER::<T>::get"
+// normalize-stderr-test: "__LocalKeyInner::<T>::get" -> "$$LOCALKEYINNER::<T>::get"
#![feature(thread_local)]
#![feature(cfg_target_thread_local, thread_local_internals)]
@@ -12,10 +12,10 @@ type Foo = std::cell::RefCell<String>;
#[cfg(target_thread_local)]
#[thread_local]
-static __KEY: std::thread::__FastLocalKeyInner<Foo> = std::thread::__FastLocalKeyInner::new();
+static __KEY: std::thread::__LocalKeyInner<Foo> = std::thread::__LocalKeyInner::new();
#[cfg(not(target_thread_local))]
-static __KEY: std::thread::__OsLocalKeyInner<Foo> = std::thread::__OsLocalKeyInner::new();
+static __KEY: std::thread::__LocalKeyInner<Foo> = std::thread::__LocalKeyInner::new();
fn __getit(_: Option<&mut Option<RefCell<String>>>) -> std::option::Option<&'static Foo> {
__KEY.get(Default::default)
diff --git a/tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr b/tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr
index 6d0f826e6..06696b548 100644
--- a/tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr
+++ b/tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr
@@ -3,6 +3,14 @@ error: expected derive macro, found tool attribute `rustfmt::skip`
|
LL | #[derive(rustfmt::skip)]
| ^^^^^^^^^^^^^ not a derive macro
+ |
+help: remove from the surrounding `derive()`
+ --> $DIR/tool-attributes-misplaced-2.rs:1:10
+ |
+LL | #[derive(rustfmt::skip)]
+ | ^^^^^^^^^^^^^
+ = help: add as non-Derive macro
+ `#[rustfmt::skip]`
error: expected macro, found tool attribute `rustfmt::skip`
--> $DIR/tool-attributes-misplaced-2.rs:5:5
diff --git a/tests/ui/trait-bounds/impl-bound-with-references-error.stderr b/tests/ui/trait-bounds/impl-bound-with-references-error.stderr
index 95fd6bd50..b114d295d 100644
--- a/tests/ui/trait-bounds/impl-bound-with-references-error.stderr
+++ b/tests/ui/trait-bounds/impl-bound-with-references-error.stderr
@@ -6,7 +6,7 @@ LL | T: Into<Cow<'static, str>>,
|
help: consider importing this enum
|
-LL | use std::borrow::Cow;
+LL + use std::borrow::Cow;
|
error[E0119]: conflicting implementations of trait `From<LabelText>` for type `LabelText`
diff --git a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr
index b29766295..4547e1c98 100644
--- a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr
+++ b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr
@@ -6,7 +6,7 @@ LL | pub struct A<H: A::Trait>(pub H);
|
help: consider importing this trait
|
-LL | use A::Trait;
+LL + use A::Trait;
|
help: if you import `Trait`, refer to it directly
|
diff --git a/tests/ui/traits/alias/dont-elaborate-non-self.rs b/tests/ui/traits/alias/dont-elaborate-non-self.rs
new file mode 100644
index 000000000..4f9eaacb8
--- /dev/null
+++ b/tests/ui/traits/alias/dont-elaborate-non-self.rs
@@ -0,0 +1,10 @@
+#![feature(trait_alias)]
+
+use std::future::Future;
+
+trait F<Fut: Future<Output = usize>> = Fn() -> Fut;
+
+fn f<Fut>(a: dyn F<Fut>) {}
+//~^ ERROR the size for values of type `(dyn Fn() -> Fut + 'static)` cannot be known at compilation time
+
+fn main() {}
diff --git a/tests/ui/traits/alias/dont-elaborate-non-self.stderr b/tests/ui/traits/alias/dont-elaborate-non-self.stderr
new file mode 100644
index 000000000..247a4f812
--- /dev/null
+++ b/tests/ui/traits/alias/dont-elaborate-non-self.stderr
@@ -0,0 +1,20 @@
+error[E0277]: the size for values of type `(dyn Fn() -> Fut + 'static)` cannot be known at compilation time
+ --> $DIR/dont-elaborate-non-self.rs:7:11
+ |
+LL | fn f<Fut>(a: dyn F<Fut>) {}
+ | ^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `(dyn Fn() -> Fut + 'static)`
+ = help: unsized fn params are gated as an unstable feature
+help: you can use `impl Trait` as the argument type
+ |
+LL | fn f<Fut>(a: impl F<Fut>) {}
+ | ~~~~
+help: function arguments must have a statically known size, borrowed types always have a known size
+ |
+LL | fn f<Fut>(a: &dyn F<Fut>) {}
+ | +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs
index 471a6b836..8e43b7249 100644
--- a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs
+++ b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs
@@ -18,6 +18,6 @@ fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String { //~ ERROR expec
fn issue_95327() where <u8 as Unresolved>::Assoc: String {}
//~^ ERROR expected trait, found struct
-//~| ERROR use of undeclared type `Unresolved`
+//~| ERROR cannot find trait `Unresolved` in this scope
fn main() {}
diff --git a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
index 5be334986..0020f9e41 100644
--- a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
+++ b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
@@ -1,9 +1,3 @@
-error[E0433]: failed to resolve: use of undeclared type `Unresolved`
- --> $DIR/assoc_type_bound_with_struct.rs:19:31
- |
-LL | fn issue_95327() where <u8 as Unresolved>::Assoc: String {}
- | ^^^^^^^^^^ use of undeclared type `Unresolved`
-
error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:5:46
|
@@ -76,6 +70,12 @@ help: a trait with a similar name exists
LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString {
| ~~~~~~~~
+error[E0405]: cannot find trait `Unresolved` in this scope
+ --> $DIR/assoc_type_bound_with_struct.rs:19:31
+ |
+LL | fn issue_95327() where <u8 as Unresolved>::Assoc: String {}
+ | ^^^^^^^^^^ not found in this scope
+
error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:19:51
|
@@ -87,5 +87,5 @@ LL | fn issue_95327() where <u8 as Unresolved>::Assoc: String {}
error: aborting due to 6 previous errors
-Some errors have detailed explanations: E0404, E0433.
+Some errors have detailed explanations: E0404, E0405.
For more information about an error, try `rustc --explain E0404`.
diff --git a/tests/ui/traits/copy-is-not-modulo-regions.not_static.stderr b/tests/ui/traits/copy-is-not-modulo-regions.not_static.stderr
index edd94d201..130425211 100644
--- a/tests/ui/traits/copy-is-not-modulo-regions.not_static.stderr
+++ b/tests/ui/traits/copy-is-not-modulo-regions.not_static.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/copy-is-not-modulo-regions.rs:13:21
|
LL | struct Bar<'lt>(Foo<'lt>);
diff --git a/tests/ui/traits/copy-is-not-modulo-regions.rs b/tests/ui/traits/copy-is-not-modulo-regions.rs
index adb870237..b89908374 100644
--- a/tests/ui/traits/copy-is-not-modulo-regions.rs
+++ b/tests/ui/traits/copy-is-not-modulo-regions.rs
@@ -11,7 +11,7 @@ struct Bar<'lt>(Foo<'lt>);
#[cfg(not_static)]
impl<'any> Copy for Bar<'any> {}
-//[not_static]~^ the trait `Copy` may not be implemented for this type
+//[not_static]~^ the trait `Copy` cannot be implemented for this type
#[cfg(yes_static)]
impl<'any> Copy for Bar<'static> {}
diff --git a/tests/ui/traits/dyn-trait.rs b/tests/ui/traits/dyn-trait.rs
index e1c1a8de5..10e69105c 100644
--- a/tests/ui/traits/dyn-trait.rs
+++ b/tests/ui/traits/dyn-trait.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-pretty `dyn ::foo` parses differently in the current edition
use std::fmt::Display;
diff --git a/tests/ui/traits/inductive-overflow/lifetime.rs b/tests/ui/traits/inductive-overflow/lifetime.rs
index bf536d21c..2f3c90dce 100644
--- a/tests/ui/traits/inductive-overflow/lifetime.rs
+++ b/tests/ui/traits/inductive-overflow/lifetime.rs
@@ -15,9 +15,9 @@ impl<'a> Y for C<'a> {
struct C<'a>(&'a ());
struct X<T: Y>(T::P);
-impl<T: NotAuto> NotAuto for Box<T> {} //~ NOTE: required
+impl<T: NotAuto> NotAuto for Box<T> {}
+impl<T: Y> NotAuto for X<T> where T::P: NotAuto {} //~ NOTE: required
//~^ NOTE unsatisfied trait bound introduced here
-impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
impl<'a> NotAuto for C<'a> {}
fn is_send<S: NotAuto>() {}
@@ -28,6 +28,4 @@ fn main() {
// Should only be a few notes.
is_send::<X<C<'static>>>();
//~^ ERROR overflow evaluating
- //~| 3 redundant requirements hidden
- //~| required for
}
diff --git a/tests/ui/traits/inductive-overflow/lifetime.stderr b/tests/ui/traits/inductive-overflow/lifetime.stderr
index 357e59991..7ab2864a8 100644
--- a/tests/ui/traits/inductive-overflow/lifetime.stderr
+++ b/tests/ui/traits/inductive-overflow/lifetime.stderr
@@ -1,18 +1,14 @@
-error[E0275]: overflow evaluating the requirement `X<C<'_>>: NotAuto`
+error[E0275]: overflow evaluating the requirement `Box<X<C<'static>>>: NotAuto`
--> $DIR/lifetime.rs:29:5
|
LL | is_send::<X<C<'static>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: required for `Box<X<C<'_>>>` to implement `NotAuto`
- --> $DIR/lifetime.rs:18:18
+note: required for `X<C<'static>>` to implement `NotAuto`
+ --> $DIR/lifetime.rs:19:12
|
-LL | impl<T: NotAuto> NotAuto for Box<T> {}
- | ------- ^^^^^^^ ^^^^^^
- | |
- | unsatisfied trait bound introduced here
- = note: 3 redundant requirements hidden
- = note: required for `X<C<'static>>` to implement `NotAuto`
+LL | impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
+ | ^^^^^^^ ^^^^ ------- unsatisfied trait bound introduced here
note: required by a bound in `is_send`
--> $DIR/lifetime.rs:23:15
|
diff --git a/tests/ui/traits/inductive-overflow/supertrait-auto-trait.stderr b/tests/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
index dc967d512..e723c7c51 100644
--- a/tests/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
+++ b/tests/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
@@ -26,7 +26,8 @@ LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
| ^^^^^ required by this bound in `copy`
help: consider annotating `NoClone` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct NoClone;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/traits/issue-50480.rs b/tests/ui/traits/issue-50480.rs
index 005939e0c..683a85a32 100644
--- a/tests/ui/traits/issue-50480.rs
+++ b/tests/ui/traits/issue-50480.rs
@@ -1,5 +1,5 @@
#[derive(Clone, Copy)]
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
struct Foo(N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
//~^ ERROR cannot find type `NotDefined` in this scope
//~| ERROR cannot find type `NotDefined` in this scope
@@ -7,7 +7,7 @@ struct Foo(N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
//~| ERROR cannot find type `N` in this scope
#[derive(Clone, Copy)]
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//~^ ERROR the trait `Copy` cannot be implemented for this type
struct Bar<T>(T, N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
//~^ ERROR cannot find type `NotDefined` in this scope
//~| ERROR cannot find type `N` in this scope
diff --git a/tests/ui/traits/issue-50480.stderr b/tests/ui/traits/issue-50480.stderr
index 5063fdca0..4f72db60a 100644
--- a/tests/ui/traits/issue-50480.stderr
+++ b/tests/ui/traits/issue-50480.stderr
@@ -60,7 +60,7 @@ error[E0412]: cannot find type `NotDefined` in this scope
LL | struct Bar<T>(T, N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
| ^^^^^^^^^^ not found in this scope
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/issue-50480.rs:1:17
|
LL | #[derive(Clone, Copy)]
@@ -73,7 +73,7 @@ LL | struct Foo(N, NotDefined, <i32 as Iterator>::Item, Vec<i32>, String);
|
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/issue-50480.rs:9:17
|
LL | #[derive(Clone, Copy)]
diff --git a/tests/ui/traits/issue-71136.stderr b/tests/ui/traits/issue-71136.stderr
index f54173392..ef5579618 100644
--- a/tests/ui/traits/issue-71136.stderr
+++ b/tests/ui/traits/issue-71136.stderr
@@ -11,7 +11,8 @@ LL | the_foos: Vec<Foo>,
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Foo` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct Foo(u8);
|
error: aborting due to previous error
diff --git a/tests/ui/traits/issue-78372.stderr b/tests/ui/traits/issue-78372.stderr
index 8e7fd5f25..ec692ff91 100644
--- a/tests/ui/traits/issue-78372.stderr
+++ b/tests/ui/traits/issue-78372.stderr
@@ -6,7 +6,7 @@ LL | struct Smaht<T, MISC>(PhantomData);
|
help: consider importing this struct
|
-LL | use std::marker::PhantomData;
+LL + use std::marker::PhantomData;
|
error[E0412]: cannot find type `U` in this scope
diff --git a/tests/ui/traits/issue-87558.stderr b/tests/ui/traits/issue-87558.stderr
index 494274d8c..b647f9794 100644
--- a/tests/ui/traits/issue-87558.stderr
+++ b/tests/ui/traits/issue-87558.stderr
@@ -17,6 +17,12 @@ error[E0229]: associated type bindings are not allowed here
|
LL | impl Fn(&isize) for Error {
| ^^^^^^^^^^ associated type not allowed here
+ |
+help: parenthesized trait syntax expands to `Fn<(&isize,), Output=()>`
+ --> $DIR/issue-87558.rs:3:6
+ |
+LL | impl Fn(&isize) for Error {
+ | ^^^^^^^^^^
error: aborting due to 3 previous errors
diff --git a/tests/ui/traits/issue-91949-hangs-on-recursion.rs b/tests/ui/traits/issue-91949-hangs-on-recursion.rs
index 6474b2b38..4eca643a9 100644
--- a/tests/ui/traits/issue-91949-hangs-on-recursion.rs
+++ b/tests/ui/traits/issue-91949-hangs-on-recursion.rs
@@ -1,6 +1,6 @@
// build-fail
// compile-flags: -Zinline-mir=no
-// error-pattern: overflow evaluating the requirement `(): Sized`
+// 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"
diff --git a/tests/ui/traits/issue-91949-hangs-on-recursion.stderr b/tests/ui/traits/issue-91949-hangs-on-recursion.stderr
index 1f18c5daf..144990d50 100644
--- a/tests/ui/traits/issue-91949-hangs-on-recursion.stderr
+++ b/tests/ui/traits/issue-91949-hangs-on-recursion.stderr
@@ -12,11 +12,17 @@ LL | recurse(IteratorOfWrapped(elements).map(|t| t.0))
= 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 `(): Sized`
+error[E0275]: overflow evaluating the requirement `<std::iter::Empty<()> as Iterator>::Item == ()`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`)
- = note: required for `std::iter::Empty<()>` to implement `Iterator`
- = note: 171 redundant requirements hidden
+note: required for `IteratorOfWrapped<(), std::iter::Empty<()>>` to implement `Iterator`
+ --> $DIR/issue-91949-hangs-on-recursion.rs:16:32
+ |
+LL | impl<T, I: Iterator<Item = T>> Iterator for IteratorOfWrapped<T, I> {
+ | -------- ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | unsatisfied trait bound introduced here
+ = note: 256 redundant requirements hidden
= note: required for `IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<..., ...>>, ...>>, ...>>` to implement `Iterator`
= note: the full type name has been written to '$TEST_BUILD_DIR/traits/issue-91949-hangs-on-recursion/issue-91949-hangs-on-recursion.long-type-hash.txt'
diff --git a/tests/ui/traits/item-privacy.stderr b/tests/ui/traits/item-privacy.stderr
index 04995b3a1..f53813189 100644
--- a/tests/ui/traits/item-privacy.stderr
+++ b/tests/ui/traits/item-privacy.stderr
@@ -29,7 +29,7 @@ LL | S.b();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use method::B;
+LL + use method::B;
|
error[E0624]: method `a` is private
@@ -69,7 +69,7 @@ LL | S::b(&S);
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use method::B;
+LL + use method::B;
|
error[E0624]: method `a` is private
@@ -109,7 +109,7 @@ LL | S::B;
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use assoc_const::B;
+LL + use assoc_const::B;
|
error[E0624]: associated constant `A` is private
diff --git a/tests/ui/traits/method-private.stderr b/tests/ui/traits/method-private.stderr
index 55656f21e..e11799308 100644
--- a/tests/ui/traits/method-private.stderr
+++ b/tests/ui/traits/method-private.stderr
@@ -10,7 +10,7 @@ LL | foo.method();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use inner::Bar;
+LL + use inner::Bar;
|
error: aborting due to previous error
diff --git a/tests/ui/traits/new-solver/alias-eq-in-canonical-response.rs b/tests/ui/traits/new-solver/alias-eq-in-canonical-response.rs
new file mode 100644
index 000000000..4bfb6323a
--- /dev/null
+++ b/tests/ui/traits/new-solver/alias-eq-in-canonical-response.rs
@@ -0,0 +1,40 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+
+trait Foo {
+ type Gat<'a>
+ where
+ Self: 'a;
+ fn bar(&self) -> Self::Gat<'_>;
+}
+
+enum Option<T> {
+ Some(T),
+ None,
+}
+
+impl<T> Option<T> {
+ fn as_ref(&self) -> Option<&T> {
+ match self {
+ Option::Some(t) => Option::Some(t),
+ Option::None => Option::None,
+ }
+ }
+
+ fn map<U>(self, f: impl FnOnce(T) -> U) -> Option<U> {
+ match self {
+ Option::Some(t) => Option::Some(f(t)),
+ Option::None => Option::None,
+ }
+ }
+}
+
+impl<T: Foo + 'static> Foo for Option<T> {
+ type Gat<'a> = Option<<T as Foo>::Gat<'a>> where Self: 'a;
+
+ fn bar(&self) -> Self::Gat<'_> {
+ self.as_ref().map(Foo::bar)
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/alias-sub.rs b/tests/ui/traits/new-solver/alias-sub.rs
new file mode 100644
index 000000000..30c1981a9
--- /dev/null
+++ b/tests/ui/traits/new-solver/alias-sub.rs
@@ -0,0 +1,34 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+trait Trait {
+ type Assoc: Sized;
+}
+
+impl Trait for &'static str {
+ type Assoc = &'static str;
+}
+
+// Wrapper is just here to get around stupid `Sized` obligations in mir typeck
+struct Wrapper<T: ?Sized>(std::marker::PhantomData<T>);
+fn mk<T: Trait>(x: T) -> Wrapper<<T as Trait>::Assoc> { todo!() }
+
+
+trait IsStaticStr {}
+impl IsStaticStr for (&'static str,) {}
+fn define<T: IsStaticStr>(_: T) {}
+
+fn foo<'a, T: Trait>() {
+ let y = Default::default();
+
+ // `<?0 as Trait>::Assoc <: &'a str`
+ // In the old solver, this would *equate* the LHS and RHS.
+ let _: Wrapper<&'a str> = mk(y);
+
+ // ... then later on, we constrain `?0 = &'static str`
+ // but that should not mean that `'a = 'static`, because
+ // we should use *sub* above.
+ define((y,));
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/alias_eq_dont_use_normalizes_to_if_substs_eq.rs b/tests/ui/traits/new-solver/alias_eq_dont_use_normalizes_to_if_substs_eq.rs
index fd5d0e3b1..531203d9c 100644
--- a/tests/ui/traits/new-solver/alias_eq_dont_use_normalizes_to_if_substs_eq.rs
+++ b/tests/ui/traits/new-solver/alias_eq_dont_use_normalizes_to_if_substs_eq.rs
@@ -1,7 +1,7 @@
// compile-flags: -Ztrait-solver=next
// check that when computing `alias-eq(<() as Foo<u16, T>>::Assoc, <() as Foo<?0, T>>::Assoc)`
-// we do not infer `?0 = u8` via the `for<STOP> (): Foo<u8, STOP>` impl or `?0 = u16` by
+// we do not infer `?0 = u8` via the `for<STOP> (): Foo<u8, STOP>` impl or `?0 = u16` by
// relating substs as either could be a valid solution.
trait Foo<T, STOP> {
diff --git a/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.fail.stderr b/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.fail.stderr
new file mode 100644
index 000000000..6a926534e
--- /dev/null
+++ b/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.fail.stderr
@@ -0,0 +1,18 @@
+error[E0277]: `impl Future<Output = ()>` cannot be sent between threads safely
+ --> $DIR/auto-with-drop_tracking_mir.rs:24:13
+ |
+LL | is_send(foo());
+ | ------- ^^^^^ `impl Future<Output = ()>` cannot be sent between threads safely
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Send` is not implemented for `impl Future<Output = ()>`
+note: required by a bound in `is_send`
+ --> $DIR/auto-with-drop_tracking_mir.rs:23:24
+ |
+LL | fn is_send(_: impl Send) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs b/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs
new file mode 100644
index 000000000..a5db7c463
--- /dev/null
+++ b/tests/ui/traits/new-solver/auto-with-drop_tracking_mir.rs
@@ -0,0 +1,26 @@
+// compile-flags: -Ztrait-solver=next -Zdrop-tracking-mir
+// edition: 2021
+// revisions: pass fail
+//[pass] check-pass
+
+#![feature(negative_impls)]
+
+struct NotSync;
+impl !Sync for NotSync {}
+
+async fn foo() {
+ #[cfg(pass)]
+ let x = &();
+ #[cfg(fail)]
+ let x = &NotSync;
+ bar().await;
+ drop(x);
+}
+
+async fn bar() {}
+
+fn main() {
+ fn is_send(_: impl Send) {}
+ is_send(foo());
+ //[fail]~^ ERROR `impl Future<Output = ()>` cannot be sent between threads safely
+}
diff --git a/tests/ui/traits/new-solver/canonical-int-var-eq-in-response.rs b/tests/ui/traits/new-solver/canonical-int-var-eq-in-response.rs
new file mode 100644
index 000000000..4b013983a
--- /dev/null
+++ b/tests/ui/traits/new-solver/canonical-int-var-eq-in-response.rs
@@ -0,0 +1,22 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+trait Mirror {
+ type Assoc;
+}
+
+impl<T> Mirror for T {
+ type Assoc = T;
+}
+
+trait Test {}
+impl Test for i64 {}
+impl Test for u64 {}
+
+fn mirror_me<T: Mirror>(t: T, s: <T as Mirror>::Assoc) where <T as Mirror>::Assoc: Test {}
+
+fn main() {
+ let mut x = 0;
+ mirror_me(x, 1);
+ x = 1i64;
+}
diff --git a/tests/ui/traits/new-solver/canonical-ty-var-eq-in-response.rs b/tests/ui/traits/new-solver/canonical-ty-var-eq-in-response.rs
new file mode 100644
index 000000000..d1c6b1077
--- /dev/null
+++ b/tests/ui/traits/new-solver/canonical-ty-var-eq-in-response.rs
@@ -0,0 +1,39 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+
+trait Mirror {
+ type Item;
+}
+
+struct Wrapper<T>(T);
+impl<T> Mirror for Wrapper<T> {
+ type Item = T;
+}
+
+fn mirror<T>()
+where
+ Wrapper<T>: Mirror<Item = i32>,
+{
+}
+
+fn main() {
+ mirror::<_ /* ?0 */>();
+
+ // Solving `<Wrapper<?0> as Mirror>::Item = i32`
+
+ // First, we replace the term with a fresh infer var:
+ // `<Wrapper<?0> as Mirror>::Item = ?1`
+
+ // We select the impl candidate on line #6, which leads us to learn that
+ // `?0 == ?1`.
+
+ // That should be reflected in our canonical response, which should have
+ // `^0 = ^0, ^1 = ^0`
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ // !! We used to return a totally unconstrained response here :< !!
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ // Then, during the "equate term" part of the projection solving, we
+ // instantiate the response from the unconstrained projection predicate,
+ // and equate `?0 == i32`.
+}
diff --git a/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.rs b/tests/ui/traits/new-solver/cast-checks-handling-projections.rs
index 5ff567cd0..3b261062f 100644
--- a/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.rs
+++ b/tests/ui/traits/new-solver/cast-checks-handling-projections.rs
@@ -1,5 +1,5 @@
// compile-flags: -Ztrait-solver=next
-// known-bug: unknown
+// check-pass
fn main() {
(0u8 + 0u8) as char;
diff --git a/tests/ui/traits/new-solver/closure-inference-guidance.rs b/tests/ui/traits/new-solver/closure-inference-guidance.rs
new file mode 100644
index 000000000..d2ad0cc03
--- /dev/null
+++ b/tests/ui/traits/new-solver/closure-inference-guidance.rs
@@ -0,0 +1,11 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+fn foo(i: isize) -> isize { i + 1 }
+
+fn apply<A, F>(f: F, v: A) -> A where F: FnOnce(A) -> A { f(v) }
+
+pub fn main() {
+ let f = |i| foo(i);
+ assert_eq!(apply(f, 2), 3);
+}
diff --git a/tests/ui/traits/new-solver/coherence/issue-102048.rs b/tests/ui/traits/new-solver/coherence/issue-102048.rs
new file mode 100644
index 000000000..11636bfeb
--- /dev/null
+++ b/tests/ui/traits/new-solver/coherence/issue-102048.rs
@@ -0,0 +1,44 @@
+// This must fail coherence.
+//
+// Getting this to pass was fairly difficult, so here's an explanation
+// of what's happening:
+//
+// Normalizing projections currently tries to replace them with inference variables
+// while emitting a nested `Projection` obligation. This cannot be done if the projection
+// has bound variables which is the case here.
+//
+// So the projections stay until after normalization. When unifying two projections we
+// currently treat them as if they are injective, so we **incorrectly** unify their
+// substs. This means that coherence for the two impls ends up unifying `?T` and `?U`
+// as it tries to unify `<?T as WithAssoc1<'a>>::Assoc` with `<?U as WithAssoc1<'a>>::Assoc`.
+//
+// `impl1` therefore has the projection `<?T as WithAssoc2<'a>>::Assoc` and we have the
+// assumption `?T: for<'a> WithAssoc2<'a, Assoc = i32>` in the `param_env`, so we normalize
+// that to `i32`. We then try to unify `i32` from `impl1` with `u32` from `impl2` which fails,
+// causing coherence to consider these two impls distinct.
+
+// compile-flags: -Ztrait-solver=next
+pub trait Trait<T> {}
+
+pub trait WithAssoc1<'a> {
+ type Assoc;
+}
+pub trait WithAssoc2<'a> {
+ type Assoc;
+}
+
+// impl 1
+impl<T, U> Trait<for<'a> fn(<T as WithAssoc1<'a>>::Assoc, <U as WithAssoc2<'a>>::Assoc)> for (T, U)
+where
+ T: for<'a> WithAssoc1<'a> + for<'a> WithAssoc2<'a, Assoc = i32>,
+ U: for<'a> WithAssoc2<'a>,
+{
+}
+
+// impl 2
+impl<T, U> Trait<for<'a> fn(<U as WithAssoc1<'a>>::Assoc, u32)> for (T, U) where
+ U: for<'a> WithAssoc1<'a> //~^ ERROR conflicting implementations of trait
+{
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/coherence/issue-102048.stderr b/tests/ui/traits/new-solver/coherence/issue-102048.stderr
new file mode 100644
index 000000000..17a43838f
--- /dev/null
+++ b/tests/ui/traits/new-solver/coherence/issue-102048.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `Trait<for<'a> fn(<_ as WithAssoc1<'a>>::Assoc, <_ as WithAssoc2<'a>>::Assoc)>` for type `(_, _)`
+ --> $DIR/issue-102048.rs:39:1
+ |
+LL | impl<T, U> Trait<for<'a> fn(<T as WithAssoc1<'a>>::Assoc, <U as WithAssoc2<'a>>::Assoc)> for (T, U)
+ | --------------------------------------------------------------------------------------------------- first implementation here
+...
+LL | impl<T, U> Trait<for<'a> fn(<U as WithAssoc1<'a>>::Assoc, u32)> for (T, U) where
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_, _)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/traits/new-solver/const-param-placeholder.fail.stderr b/tests/ui/traits/new-solver/const-param-placeholder.fail.stderr
new file mode 100644
index 000000000..4db6e22e5
--- /dev/null
+++ b/tests/ui/traits/new-solver/const-param-placeholder.fail.stderr
@@ -0,0 +1,16 @@
+error[E0277]: the trait bound `[T; N]: Foo` is not satisfied
+ --> $DIR/const-param-placeholder.rs:17:17
+ |
+LL | needs_foo::<[T; N]>();
+ | ^^^^^^ the trait `Foo` is not implemented for `[T; N]`
+ |
+ = help: the trait `Foo` is implemented for `[T; 1]`
+note: required by a bound in `needs_foo`
+ --> $DIR/const-param-placeholder.rs:8:17
+ |
+LL | fn needs_foo<F: Foo>() {}
+ | ^^^ required by this bound in `needs_foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/const-param-placeholder.rs b/tests/ui/traits/new-solver/const-param-placeholder.rs
new file mode 100644
index 000000000..a83102a4c
--- /dev/null
+++ b/tests/ui/traits/new-solver/const-param-placeholder.rs
@@ -0,0 +1,21 @@
+// compile-flags: -Ztrait-solver=next
+// revisions: pass fail
+//[pass] check-pass
+
+struct Wrapper<T, const N: usize>([T; N]);
+
+trait Foo {}
+fn needs_foo<F: Foo>() {}
+
+#[cfg(fail)]
+impl<T> Foo for [T; 1] {}
+
+#[cfg(pass)]
+impl<T, const N: usize> Foo for [T; N] {}
+
+fn test<T, const N: usize>() {
+ needs_foo::<[T; N]>();
+ //[fail]~^ ERROR the trait bound `[T; N]: Foo` is not satisfied
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/deduce-ty-from-object.rs b/tests/ui/traits/new-solver/deduce-ty-from-object.rs
new file mode 100644
index 000000000..7398bce7b
--- /dev/null
+++ b/tests/ui/traits/new-solver/deduce-ty-from-object.rs
@@ -0,0 +1,6 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+
+fn main() {
+ let x: Box<dyn Iterator<Item = ()>> = Box::new(std::iter::empty());
+}
diff --git a/tests/ui/traits/new-solver/destruct.rs b/tests/ui/traits/new-solver/destruct.rs
new file mode 100644
index 000000000..30d7777b7
--- /dev/null
+++ b/tests/ui/traits/new-solver/destruct.rs
@@ -0,0 +1,13 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+#![feature(const_trait_impl)]
+
+fn foo(_: impl std::marker::Destruct) {}
+
+struct MyAdt;
+
+fn main() {
+ foo(1);
+ foo(MyAdt);
+}
diff --git a/tests/ui/traits/new-solver/dont-elaborate-for-projections.rs b/tests/ui/traits/new-solver/dont-elaborate-for-projections.rs
new file mode 100644
index 000000000..e60825006
--- /dev/null
+++ b/tests/ui/traits/new-solver/dont-elaborate-for-projections.rs
@@ -0,0 +1,12 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+trait Iter<'a, I: 'a>: Iterator<Item = &'a I> {}
+
+fn needs_iter<'a, T: Iter<'a, I> + ?Sized, I: 'a>(_: &T) {}
+
+fn test(x: &dyn Iter<'_, ()>) {
+ needs_iter(x);
+}
+
+fn main() {}
diff --git a/tests/ui/typeck/lazy-norm/equating-projection-cyclically.rs b/tests/ui/traits/new-solver/equating-projection-cyclically.rs
index 019c6e81c..019c6e81c 100644
--- a/tests/ui/typeck/lazy-norm/equating-projection-cyclically.rs
+++ b/tests/ui/traits/new-solver/equating-projection-cyclically.rs
diff --git a/tests/ui/typeck/lazy-norm/equating-projection-cyclically.stderr b/tests/ui/traits/new-solver/equating-projection-cyclically.stderr
index 57cbc65a1..57cbc65a1 100644
--- a/tests/ui/typeck/lazy-norm/equating-projection-cyclically.stderr
+++ b/tests/ui/traits/new-solver/equating-projection-cyclically.stderr
diff --git a/tests/ui/traits/new-solver/float-canonical.rs b/tests/ui/traits/new-solver/float-canonical.rs
new file mode 100644
index 000000000..b8748cd43
--- /dev/null
+++ b/tests/ui/traits/new-solver/float-canonical.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+fn foo(x: f64) {
+ let y = x + 1.0;
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/fn-trait.rs b/tests/ui/traits/new-solver/fn-trait.rs
index d566ead10..0599e51d7 100644
--- a/tests/ui/traits/new-solver/fn-trait.rs
+++ b/tests/ui/traits/new-solver/fn-trait.rs
@@ -1,5 +1,4 @@
// compile-flags: -Ztrait-solver=next
-// check-pass
fn require_fn(_: impl Fn() -> i32) {}
@@ -7,7 +6,27 @@ fn f() -> i32 {
1i32
}
+extern "C" fn g() -> i32 {
+ 2i32
+}
+
+unsafe fn h() -> i32 {
+ 2i32
+}
+
fn main() {
require_fn(f);
require_fn(f as fn() -> i32);
+ require_fn(f as unsafe fn() -> i32);
+ //~^ ERROR: expected a `Fn<()>` closure, found `unsafe fn() -> i32`
+ //~| ERROR: type mismatch resolving `<unsafe fn() -> i32 as FnOnce<()>>::Output == i32`
+ require_fn(g);
+ //~^ ERROR: expected a `Fn<()>` closure, found `extern "C" fn() -> i32 {g}`
+ //~| ERROR: type mismatch resolving `<extern "C" fn() -> i32 {g} as FnOnce<()>>::Output == i32`
+ require_fn(g as extern "C" fn() -> i32);
+ //~^ ERROR: expected a `Fn<()>` closure, found `extern "C" fn() -> i32`
+ //~| ERROR: type mismatch resolving `<extern "C" fn() -> i32 as FnOnce<()>>::Output == i32`
+ require_fn(h);
+ //~^ ERROR: expected a `Fn<()>` closure, found `unsafe fn() -> i32 {h}`
+ //~| ERROR: type mismatch resolving `<unsafe fn() -> i32 {h} as FnOnce<()>>::Output == i32`
}
diff --git a/tests/ui/traits/new-solver/fn-trait.stderr b/tests/ui/traits/new-solver/fn-trait.stderr
new file mode 100644
index 000000000..d52bcaf25
--- /dev/null
+++ b/tests/ui/traits/new-solver/fn-trait.stderr
@@ -0,0 +1,124 @@
+error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() -> i32`
+ --> $DIR/fn-trait.rs:20:16
+ |
+LL | require_fn(f as unsafe fn() -> i32);
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Fn<()>` is not implemented for `unsafe fn() -> i32`
+ = note: wrap the `unsafe fn() -> i32` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `require_fn`
+ --> $DIR/fn-trait.rs:3:23
+ |
+LL | fn require_fn(_: impl Fn() -> i32) {}
+ | ^^^^^^^^^^^ required by this bound in `require_fn`
+
+error[E0271]: type mismatch resolving `<unsafe fn() -> i32 as FnOnce<()>>::Output == i32`
+ --> $DIR/fn-trait.rs:20:16
+ |
+LL | require_fn(f as unsafe fn() -> i32);
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ types differ
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `require_fn`
+ --> $DIR/fn-trait.rs:3:31
+ |
+LL | fn require_fn(_: impl Fn() -> i32) {}
+ | ^^^ required by this bound in `require_fn`
+
+error[E0277]: expected a `Fn<()>` closure, found `extern "C" fn() -> i32 {g}`
+ --> $DIR/fn-trait.rs:23:16
+ |
+LL | require_fn(g);
+ | ---------- ^ expected an `Fn<()>` closure, found `extern "C" fn() -> i32 {g}`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Fn<()>` is not implemented for fn item `extern "C" fn() -> i32 {g}`
+ = note: wrap the `extern "C" fn() -> i32 {g}` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `require_fn`
+ --> $DIR/fn-trait.rs:3:23
+ |
+LL | fn require_fn(_: impl Fn() -> i32) {}
+ | ^^^^^^^^^^^ required by this bound in `require_fn`
+
+error[E0271]: type mismatch resolving `<extern "C" fn() -> i32 {g} as FnOnce<()>>::Output == i32`
+ --> $DIR/fn-trait.rs:23:16
+ |
+LL | require_fn(g);
+ | ---------- ^ types differ
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `require_fn`
+ --> $DIR/fn-trait.rs:3:31
+ |
+LL | fn require_fn(_: impl Fn() -> i32) {}
+ | ^^^ required by this bound in `require_fn`
+
+error[E0277]: expected a `Fn<()>` closure, found `extern "C" fn() -> i32`
+ --> $DIR/fn-trait.rs:26:16
+ |
+LL | require_fn(g as extern "C" fn() -> i32);
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `extern "C" fn() -> i32`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Fn<()>` is not implemented for `extern "C" fn() -> i32`
+ = note: wrap the `extern "C" fn() -> i32` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `require_fn`
+ --> $DIR/fn-trait.rs:3:23
+ |
+LL | fn require_fn(_: impl Fn() -> i32) {}
+ | ^^^^^^^^^^^ required by this bound in `require_fn`
+
+error[E0271]: type mismatch resolving `<extern "C" fn() -> i32 as FnOnce<()>>::Output == i32`
+ --> $DIR/fn-trait.rs:26:16
+ |
+LL | require_fn(g as extern "C" fn() -> i32);
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `require_fn`
+ --> $DIR/fn-trait.rs:3:31
+ |
+LL | fn require_fn(_: impl Fn() -> i32) {}
+ | ^^^ required by this bound in `require_fn`
+
+error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() -> i32 {h}`
+ --> $DIR/fn-trait.rs:29:16
+ |
+LL | require_fn(h);
+ | ---------- ^ call the function in a closure: `|| unsafe { /* code */ }`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Fn<()>` is not implemented for fn item `unsafe fn() -> i32 {h}`
+ = note: wrap the `unsafe fn() -> i32 {h}` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `require_fn`
+ --> $DIR/fn-trait.rs:3:23
+ |
+LL | fn require_fn(_: impl Fn() -> i32) {}
+ | ^^^^^^^^^^^ required by this bound in `require_fn`
+
+error[E0271]: type mismatch resolving `<unsafe fn() -> i32 {h} as FnOnce<()>>::Output == i32`
+ --> $DIR/fn-trait.rs:29:16
+ |
+LL | require_fn(h);
+ | ---------- ^ types differ
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `require_fn`
+ --> $DIR/fn-trait.rs:3:31
+ |
+LL | fn require_fn(_: impl Fn() -> i32) {}
+ | ^^^ required by this bound in `require_fn`
+
+error: aborting due to 8 previous errors
+
+Some errors have detailed explanations: E0271, E0277.
+For more information about an error, try `rustc --explain E0271`.
diff --git a/tests/ui/traits/new-solver/int-var-alias-eq.rs b/tests/ui/traits/new-solver/int-var-alias-eq.rs
new file mode 100644
index 000000000..2da387db4
--- /dev/null
+++ b/tests/ui/traits/new-solver/int-var-alias-eq.rs
@@ -0,0 +1,18 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+
+// HIR typeck ends up equating `<_#0i as Add>::Output == _#0i`.
+// Want to make sure that we emit an alias-eq goal for this,
+// instead of treating it as a type error and bailing.
+
+fn test() {
+ // fallback
+ let x = 1 + 2;
+}
+
+fn test2() -> u32 {
+ // expectation from return ty
+ 1 + 2
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/int-var-is-send.rs b/tests/ui/traits/new-solver/int-var-is-send.rs
new file mode 100644
index 000000000..083aa90e1
--- /dev/null
+++ b/tests/ui/traits/new-solver/int-var-is-send.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+fn needs_send(_: impl Send) {}
+
+fn main() {
+ needs_send(1);
+}
diff --git a/tests/ui/traits/new-solver/iter-filter-projection.rs b/tests/ui/traits/new-solver/iter-filter-projection.rs
new file mode 100644
index 000000000..8fb62323a
--- /dev/null
+++ b/tests/ui/traits/new-solver/iter-filter-projection.rs
@@ -0,0 +1,12 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+use std::{iter, slice};
+
+struct Attr;
+
+fn test<'a, T: Iterator<Item = &'a Attr>>() {}
+
+fn main() {
+ test::<iter::Filter<slice::Iter<'_, Attr>, fn(&&Attr) -> bool>>();
+}
diff --git a/tests/ui/traits/new-solver/lazy-nested-obligations-1.rs b/tests/ui/traits/new-solver/lazy-nested-obligations-1.rs
new file mode 100644
index 000000000..af00cbb3b
--- /dev/null
+++ b/tests/ui/traits/new-solver/lazy-nested-obligations-1.rs
@@ -0,0 +1,13 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+// Issue 94358
+
+fn foo<C>(_: C)
+where
+ for <'a> &'a C: IntoIterator,
+ for <'a> <&'a C as IntoIterator>::IntoIter: ExactSizeIterator,
+{}
+
+fn main() {
+ foo::<_>(vec![true, false]);
+}
diff --git a/tests/ui/traits/new-solver/lazy-nested-obligations-2.rs b/tests/ui/traits/new-solver/lazy-nested-obligations-2.rs
new file mode 100644
index 000000000..32addd829
--- /dev/null
+++ b/tests/ui/traits/new-solver/lazy-nested-obligations-2.rs
@@ -0,0 +1,23 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+// Issue 95863
+
+pub trait With {
+ type F;
+}
+
+impl With for i32 {
+ type F = fn(&str);
+}
+
+fn f(_: &str) {}
+
+fn main() {
+ let _: V<i32> = V(f);
+ pub struct V<T: With>(<T as With>::F);
+
+ pub enum E3<T: With> {
+ Var(<T as With>::F),
+ }
+ let _: E3<i32> = E3::Var(f);
+}
diff --git a/tests/ui/traits/new-solver/lazy-nested-obligations-3.rs b/tests/ui/traits/new-solver/lazy-nested-obligations-3.rs
new file mode 100644
index 000000000..baf399572
--- /dev/null
+++ b/tests/ui/traits/new-solver/lazy-nested-obligations-3.rs
@@ -0,0 +1,38 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+// Issue 96750
+
+use std::marker::PhantomData;
+
+trait AsyncFn<Arg> {
+ type Output;
+}
+trait RequestFamily {
+ type Type<'a>;
+}
+trait Service {}
+
+struct MyFn;
+impl AsyncFn<String> for MyFn {
+ type Output = ();
+}
+
+impl RequestFamily for String {
+ type Type<'a> = String;
+}
+
+struct ServiceFromAsyncFn<F, Req>(F, PhantomData<Req>);
+
+impl<F, Req, O> Service for ServiceFromAsyncFn<F, Req>
+where
+ Req: RequestFamily,
+ F: AsyncFn<Req>,
+ F: for<'a> AsyncFn<Req::Type<'a>, Output = O>,
+{
+}
+
+fn assert_service() -> impl Service {
+ ServiceFromAsyncFn(MyFn, PhantomData)
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/more-object-bound.rs b/tests/ui/traits/new-solver/more-object-bound.rs
index 712759ef0..bb730b18e 100644
--- a/tests/ui/traits/new-solver/more-object-bound.rs
+++ b/tests/ui/traits/new-solver/more-object-bound.rs
@@ -10,7 +10,7 @@ trait Trait: SuperTrait<A = <Self as SuperTrait>::B> {}
fn transmute<A, B>(x: A) -> B {
foo::<A, B, dyn Trait<A = A, B = B>>(x)
- //~^ ERROR type annotations needed: cannot satisfy `dyn Trait<A = A, B = B>: Trait`
+ //~^ ERROR the trait bound `dyn Trait<A = A, B = B>: Trait` is not satisfied
}
fn foo<A, B, T: ?Sized>(x: T::A) -> B
diff --git a/tests/ui/traits/new-solver/more-object-bound.stderr b/tests/ui/traits/new-solver/more-object-bound.stderr
index 208fdecb0..4554b8c74 100644
--- a/tests/ui/traits/new-solver/more-object-bound.stderr
+++ b/tests/ui/traits/new-solver/more-object-bound.stderr
@@ -1,10 +1,9 @@
-error[E0283]: type annotations needed: cannot satisfy `dyn Trait<A = A, B = B>: Trait`
- --> $DIR/more-object-bound.rs:12:5
+error[E0277]: the trait bound `dyn Trait<A = A, B = B>: Trait` is not satisfied
+ --> $DIR/more-object-bound.rs:12:17
|
LL | foo::<A, B, dyn Trait<A = A, B = B>>(x)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `dyn Trait<A = A, B = B>`
|
- = note: cannot satisfy `dyn Trait<A = A, B = B>: Trait`
note: required by a bound in `foo`
--> $DIR/more-object-bound.rs:18:8
|
@@ -13,7 +12,11 @@ LL | fn foo<A, B, T: ?Sized>(x: T::A) -> B
LL | where
LL | T: Trait<B = B>,
| ^^^^^^^^^^^^ required by this bound in `foo`
+help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
+ |
+LL | fn transmute<A, B>(x: A) -> B where dyn Trait<A = A, B = B>: Trait {
+ | ++++++++++++++++++++++++++++++++++++
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0283`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/nested-obligations-with-bound-vars-gat.rs b/tests/ui/traits/new-solver/nested-obligations-with-bound-vars-gat.rs
new file mode 100644
index 000000000..92bad9590
--- /dev/null
+++ b/tests/ui/traits/new-solver/nested-obligations-with-bound-vars-gat.rs
@@ -0,0 +1,43 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+// Issue 96230
+
+use std::fmt::Debug;
+
+trait Classic {
+ type Assoc;
+}
+
+trait Gat {
+ type Assoc<'a>;
+}
+
+struct Foo;
+
+impl Classic for Foo {
+ type Assoc = ();
+}
+
+impl Gat for Foo {
+ type Assoc<'i> = ();
+}
+
+fn classic_debug<T: Classic>(_: T)
+where
+ T::Assoc: Debug,
+{
+}
+
+fn gat_debug<T: Gat>(_: T)
+where
+ for<'a> T::Assoc<'a>: Debug,
+{
+}
+
+fn main() {
+ classic_debug::<Foo>(Foo); // fine
+ classic_debug(Foo); // fine
+
+ gat_debug::<Foo>(Foo); // fine
+ gat_debug(Foo); // boom
+}
diff --git a/tests/ui/traits/new-solver/normalize-param-env-1.rs b/tests/ui/traits/new-solver/normalize-param-env-1.rs
new file mode 100644
index 000000000..b02a5d623
--- /dev/null
+++ b/tests/ui/traits/new-solver/normalize-param-env-1.rs
@@ -0,0 +1,40 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+// Issue 108933
+
+trait Add<Rhs> {
+ type Sum;
+}
+
+impl Add<()> for () {
+ type Sum = ();
+}
+
+type Unit = <() as Add<()>>::Sum;
+
+trait Trait<C> {
+ type Output;
+}
+
+fn f<T>()
+where
+ T: Trait<()>,
+ <T as Trait<()>>::Output: Sized,
+{
+}
+
+fn g<T>()
+where
+ T: Trait<Unit>,
+ <T as Trait<()>>::Output: Sized,
+{
+}
+
+fn h<T>()
+where
+ T: Trait<()>,
+ <T as Trait<Unit>>::Output: Sized,
+{
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/normalize-param-env-2.rs b/tests/ui/traits/new-solver/normalize-param-env-2.rs
new file mode 100644
index 000000000..7c2cebdd2
--- /dev/null
+++ b/tests/ui/traits/new-solver/normalize-param-env-2.rs
@@ -0,0 +1,26 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+// Issue 92505
+
+trait A<T> {
+ type I;
+
+ fn f()
+ where
+ Self::I: A<T>,
+ {
+ }
+}
+
+impl<T> A<T> for () {
+ type I = ();
+
+ fn f()
+ where
+ Self::I: A<T>,
+ {
+ <() as A<T>>::f();
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/normalize-param-env-3.rs b/tests/ui/traits/new-solver/normalize-param-env-3.rs
new file mode 100644
index 000000000..ce2974b2a
--- /dev/null
+++ b/tests/ui/traits/new-solver/normalize-param-env-3.rs
@@ -0,0 +1,32 @@
+// check-pass
+// compile-flags: -Ztrait-solver=next
+// Issue 100177
+
+trait GenericTrait<T> {}
+
+trait Channel<I>: GenericTrait<Self::T> {
+ type T;
+}
+
+trait Sender {
+ type Msg;
+
+ fn send<C>()
+ where
+ C: Channel<Self::Msg>;
+}
+
+impl<T> Sender for T {
+ type Msg = ();
+
+ fn send<C>()
+ where
+ C: Channel<Self::Msg>,
+ {
+ }
+}
+
+// This works
+fn foo<I, C>(ch: C) where C: Channel<I> {}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/param-discr-kind.rs b/tests/ui/traits/new-solver/param-discr-kind.rs
new file mode 100644
index 000000000..e319ddea1
--- /dev/null
+++ b/tests/ui/traits/new-solver/param-discr-kind.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+fn foo<T>(x: T) {
+ std::mem::discriminant(&x);
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/pointee.rs b/tests/ui/traits/new-solver/pointee.rs
index fa6ee2e2d..93c0542ac 100644
--- a/tests/ui/traits/new-solver/pointee.rs
+++ b/tests/ui/traits/new-solver/pointee.rs
@@ -7,17 +7,15 @@ use std::ptr::{DynMetadata, Pointee};
trait Trait<U> {}
struct MyDst<T: ?Sized>(T);
-fn works<T>() {
- let _: <T as Pointee>::Metadata = ();
- let _: <[T] as Pointee>::Metadata = 1_usize;
- let _: <str as Pointee>::Metadata = 1_usize;
- let _: <dyn Trait<T> as Pointee>::Metadata = give::<DynMetadata<dyn Trait<T>>>();
- let _: <MyDst<T> as Pointee>::Metadata = ();
- let _: <((((([u8],),),),),) as Pointee>::Metadata = 1_usize;
-}
+fn meta_is<T: Pointee<Metadata = U> + ?Sized, U>() {}
-fn give<U>() -> U {
- loop {}
+fn works<T>() {
+ meta_is::<T, ()>();
+ meta_is::<[T], usize>();
+ meta_is::<str, usize>();
+ meta_is::<dyn Trait<T>, DynMetadata<dyn Trait<T>>>();
+ meta_is::<MyDst<T>, ()>();
+ meta_is::<((((([u8],),),),),), usize>();
}
fn main() {}
diff --git a/tests/ui/traits/new-solver/pointer-like.rs b/tests/ui/traits/new-solver/pointer-like.rs
index 3745a075e..986301769 100644
--- a/tests/ui/traits/new-solver/pointer-like.rs
+++ b/tests/ui/traits/new-solver/pointer-like.rs
@@ -9,6 +9,6 @@ fn require_(_: impl PointerLike) {}
fn main() {
require_(1usize);
require_(1u16);
- //~^ ERROR `u16` needs to have the same alignment and size as a pointer
+ //~^ ERROR `u16` needs to have the same ABI as a pointer
require_(&1i16);
}
diff --git a/tests/ui/traits/new-solver/pointer-like.stderr b/tests/ui/traits/new-solver/pointer-like.stderr
index f695e6418..215a81cc2 100644
--- a/tests/ui/traits/new-solver/pointer-like.stderr
+++ b/tests/ui/traits/new-solver/pointer-like.stderr
@@ -1,4 +1,4 @@
-error[E0277]: `u16` needs to have the same alignment and size as a pointer
+error[E0277]: `u16` needs to have the same ABI as a pointer
--> $DIR/pointer-like.rs:11:14
|
LL | require_(1u16);
diff --git a/tests/ui/traits/new-solver/prefer-candidate-no-constraints.rs b/tests/ui/traits/new-solver/prefer-candidate-no-constraints.rs
new file mode 100644
index 000000000..6f8164f3a
--- /dev/null
+++ b/tests/ui/traits/new-solver/prefer-candidate-no-constraints.rs
@@ -0,0 +1,22 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+trait Foo {}
+
+impl<T> Foo for T {}
+
+trait Bar {}
+
+struct Wrapper<'a, T>(&'a T);
+
+impl<'a, T> Bar for Wrapper<'a, T> where &'a T: Foo {}
+// We need to satisfy `&'a T: Foo` when checking that this impl is WF
+// that can either be satisfied via the param-env, or via an impl.
+//
+// When satisfied via the param-env, since each lifetime is canonicalized
+// separately, we end up getting extra region constraints.
+//
+// However, when satisfied via the impl, there are no region constraints,
+// and we can short-circuit a response with no external constraints.
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/prefer-param-env-on-ambiguity.rs b/tests/ui/traits/new-solver/prefer-param-env-on-ambiguity.rs
new file mode 100644
index 000000000..909b33ec3
--- /dev/null
+++ b/tests/ui/traits/new-solver/prefer-param-env-on-ambiguity.rs
@@ -0,0 +1,10 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+trait Foo<'a> {}
+trait Bar<'a> {}
+
+impl<'a, T: Bar<'a>> Foo<'a> for T {}
+impl<T> Bar<'static> for T {}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/projection-discr-kind.rs b/tests/ui/traits/new-solver/projection-discr-kind.rs
new file mode 100644
index 000000000..20296b287
--- /dev/null
+++ b/tests/ui/traits/new-solver/projection-discr-kind.rs
@@ -0,0 +1,18 @@
+// compile-flags: -Ztrait-solver=next
+
+// Check that `<T::Assoc as DiscriminantKind>::Discriminant` doesn't normalize
+// to itself and cause overflow/ambiguity.
+
+trait Foo {
+ type Assoc;
+}
+
+trait Bar {}
+fn needs_bar(_: impl Bar) {}
+
+fn foo<T: Foo>(x: T::Assoc) {
+ needs_bar(std::mem::discriminant(&x));
+ //~^ ERROR the trait bound `Discriminant<<T as Foo>::Assoc>: Bar` is not satisfied
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/projection-discr-kind.stderr b/tests/ui/traits/new-solver/projection-discr-kind.stderr
new file mode 100644
index 000000000..03e28f993
--- /dev/null
+++ b/tests/ui/traits/new-solver/projection-discr-kind.stderr
@@ -0,0 +1,17 @@
+error[E0277]: the trait bound `Discriminant<<T as Foo>::Assoc>: Bar` is not satisfied
+ --> $DIR/projection-discr-kind.rs:14:15
+ |
+LL | needs_bar(std::mem::discriminant(&x));
+ | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `Discriminant<<T as Foo>::Assoc>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `needs_bar`
+ --> $DIR/projection-discr-kind.rs:11:22
+ |
+LL | fn needs_bar(_: impl Bar) {}
+ | ^^^ required by this bound in `needs_bar`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/recursive-self-normalization-2.rs b/tests/ui/traits/new-solver/recursive-self-normalization-2.rs
new file mode 100644
index 000000000..8c029f517
--- /dev/null
+++ b/tests/ui/traits/new-solver/recursive-self-normalization-2.rs
@@ -0,0 +1,19 @@
+// compile-flags: -Ztrait-solver=next
+
+trait Foo1 {
+ type Assoc1;
+}
+
+trait Foo2 {
+ type Assoc2;
+}
+
+trait Bar {}
+fn needs_bar<S: Bar>() {}
+
+fn test<T: Foo1<Assoc1 = <T as Foo2>::Assoc2> + Foo2<Assoc2 = <T as Foo1>::Assoc1>>() {
+ needs_bar::<T::Assoc1>();
+ //~^ ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar`
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/recursive-self-normalization-2.stderr b/tests/ui/traits/new-solver/recursive-self-normalization-2.stderr
new file mode 100644
index 000000000..139b0a456
--- /dev/null
+++ b/tests/ui/traits/new-solver/recursive-self-normalization-2.stderr
@@ -0,0 +1,16 @@
+error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar`
+ --> $DIR/recursive-self-normalization-2.rs:15: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
+ |
+LL | fn needs_bar<S: Bar>() {}
+ | ^^^ required by this bound in `needs_bar`
+
+error: aborting due to previous error
+
+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
new file mode 100644
index 000000000..06d187b5f
--- /dev/null
+++ b/tests/ui/traits/new-solver/recursive-self-normalization.rs
@@ -0,0 +1,15 @@
+// compile-flags: -Ztrait-solver=next
+
+trait Foo {
+ type Assoc;
+}
+
+trait Bar {}
+fn needs_bar<S: Bar>() {}
+
+fn test<T: Foo<Assoc = <T as Foo>::Assoc>>() {
+ needs_bar::<T::Assoc>();
+ //~^ ERROR overflow evaluating the requirement `<T as Foo>::Assoc: Bar`
+}
+
+fn main() {}
diff --git a/tests/ui/traits/new-solver/recursive-self-normalization.stderr b/tests/ui/traits/new-solver/recursive-self-normalization.stderr
new file mode 100644
index 000000000..8e9b9b4b4
--- /dev/null
+++ b/tests/ui/traits/new-solver/recursive-self-normalization.stderr
@@ -0,0 +1,16 @@
+error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc: Bar`
+ --> $DIR/recursive-self-normalization.rs:11: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
+ |
+LL | fn needs_bar<S: Bar>() {}
+ | ^^^ required by this bound in `needs_bar`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/traits/new-solver/runaway-impl-candidate-selection.rs b/tests/ui/traits/new-solver/runaway-impl-candidate-selection.rs
new file mode 100644
index 000000000..1dca86d36
--- /dev/null
+++ b/tests/ui/traits/new-solver/runaway-impl-candidate-selection.rs
@@ -0,0 +1,15 @@
+// compile-flags: -Ztrait-solver=next
+
+// In the new solver, we are trying to select `<?0 as Iterator>::Item: Debug`,
+// which, naively can be unified with every impl of `Debug` if we're not careful.
+// This test makes sure that we treat projections with inference var substs as
+// placeholders during fast reject.
+
+fn iter<T: Iterator>() -> <T as Iterator>::Item {
+ todo!()
+}
+
+fn main() {
+ println!("{:?}", iter::<_>());
+ //~^ ERROR type annotations needed
+}
diff --git a/tests/ui/traits/new-solver/runaway-impl-candidate-selection.stderr b/tests/ui/traits/new-solver/runaway-impl-candidate-selection.stderr
new file mode 100644
index 000000000..47004821a
--- /dev/null
+++ b/tests/ui/traits/new-solver/runaway-impl-candidate-selection.stderr
@@ -0,0 +1,9 @@
+error[E0282]: type annotations needed
+ --> $DIR/runaway-impl-candidate-selection.rs:13:22
+ |
+LL | println!("{:?}", iter::<_>());
+ | ^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `iter`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/traits/new-solver/specialization-transmute.rs b/tests/ui/traits/new-solver/specialization-transmute.rs
new file mode 100644
index 000000000..a54701df4
--- /dev/null
+++ b/tests/ui/traits/new-solver/specialization-transmute.rs
@@ -0,0 +1,30 @@
+// compile-flags: -Ztrait-solver=next
+
+#![feature(specialization)]
+//~^ WARN the feature `specialization` is incomplete
+
+trait Default {
+ type Id;
+
+ fn intu(&self) -> &Self::Id;
+}
+
+impl<T> Default for T {
+ default type Id = T;
+
+ fn intu(&self) -> &Self::Id {
+ self
+ //~^ ERROR cannot satisfy `T <: <T as Default>::Id`
+ }
+}
+
+fn transmute<T: Default<Id = U>, U: Copy>(t: T) -> U {
+ *t.intu()
+}
+
+use std::num::NonZeroU8;
+fn main() {
+ let s = transmute::<u8, Option<NonZeroU8>>(0);
+ //~^ ERROR cannot satisfy `<u8 as Default>::Id == Option<NonZeroU8>
+ assert_eq!(s, None);
+}
diff --git a/tests/ui/traits/new-solver/specialization-transmute.stderr b/tests/ui/traits/new-solver/specialization-transmute.stderr
new file mode 100644
index 000000000..e67c56afc
--- /dev/null
+++ b/tests/ui/traits/new-solver/specialization-transmute.stderr
@@ -0,0 +1,31 @@
+warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/specialization-transmute.rs:3:12
+ |
+LL | #![feature(specialization)]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
+ = 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
+ |
+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 transmute<T: Default<Id = U>, U: Copy>(t: T) -> U {
+ | ^^^^^^ required by this bound in `transmute`
+
+error: aborting due to 2 previous errors; 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
new file mode 100644
index 000000000..02150689e
--- /dev/null
+++ b/tests/ui/traits/new-solver/specialization-unconstrained.rs
@@ -0,0 +1,22 @@
+// compile-flags: -Ztrait-solver=next
+
+#![feature(specialization)]
+//~^ WARN the feature `specialization` is incomplete
+
+// Do not treat the RHS of a projection-goal as an unconstrained `Certainty::Yes` response
+// if the impl is still further specializable.
+
+trait Default {
+ type Id;
+}
+
+impl<T> Default for T {
+ default type Id = T;
+}
+
+fn test<T: Default<Id = U>, U>() {}
+
+fn main() {
+ test::<u32, ()>();
+ //~^ ERROR cannot satisfy `<u32 as Default>::Id == ()`
+}
diff --git a/tests/ui/traits/new-solver/specialization-unconstrained.stderr b/tests/ui/traits/new-solver/specialization-unconstrained.stderr
new file mode 100644
index 000000000..910925cba
--- /dev/null
+++ b/tests/ui/traits/new-solver/specialization-unconstrained.stderr
@@ -0,0 +1,25 @@
+warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/specialization-unconstrained.rs:3:12
+ |
+LL | #![feature(specialization)]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
+ = 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 `<u32 as Default>::Id == ()`
+ --> $DIR/specialization-unconstrained.rs:20:5
+ |
+LL | test::<u32, ()>();
+ | ^^^^^^^^^^^^^^^ cannot satisfy `<u32 as Default>::Id == ()`
+ |
+note: required by a bound in `test`
+ --> $DIR/specialization-unconstrained.rs:17:20
+ |
+LL | fn test<T: Default<Id = U>, U>() {}
+ | ^^^^^^ required by this bound in `test`
+
+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/stall-num-var-auto-trait.fallback.stderr b/tests/ui/traits/new-solver/stall-num-var-auto-trait.fallback.stderr
new file mode 100644
index 000000000..a3ab7836c
--- /dev/null
+++ b/tests/ui/traits/new-solver/stall-num-var-auto-trait.fallback.stderr
@@ -0,0 +1,17 @@
+error[E0277]: the trait bound `i32: Foo` is not satisfied
+ --> $DIR/stall-num-var-auto-trait.rs:18:15
+ |
+LL | needs_foo(x);
+ | --------- ^ the trait `Foo` is not implemented for `i32`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `needs_foo`
+ --> $DIR/stall-num-var-auto-trait.rs:14:22
+ |
+LL | fn needs_foo(x: impl Foo) {}
+ | ^^^ required by this bound in `needs_foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/stall-num-var-auto-trait.rs b/tests/ui/traits/new-solver/stall-num-var-auto-trait.rs
new file mode 100644
index 000000000..0539c3a42
--- /dev/null
+++ b/tests/ui/traits/new-solver/stall-num-var-auto-trait.rs
@@ -0,0 +1,25 @@
+// compile-flags: -Ztrait-solver=next
+// revisions: fallback constrain
+//[constrain] check-pass
+
+// Tests that we stall the `{integer}: Foo` obligation until after we
+// constrain the int type (or fallback occurs).
+
+#![feature(negative_impls, auto_traits)]
+
+auto trait Foo {}
+
+impl !Foo for i32 {}
+
+fn needs_foo(x: impl Foo) {}
+
+fn main() {
+ let mut x = 0;
+ needs_foo(x);
+ //[fallback]~^ ERROR the trait bound `i32: Foo` is not satisfied
+
+ #[cfg(constrain)]
+ {
+ x = 1u64;
+ }
+}
diff --git a/tests/ui/traits/non_lifetime_binders/bad-copy-cond.rs b/tests/ui/traits/non_lifetime_binders/bad-copy-cond.rs
new file mode 100644
index 000000000..506cad25f
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/bad-copy-cond.rs
@@ -0,0 +1,9 @@
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+fn foo() where for<T> T: Copy {}
+
+fn main() {
+ foo();
+ //~^ ERROR the trait bound `T: Copy` is not satisfied
+}
diff --git a/tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr b/tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr
new file mode 100644
index 000000000..07e02d47f
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr
@@ -0,0 +1,24 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/bad-copy-cond.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]: the trait bound `T: Copy` is not satisfied
+ --> $DIR/bad-copy-cond.rs:7:5
+ |
+LL | foo();
+ | ^^^ the trait `Copy` is not implemented for `T`
+ |
+note: required by a bound in `foo`
+ --> $DIR/bad-copy-cond.rs:4:26
+ |
+LL | fn foo() where for<T> T: Copy {}
+ | ^^^^ required by this bound in `foo`
+
+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/capture-late-ct-in-anon.rs b/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs
new file mode 100644
index 000000000..91c6dfb8e
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs
@@ -0,0 +1,11 @@
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+fn b()
+where
+ for<const C: usize> [(); C]: Copy,
+ //~^ ERROR cannot capture late-bound const parameter in a constant
+{
+}
+
+fn main() {}
diff --git a/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr b/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr
new file mode 100644
index 000000000..69bb605bf
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr
@@ -0,0 +1,19 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/capture-late-ct-in-anon.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: cannot capture late-bound const parameter in a constant
+ --> $DIR/capture-late-ct-in-anon.rs:6:30
+ |
+LL | for<const C: usize> [(); C]: Copy,
+ | -------------- ^
+ | |
+ | parameter defined here
+
+error: aborting due to previous error; 1 warning emitted
+
diff --git a/tests/ui/traits/non_lifetime_binders/method-probe.rs b/tests/ui/traits/non_lifetime_binders/method-probe.rs
new file mode 100644
index 000000000..8df240c20
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/method-probe.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+trait Foo: for<T> Bar<T> {}
+
+trait Bar<T> {
+ fn method() -> T;
+}
+
+fn x<T: Foo>() {
+ let _: i32 = T::method();
+}
+
+fn main() {}
diff --git a/tests/ui/traits/non_lifetime_binders/method-probe.stderr b/tests/ui/traits/non_lifetime_binders/method-probe.stderr
new file mode 100644
index 000000000..8f61792e6
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/method-probe.stderr
@@ -0,0 +1,11 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/method-probe.rs:3: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
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/traits/non_lifetime_binders/missing-assoc-item.rs b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.rs
new file mode 100644
index 000000000..50f0152e9
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.rs
@@ -0,0 +1,11 @@
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+fn f()
+where
+ for<B> B::Item: Send,
+ //~^ ERROR ambiguous associated type
+{
+}
+
+fn main() {}
diff --git a/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr
new file mode 100644
index 000000000..d98538642
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr
@@ -0,0 +1,23 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/missing-assoc-item.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[E0223]: ambiguous associated type
+ --> $DIR/missing-assoc-item.rs:6:12
+ |
+LL | for<B> B::Item: Send,
+ | ^^^^^^^
+ |
+help: if there were a trait named `Example` with associated type `Item` implemented for `B`, you could use the fully-qualified path
+ |
+LL | for<B> <B as Example>::Item: Send,
+ | ~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0223`.
diff --git a/tests/ui/traits/non_lifetime_binders/supertrait-object-safety.rs b/tests/ui/traits/non_lifetime_binders/supertrait-object-safety.rs
new file mode 100644
index 000000000..a635edb44
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/supertrait-object-safety.rs
@@ -0,0 +1,24 @@
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+trait Foo: for<T> Bar<T> {}
+
+trait Bar<T: ?Sized> {
+ fn method(&self) {}
+}
+
+fn needs_bar(x: &(impl Bar<i32> + ?Sized)) {
+ x.method();
+}
+
+impl Foo for () {}
+
+impl<T: ?Sized> Bar<T> for () {}
+
+fn main() {
+ let x: &dyn Foo = &();
+ //~^ ERROR the trait `Foo` cannot be made into an object
+ //~| ERROR the trait `Foo` cannot be made into an object
+ needs_bar(x);
+ //~^ ERROR the trait `Foo` cannot be made into an object
+}
diff --git a/tests/ui/traits/non_lifetime_binders/supertrait-object-safety.stderr b/tests/ui/traits/non_lifetime_binders/supertrait-object-safety.stderr
new file mode 100644
index 000000000..47fa29b66
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/supertrait-object-safety.stderr
@@ -0,0 +1,56 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/supertrait-object-safety.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[E0038]: the trait `Foo` cannot be made into an object
+ --> $DIR/supertrait-object-safety.rs:19:23
+ |
+LL | let x: &dyn Foo = &();
+ | ^^^ `Foo` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/supertrait-object-safety.rs:4:12
+ |
+LL | trait Foo: for<T> Bar<T> {}
+ | --- ^^^^^^^^^^^^^ ...because where clause cannot reference non-lifetime `for<...>` variables
+ | |
+ | this trait cannot be made into an object...
+ = note: required for `&()` to implement `CoerceUnsized<&dyn Foo>`
+ = note: required by cast to type `&dyn Foo`
+
+error[E0038]: the trait `Foo` cannot be made into an object
+ --> $DIR/supertrait-object-safety.rs:19:12
+ |
+LL | let x: &dyn Foo = &();
+ | ^^^^^^^^ `Foo` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/supertrait-object-safety.rs:4:12
+ |
+LL | trait Foo: for<T> Bar<T> {}
+ | --- ^^^^^^^^^^^^^ ...because where clause cannot reference non-lifetime `for<...>` variables
+ | |
+ | this trait cannot be made into an object...
+
+error[E0038]: the trait `Foo` cannot be made into an object
+ --> $DIR/supertrait-object-safety.rs:22:5
+ |
+LL | needs_bar(x);
+ | ^^^^^^^^^ `Foo` cannot be made into an object
+ |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/supertrait-object-safety.rs:4:12
+ |
+LL | trait Foo: for<T> Bar<T> {}
+ | --- ^^^^^^^^^^^^^ ...because where clause cannot reference non-lifetime `for<...>` variables
+ | |
+ | this trait cannot be made into an object...
+
+error: aborting due to 3 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/traits/reservation-impl/coherence-conflict.next.stderr b/tests/ui/traits/reservation-impl/coherence-conflict.next.stderr
new file mode 100644
index 000000000..e5a3c3f5c
--- /dev/null
+++ b/tests/ui/traits/reservation-impl/coherence-conflict.next.stderr
@@ -0,0 +1,11 @@
+error[E0119]: conflicting implementations of trait `OtherTrait` for type `()`
+ --> $DIR/coherence-conflict.rs:12:1
+ |
+LL | impl OtherTrait for () {}
+ | ---------------------- first implementation here
+LL | impl<T: MyTrait> OtherTrait for T {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/traits/reservation-impl/coherence-conflict.stderr b/tests/ui/traits/reservation-impl/coherence-conflict.old.stderr
index a811d7e32..393350ea3 100644
--- a/tests/ui/traits/reservation-impl/coherence-conflict.stderr
+++ b/tests/ui/traits/reservation-impl/coherence-conflict.old.stderr
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `OtherTrait` for type `()`
- --> $DIR/coherence-conflict.rs:11:1
+ --> $DIR/coherence-conflict.rs:12:1
|
LL | impl OtherTrait for () {}
| ---------------------- first implementation here
diff --git a/tests/ui/traits/reservation-impl/coherence-conflict.rs b/tests/ui/traits/reservation-impl/coherence-conflict.rs
index fa4a30931..6bbd90f94 100644
--- a/tests/ui/traits/reservation-impl/coherence-conflict.rs
+++ b/tests/ui/traits/reservation-impl/coherence-conflict.rs
@@ -1,5 +1,6 @@
// check that reservation impls are accounted for in negative reasoning.
-
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
#![feature(rustc_attrs)]
trait MyTrait {}
diff --git a/tests/ui/traits/reservation-impl/no-use.stderr b/tests/ui/traits/reservation-impl/no-use.next.stderr
index cefb2a879..542e3a28a 100644
--- a/tests/ui/traits/reservation-impl/no-use.stderr
+++ b/tests/ui/traits/reservation-impl/no-use.next.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `(): MyTrait` is not satisfied
- --> $DIR/no-use.rs:10:26
+ --> $DIR/no-use.rs:11:26
|
LL | <() as MyTrait>::foo(&());
| -------------------- ^^^ the trait `MyTrait` is not implemented for `()`
diff --git a/tests/ui/traits/reservation-impl/no-use.old.stderr b/tests/ui/traits/reservation-impl/no-use.old.stderr
new file mode 100644
index 000000000..542e3a28a
--- /dev/null
+++ b/tests/ui/traits/reservation-impl/no-use.old.stderr
@@ -0,0 +1,13 @@
+error[E0277]: the trait bound `(): MyTrait` is not satisfied
+ --> $DIR/no-use.rs:11:26
+ |
+LL | <() as MyTrait>::foo(&());
+ | -------------------- ^^^ the trait `MyTrait` is not implemented for `()`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `MyTrait` is implemented for `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/reservation-impl/no-use.rs b/tests/ui/traits/reservation-impl/no-use.rs
index 65a55d9e2..864f1791f 100644
--- a/tests/ui/traits/reservation-impl/no-use.rs
+++ b/tests/ui/traits/reservation-impl/no-use.rs
@@ -1,5 +1,6 @@
// check that reservation impls can't be used as normal impls in positive reasoning.
-
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
#![feature(rustc_attrs)]
trait MyTrait { fn foo(&self); }
diff --git a/tests/ui/traits/reservation-impl/non-lattice-ok.rs b/tests/ui/traits/reservation-impl/non-lattice-ok.rs
index a71051243..7787904d9 100644
--- a/tests/ui/traits/reservation-impl/non-lattice-ok.rs
+++ b/tests/ui/traits/reservation-impl/non-lattice-ok.rs
@@ -30,6 +30,12 @@
//
// [ii]: https://smallcultfollowing.com/babysteps/blog/2016/09/24/intersection-impls/
+
+// check that reservation impls can't be used as normal impls in positive reasoning.
+
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
+
#![feature(rustc_attrs, never_type)]
trait MyTrait {}
diff --git a/tests/ui/traits/reservation-impl/ok.rs b/tests/ui/traits/reservation-impl/ok.rs
index 611c8d884..8ff6645a2 100644
--- a/tests/ui/traits/reservation-impl/ok.rs
+++ b/tests/ui/traits/reservation-impl/ok.rs
@@ -3,6 +3,9 @@
// rpass test for reservation impls. Not 100% required because `From` uses them,
// but still.
+// revisions: old next
+//[next] compile-flags: -Ztrait-solver=next
+
#![feature(rustc_attrs)]
use std::mem;
diff --git a/tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.rs b/tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.rs
new file mode 100644
index 000000000..d37943b92
--- /dev/null
+++ b/tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.rs
@@ -0,0 +1,34 @@
+//~ ERROR overflow
+// A regression test for #111729 checking that we correctly
+// track recursion depth for obligations returned by confirmation.
+use std::panic::RefUnwindSafe;
+
+trait Database {
+ type Storage;
+}
+trait Query<DB> {
+ type Data;
+}
+struct ParseQuery;
+struct RootDatabase {
+ _runtime: Runtime<RootDatabase>,
+}
+
+impl<T: RefUnwindSafe> Database for T {
+ type Storage = SalsaStorage;
+}
+impl Database for RootDatabase {
+ type Storage = SalsaStorage;
+}
+
+struct Runtime<DB: Database> {
+ _storage: Box<DB::Storage>,
+}
+struct SalsaStorage {
+ _parse: <ParseQuery as Query<RootDatabase>>::Data,
+}
+
+impl<DB: Database> Query<DB> for ParseQuery {
+ type Data = RootDatabase;
+}
+fn main() {}
diff --git a/tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.stderr b/tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.stderr
new file mode 100644
index 000000000..8f9ce3ef1
--- /dev/null
+++ b/tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.stderr
@@ -0,0 +1,24 @@
+error[E0275]: overflow evaluating the requirement `Runtime<RootDatabase>: RefUnwindSafe`
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`cycle_via_builtin_auto_trait_impl`)
+note: required because it appears within the type `RootDatabase`
+ --> $DIR/cycle-via-builtin-auto-trait-impl.rs:13:8
+ |
+LL | struct RootDatabase {
+ | ^^^^^^^^^^^^
+note: required for `RootDatabase` to implement `Database`
+ --> $DIR/cycle-via-builtin-auto-trait-impl.rs:17:24
+ |
+LL | impl<T: RefUnwindSafe> Database for T {
+ | ------------- ^^^^^^^^ ^
+ | |
+ | unsatisfied trait bound introduced here
+note: required because it appears within the type `Runtime<RootDatabase>`
+ --> $DIR/cycle-via-builtin-auto-trait-impl.rs:24:8
+ |
+LL | struct Runtime<DB: Database> {
+ | ^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.rs b/tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.rs
new file mode 100644
index 000000000..4a5e445d1
--- /dev/null
+++ b/tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.rs
@@ -0,0 +1,33 @@
+#![feature(trait_upcasting)]
+#![feature(trait_alias)]
+
+// Although we *elaborate* `T: Alias` to `i32: B`, we should
+// not consider `B` to be a supertrait of the type.
+trait Alias = A where i32: B;
+
+trait A {}
+
+trait B {
+ fn test(&self);
+}
+
+trait C: Alias {}
+
+impl A for () {}
+
+impl C for () {}
+
+impl B for i32 {
+ fn test(&self) {
+ println!("hi {self}");
+ }
+}
+
+fn test(x: &dyn C) -> &dyn B {
+ x
+ //~^ ERROR mismatched types
+}
+
+fn main() {
+ let x: &dyn C = &();
+}
diff --git a/tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.stderr b/tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.stderr
new file mode 100644
index 000000000..5574a0320
--- /dev/null
+++ b/tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/alias-where-clause-isnt-supertrait.rs:27:5
+ |
+LL | fn test(x: &dyn C) -> &dyn B {
+ | ------ expected `&dyn B` because of return type
+LL | x
+ | ^ expected trait `B`, found trait `C`
+ |
+ = note: expected reference `&dyn B`
+ found reference `&dyn C`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr b/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr
index 15faab16a..ca98e1831 100644
--- a/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr
+++ b/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr
@@ -1,15 +1,10 @@
error[E0391]: cycle detected when computing the super predicates of `A`
- --> $DIR/cyclic-trait-resolution.rs:1:1
- |
-LL | trait A: B + A {}
- | ^^^^^^^^^^^^^^
- |
-note: ...which requires computing the super traits of `A`...
--> $DIR/cyclic-trait-resolution.rs:1:14
|
LL | trait A: B + A {}
| ^
- = note: ...which again requires computing the super predicates of `A`, completing the cycle
+ |
+ = note: ...which immediately requires computing the super predicates of `A` again
note: cycle used when collecting item types in top-level module
--> $DIR/cyclic-trait-resolution.rs:1:1
|
diff --git a/tests/ui/wrong-mul-method-signature.rs b/tests/ui/traits/wrong-mul-method-signature.rs
index 1c2f86559..1c2f86559 100644
--- a/tests/ui/wrong-mul-method-signature.rs
+++ b/tests/ui/traits/wrong-mul-method-signature.rs
diff --git a/tests/ui/wrong-mul-method-signature.stderr b/tests/ui/traits/wrong-mul-method-signature.stderr
index 25a92f5ec..25a92f5ec 100644
--- a/tests/ui/wrong-mul-method-signature.stderr
+++ b/tests/ui/traits/wrong-mul-method-signature.stderr
diff --git a/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr b/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr
index 164e88ede..1a0a5d3ae 100644
--- a/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr
+++ b/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:26:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `[String; 0]` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<[String; 0], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -20,13 +19,12 @@ LL | | .and(Assume::VALIDITY)
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `[String; 0]` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `[String; 0]` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:27:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 0]` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `[String; 0]` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[String; 0]`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -42,13 +40,12 @@ LL | | .and(Assume::VALIDITY)
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `[String; 1]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `[String; 1]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:32:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `[String; 1]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `[String; 1]` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<[String; 1], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -64,13 +61,12 @@ LL | | .and(Assume::VALIDITY)
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `[String; 1]` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `[String; 1]` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:33:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 1]` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `[String; 1]` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[String; 1]`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -86,13 +82,12 @@ LL | | .and(Assume::VALIDITY)
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `[String; 2]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `[String; 2]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:38:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `[String; 2]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `[String; 2]` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<[String; 2], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -108,13 +103,12 @@ LL | | .and(Assume::VALIDITY)
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `[String; 2]` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `[String; 2]` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:39:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 2]` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `[String; 2]` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[String; 2]`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
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 0f0f77f16..9877a6606 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
@@ -1,10 +1,9 @@
-error[E0277]: `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context`.
+error[E0277]: `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:48:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context`.
+ | ^^^^^^^ The size of `Zst` is smaller than the size of `V0i8`
|
- = help: the trait `BikeshedIntrinsicFrom<Zst, n8::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0i8`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -21,13 +20,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0i8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`.
+error[E0277]: `V0i8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:50:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0i8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`.
+ | ^^^^^^ The size of `V0i8` is smaller than the size of `u16`
|
- = help: the trait `BikeshedIntrinsicFrom<V0i8, n8::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u16`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -44,13 +42,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `Zst` cannot be safely transmuted into `V0u8` in the defining scope of `n8::Context`.
+error[E0277]: `Zst` cannot be safely transmuted into `V0u8` in the defining scope of `n8::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:56:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `Zst` cannot be safely transmuted into `V0u8` in the defining scope of `n8::Context`.
+ | ^^^^^^^ The size of `Zst` is smaller than the size of `V0u8`
|
- = help: the trait `BikeshedIntrinsicFrom<Zst, n8::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0u8`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -67,13 +64,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0u8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`.
+error[E0277]: `V0u8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:58:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0u8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`.
+ | ^^^^^^ The size of `V0u8` is smaller than the size of `u16`
|
- = help: the trait `BikeshedIntrinsicFrom<V0u8, n8::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u16`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -90,13 +86,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `V0i16` in the defining scope of `n16::Context`.
+error[E0277]: `u8` cannot be safely transmuted into `V0i16` in the defining scope of `n16::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:72:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `u8` cannot be safely transmuted into `V0i16` in the defining scope of `n16::Context`.
+ | ^^^^^^^ At least one value of `u8` isn't a bit-valid value of `V0i16`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, n16::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0i16`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -113,13 +108,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0i16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`.
+error[E0277]: `V0i16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:74:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0i16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`.
+ | ^^^^^^ The size of `V0i16` is smaller than the size of `u32`
|
- = help: the trait `BikeshedIntrinsicFrom<V0i16, n16::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u32`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -136,13 +130,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `V0u16` in the defining scope of `n16::Context`.
+error[E0277]: `u8` cannot be safely transmuted into `V0u16` in the defining scope of `n16::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:80:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `u8` cannot be safely transmuted into `V0u16` in the defining scope of `n16::Context`.
+ | ^^^^^^^ At least one value of `u8` isn't a bit-valid value of `V0u16`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, n16::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0u16`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -159,13 +152,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0u16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`.
+error[E0277]: `V0u16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:82:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0u16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`.
+ | ^^^^^^ The size of `V0u16` is smaller than the size of `u32`
|
- = help: the trait `BikeshedIntrinsicFrom<V0u16, n16::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u32`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -182,13 +174,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `V0i32` in the defining scope of `n32::Context`.
+error[E0277]: `u16` cannot be safely transmuted into `V0i32` in the defining scope of `n32::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:96:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `u16` cannot be safely transmuted into `V0i32` in the defining scope of `n32::Context`.
+ | ^^^^^^^ At least one value of `u16` isn't a bit-valid value of `V0i32`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, n32::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0i32`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -205,13 +196,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0i32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`.
+error[E0277]: `V0i32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:98:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0i32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`.
+ | ^^^^^^ The size of `V0i32` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<V0i32, n32::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -228,13 +218,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `V0u32` in the defining scope of `n32::Context`.
+error[E0277]: `u16` cannot be safely transmuted into `V0u32` in the defining scope of `n32::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:104:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `u16` cannot be safely transmuted into `V0u32` in the defining scope of `n32::Context`.
+ | ^^^^^^^ At least one value of `u16` isn't a bit-valid value of `V0u32`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, n32::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0u32`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -251,13 +240,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0u32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`.
+error[E0277]: `V0u32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:106:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0u32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`.
+ | ^^^^^^ The size of `V0u32` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<V0u32, n32::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -274,13 +262,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `u32` cannot be safely transmuted into `V0i64` in the defining scope of `n64::Context`.
+error[E0277]: `u32` cannot be safely transmuted into `V0i64` in the defining scope of `n64::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:120:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `u32` cannot be safely transmuted into `V0i64` in the defining scope of `n64::Context`.
+ | ^^^^^^^ At least one value of `u32` isn't a bit-valid value of `V0i64`
|
- = help: the trait `BikeshedIntrinsicFrom<u32, n64::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0i64`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -297,13 +284,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0i64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`.
+error[E0277]: `V0i64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:122:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0i64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`.
+ | ^^^^^^ The size of `V0i64` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<V0i64, n64::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -320,13 +306,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `u32` cannot be safely transmuted into `V0u64` in the defining scope of `n64::Context`.
+error[E0277]: `u32` cannot be safely transmuted into `V0u64` in the defining scope of `n64::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:128:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `u32` cannot be safely transmuted into `V0u64` in the defining scope of `n64::Context`.
+ | ^^^^^^^ At least one value of `u32` isn't a bit-valid value of `V0u64`
|
- = help: the trait `BikeshedIntrinsicFrom<u32, n64::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0u64`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -343,13 +328,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0u64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`.
+error[E0277]: `V0u64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:130:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0u64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`.
+ | ^^^^^^ The size of `V0u64` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<V0u64, n64::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -366,13 +350,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `V0isize` in the defining scope of `nsize::Context`.
+error[E0277]: `u8` cannot be safely transmuted into `V0isize` in the defining scope of `nsize::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:144:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `u8` cannot be safely transmuted into `V0isize` in the defining scope of `nsize::Context`.
+ | ^^^^^^^ At least one value of `u8` isn't a bit-valid value of `V0isize`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, nsize::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0isize`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -389,13 +372,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0isize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`.
+error[E0277]: `V0isize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:146:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0isize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`.
+ | ^^^^^^ The size of `V0isize` is smaller than the size of `[usize; 2]`
|
- = help: the trait `BikeshedIntrinsicFrom<V0isize, nsize::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[usize; 2]`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -412,13 +394,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `V0usize` in the defining scope of `nsize::Context`.
+error[E0277]: `u8` cannot be safely transmuted into `V0usize` in the defining scope of `nsize::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:152:44
|
LL | assert::is_transmutable::<Smaller, Current, Context>();
- | ^^^^^^^ `u8` cannot be safely transmuted into `V0usize` in the defining scope of `nsize::Context`.
+ | ^^^^^^^ At least one value of `u8` isn't a bit-valid value of `V0usize`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, nsize::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0usize`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
@@ -435,13 +416,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_transmutable`
-error[E0277]: `V0usize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`.
+error[E0277]: `V0usize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`
--> $DIR/primitive_reprs_should_have_correct_length.rs:154:44
|
LL | assert::is_transmutable::<Current, Larger, Context>();
- | ^^^^^^ `V0usize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`.
+ | ^^^^^^ The size of `V0usize` is smaller than the size of `[usize; 2]`
|
- = help: the trait `BikeshedIntrinsicFrom<V0usize, nsize::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[usize; 2]`
note: required by a bound in `is_transmutable`
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
diff --git a/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr
index d456a746f..1612b6b36 100644
--- a/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr
+++ b/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:28:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `void::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<void::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:14:14
|
@@ -21,13 +20,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `void::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `void::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:29:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `void::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `void::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `void::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:14:14
|
@@ -44,13 +42,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `singleton::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `singleton::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:34:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `singleton::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `singleton::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<singleton::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:14:14
|
@@ -67,13 +64,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `singleton::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `singleton::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:35:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `singleton::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `singleton::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `singleton::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:14:14
|
@@ -90,13 +86,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `duplex::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `duplex::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:40:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `duplex::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `duplex::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<duplex::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:14:14
|
@@ -113,13 +108,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `duplex::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `duplex::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:41:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `duplex::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `duplex::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `duplex::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:14:14
|
diff --git a/tests/ui/transmutability/enums/should_pad_variants.stderr b/tests/ui/transmutability/enums/should_pad_variants.stderr
index f4988239d..bfbef8b25 100644
--- a/tests/ui/transmutability/enums/should_pad_variants.stderr
+++ b/tests/ui/transmutability/enums/should_pad_variants.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
+error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`
--> $DIR/should_pad_variants.rs:44:36
|
LL | assert::is_transmutable::<Src, Dst, Context>();
- | ^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
+ | ^^^ The size of `Src` is smaller than the size of `Dst`
|
- = help: the trait `BikeshedIntrinsicFrom<Src, should_pad_variants::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `Dst`
note: required by a bound in `is_transmutable`
--> $DIR/should_pad_variants.rs:13:14
|
diff --git a/tests/ui/transmutability/enums/should_respect_endianness.stderr b/tests/ui/transmutability/enums/should_respect_endianness.stderr
index 350583b0b..e59301a8c 100644
--- a/tests/ui/transmutability/enums/should_respect_endianness.stderr
+++ b/tests/ui/transmutability/enums/should_respect_endianness.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context`.
+error[E0277]: `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context`
--> $DIR/should_respect_endianness.rs:36:36
|
LL | assert::is_transmutable::<Src, Unexpected>();
- | ^^^^^^^^^^ `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^^ At least one value of `Src` isn't a bit-valid value of `Unexpected`
|
- = help: the trait `BikeshedIntrinsicFrom<Src, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `Unexpected`
note: required by a bound in `is_transmutable`
--> $DIR/should_respect_endianness.rs:14:14
|
diff --git a/tests/ui/transmutability/issue-101739-1.rs b/tests/ui/transmutability/issue-101739-1.rs
index bcb8b158e..2b9666091 100644
--- a/tests/ui/transmutability/issue-101739-1.rs
+++ b/tests/ui/transmutability/issue-101739-1.rs
@@ -6,7 +6,7 @@ mod assert {
pub fn is_transmutable<Src, Context, const ASSUME_ALIGNMENT: bool>()
where
Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope
- //~^ ERROR mismatched types
+ //~^ the constant `ASSUME_ALIGNMENT` is not of type `Assume`
{
}
}
diff --git a/tests/ui/transmutability/issue-101739-1.stderr b/tests/ui/transmutability/issue-101739-1.stderr
index 7c6b533ef..bf947d0ea 100644
--- a/tests/ui/transmutability/issue-101739-1.stderr
+++ b/tests/ui/transmutability/issue-101739-1.stderr
@@ -4,13 +4,15 @@ error[E0412]: cannot find type `Dst` in this scope
LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>,
| ^^^ not found in this scope
-error[E0308]: mismatched types
- --> $DIR/issue-101739-1.rs:8:50
+error: the constant `ASSUME_ALIGNMENT` is not of type `Assume`
+ --> $DIR/issue-101739-1.rs:8:14
|
LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>,
- | ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Assume`, found `bool`
+ |
+note: required by a bound in `BikeshedIntrinsicFrom`
+ --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL
error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0308, E0412.
-For more information about an error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/transmutability/primitives/bool.stderr b/tests/ui/transmutability/primitives/bool.current.stderr
index 22decf15e..47c8438a2 100644
--- a/tests/ui/transmutability/primitives/bool.stderr
+++ b/tests/ui/transmutability/primitives/bool.current.stderr
@@ -1,12 +1,11 @@
-error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`.
- --> $DIR/bool.rs:22:35
+error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`
+ --> $DIR/bool.rs:24:35
|
LL | assert::is_transmutable::<u8, bool>();
- | ^^^^ `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`.
+ | ^^^^ At least one value of `u8` isn't a bit-valid value of `bool`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `bool`
note: required by a bound in `is_transmutable`
- --> $DIR/bool.rs:12:14
+ --> $DIR/bool.rs:14: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
new file mode 100644
index 000000000..47c8438a2
--- /dev/null
+++ b/tests/ui/transmutability/primitives/bool.next.stderr
@@ -0,0 +1,18 @@
+error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`
+ --> $DIR/bool.rs:24: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
+ |
+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.rs b/tests/ui/transmutability/primitives/bool.rs
index eebb74fff..de77cfc78 100644
--- a/tests/ui/transmutability/primitives/bool.rs
+++ b/tests/ui/transmutability/primitives/bool.rs
@@ -1,8 +1,10 @@
+// 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;
diff --git a/tests/ui/transmutability/primitives/numbers.stderr b/tests/ui/transmutability/primitives/numbers.current.stderr
index c04a0e82a..d12e17297 100644
--- a/tests/ui/transmutability/primitives/numbers.stderr
+++ b/tests/ui/transmutability/primitives/numbers.current.stderr
@@ -1,12 +1,11 @@
-error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:62:40
+error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:65:40
|
LL | assert::is_transmutable::< i8, i16>();
- | ^^^ `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i8` is smaller than the size of `i16`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i16`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -14,15 +13,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:63:40
+error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:66:40
|
LL | assert::is_transmutable::< i8, u16>();
- | ^^^ `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i8` is smaller than the size of `u16`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u16`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -30,15 +28,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:64:40
+error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:67:40
|
LL | assert::is_transmutable::< i8, i32>();
- | ^^^ `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i8` is smaller than the size of `i32`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -46,15 +43,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:65:40
+error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:68:40
|
LL | assert::is_transmutable::< i8, f32>();
- | ^^^ `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i8` is smaller than the size of `f32`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -62,15 +58,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:66:40
+error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:69:40
|
LL | assert::is_transmutable::< i8, u32>();
- | ^^^ `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i8` is smaller than the size of `u32`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -78,15 +73,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:67:40
+error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:70:40
|
LL | assert::is_transmutable::< i8, u64>();
- | ^^^ `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i8` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -94,15 +88,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:68:40
+error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:71:40
|
LL | assert::is_transmutable::< i8, i64>();
- | ^^^ `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i8` is smaller than the size of `i64`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -110,15 +103,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:69:40
+error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:72:40
|
LL | assert::is_transmutable::< i8, f64>();
- | ^^^ `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i8` is smaller than the size of `f64`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -126,15 +118,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:70:39
+error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:73:39
|
LL | assert::is_transmutable::< i8, u128>();
- | ^^^^ `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `i8` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -142,15 +133,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:71:39
+error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:74:39
|
LL | assert::is_transmutable::< i8, i128>();
- | ^^^^ `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `i8` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -158,15 +148,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:73:40
+error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:76:40
|
LL | assert::is_transmutable::< u8, i16>();
- | ^^^ `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u8` is smaller than the size of `i16`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i16`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -174,15 +163,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:74:40
+error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:77:40
|
LL | assert::is_transmutable::< u8, u16>();
- | ^^^ `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u8` is smaller than the size of `u16`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u16`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -190,15 +178,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:75:40
+error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:78:40
|
LL | assert::is_transmutable::< u8, i32>();
- | ^^^ `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u8` is smaller than the size of `i32`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -206,15 +193,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:76:40
+error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:79:40
|
LL | assert::is_transmutable::< u8, f32>();
- | ^^^ `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u8` is smaller than the size of `f32`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -222,15 +208,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:77:40
+error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:80:40
|
LL | assert::is_transmutable::< u8, u32>();
- | ^^^ `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u8` is smaller than the size of `u32`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -238,15 +223,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:78:40
+error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:81:40
|
LL | assert::is_transmutable::< u8, u64>();
- | ^^^ `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u8` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -254,15 +238,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:79:40
+error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:82:40
|
LL | assert::is_transmutable::< u8, i64>();
- | ^^^ `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u8` is smaller than the size of `i64`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -270,15 +253,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:80:40
+error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:83:40
|
LL | assert::is_transmutable::< u8, f64>();
- | ^^^ `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u8` is smaller than the size of `f64`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -286,15 +268,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:81:39
+error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:84:39
|
LL | assert::is_transmutable::< u8, u128>();
- | ^^^^ `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `u8` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -302,15 +283,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:82:39
+error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:85:39
|
LL | assert::is_transmutable::< u8, i128>();
- | ^^^^ `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `u8` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -318,15 +298,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:84:40
+error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:87:40
|
LL | assert::is_transmutable::< i16, i32>();
- | ^^^ `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i16` is smaller than the size of `i32`
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -334,15 +313,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:85:40
+error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:88:40
|
LL | assert::is_transmutable::< i16, f32>();
- | ^^^ `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i16` is smaller than the size of `f32`
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -350,15 +328,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:86:40
+error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:89:40
|
LL | assert::is_transmutable::< i16, u32>();
- | ^^^ `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i16` is smaller than the size of `u32`
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -366,15 +343,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:87:40
+error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:90:40
|
LL | assert::is_transmutable::< i16, u64>();
- | ^^^ `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i16` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -382,15 +358,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:88:40
+error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:91:40
|
LL | assert::is_transmutable::< i16, i64>();
- | ^^^ `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i16` is smaller than the size of `i64`
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -398,15 +373,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:89:40
+error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:92:40
|
LL | assert::is_transmutable::< i16, f64>();
- | ^^^ `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i16` is smaller than the size of `f64`
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -414,15 +388,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:90:39
+error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:93:39
|
LL | assert::is_transmutable::< i16, u128>();
- | ^^^^ `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `i16` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -430,15 +403,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:91:39
+error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:94:39
|
LL | assert::is_transmutable::< i16, i128>();
- | ^^^^ `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `i16` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -446,15 +418,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:93:40
+error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:96:40
|
LL | assert::is_transmutable::< u16, i32>();
- | ^^^ `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u16` is smaller than the size of `i32`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -462,15 +433,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:94:40
+error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:97:40
|
LL | assert::is_transmutable::< u16, f32>();
- | ^^^ `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u16` is smaller than the size of `f32`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -478,15 +448,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:95:40
+error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:98:40
|
LL | assert::is_transmutable::< u16, u32>();
- | ^^^ `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u16` is smaller than the size of `u32`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u32`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -494,15 +463,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:96:40
+error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:99:40
|
LL | assert::is_transmutable::< u16, u64>();
- | ^^^ `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u16` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -510,15 +478,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:97:40
+error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:100:40
|
LL | assert::is_transmutable::< u16, i64>();
- | ^^^ `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u16` is smaller than the size of `i64`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -526,15 +493,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:98:40
+error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:101:40
|
LL | assert::is_transmutable::< u16, f64>();
- | ^^^ `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u16` is smaller than the size of `f64`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -542,15 +508,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:99:39
+error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:102:39
|
LL | assert::is_transmutable::< u16, u128>();
- | ^^^^ `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `u16` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -558,15 +523,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:100:39
+error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:103:39
|
LL | assert::is_transmutable::< u16, i128>();
- | ^^^^ `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `u16` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -574,15 +538,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:102:40
+error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:105:40
|
LL | assert::is_transmutable::< i32, u64>();
- | ^^^ `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i32` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -590,15 +553,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:103:40
+error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:106:40
|
LL | assert::is_transmutable::< i32, i64>();
- | ^^^ `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i32` is smaller than the size of `i64`
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -606,15 +568,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:104:40
+error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:107:40
|
LL | assert::is_transmutable::< i32, f64>();
- | ^^^ `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `i32` is smaller than the size of `f64`
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -622,15 +583,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:105:39
+error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:108:39
|
LL | assert::is_transmutable::< i32, u128>();
- | ^^^^ `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `i32` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -638,15 +598,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:106:39
+error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:109:39
|
LL | assert::is_transmutable::< i32, i128>();
- | ^^^^ `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `i32` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -654,15 +613,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:108:40
+error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:111:40
|
LL | assert::is_transmutable::< f32, u64>();
- | ^^^ `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `f32` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -670,15 +628,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:109:40
+error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:112:40
|
LL | assert::is_transmutable::< f32, i64>();
- | ^^^ `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `f32` is smaller than the size of `i64`
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -686,15 +643,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:110:40
+error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:113:40
|
LL | assert::is_transmutable::< f32, f64>();
- | ^^^ `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `f32` is smaller than the size of `f64`
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -702,15 +658,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:111:39
+error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:114:39
|
LL | assert::is_transmutable::< f32, u128>();
- | ^^^^ `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `f32` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -718,15 +673,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:112:39
+error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:115:39
|
LL | assert::is_transmutable::< f32, i128>();
- | ^^^^ `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `f32` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -734,15 +688,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:114:40
+error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:117:40
|
LL | assert::is_transmutable::< u32, u64>();
- | ^^^ `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u32` is smaller than the size of `u64`
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -750,15 +703,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:115:40
+error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:118:40
|
LL | assert::is_transmutable::< u32, i64>();
- | ^^^ `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u32` is smaller than the size of `i64`
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -766,15 +718,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:116:40
+error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:119:40
|
LL | assert::is_transmutable::< u32, f64>();
- | ^^^ `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
+ | ^^^ The size of `u32` is smaller than the size of `f64`
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `f64`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -782,15 +733,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:117:39
+error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:120:39
|
LL | assert::is_transmutable::< u32, u128>();
- | ^^^^ `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `u32` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -798,15 +748,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:118:39
+error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:121:39
|
LL | assert::is_transmutable::< u32, i128>();
- | ^^^^ `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `u32` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -814,15 +763,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:120:39
+error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:123:39
|
LL | assert::is_transmutable::< u64, u128>();
- | ^^^^ `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `u64` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<u64, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -830,15 +778,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:121:39
+error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:124:39
|
LL | assert::is_transmutable::< u64, i128>();
- | ^^^^ `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `u64` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<u64, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -846,15 +793,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:123:39
+error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:126:39
|
LL | assert::is_transmutable::< i64, u128>();
- | ^^^^ `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `i64` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<i64, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -862,15 +808,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:124:39
+error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:127:39
|
LL | assert::is_transmutable::< i64, i128>();
- | ^^^^ `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `i64` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<i64, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -878,15 +823,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:126:39
+error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:129:39
|
LL | assert::is_transmutable::< f64, u128>();
- | ^^^^ `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `f64` is smaller than the size of `u128`
|
- = help: the trait `BikeshedIntrinsicFrom<f64, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `u128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
@@ -894,15 +838,14 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
- --> $DIR/numbers.rs:127:39
+error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:130:39
|
LL | assert::is_transmutable::< f64, i128>();
- | ^^^^ `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
+ | ^^^^ The size of `f64` is smaller than the size of `i128`
|
- = help: the trait `BikeshedIntrinsicFrom<f64, assert::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `i128`
note: required by a bound in `is_transmutable`
- --> $DIR/numbers.rs:12:14
+ --> $DIR/numbers.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this function
diff --git a/tests/ui/transmutability/primitives/numbers.next.stderr b/tests/ui/transmutability/primitives/numbers.next.stderr
new file mode 100644
index 000000000..d12e17297
--- /dev/null
+++ b/tests/ui/transmutability/primitives/numbers.next.stderr
@@ -0,0 +1,858 @@
+error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:65:40
+ |
+LL | assert::is_transmutable::< i8, i16>();
+ | ^^^ The size of `i8` is smaller than the size of `i16`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:66:40
+ |
+LL | assert::is_transmutable::< i8, u16>();
+ | ^^^ The size of `i8` is smaller than the size of `u16`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:67:40
+ |
+LL | assert::is_transmutable::< i8, i32>();
+ | ^^^ The size of `i8` is smaller than the size of `i32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:68:40
+ |
+LL | assert::is_transmutable::< i8, f32>();
+ | ^^^ The size of `i8` is smaller than the size of `f32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:69:40
+ |
+LL | assert::is_transmutable::< i8, u32>();
+ | ^^^ The size of `i8` is smaller than the size of `u32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:70:40
+ |
+LL | assert::is_transmutable::< i8, u64>();
+ | ^^^ The size of `i8` is smaller than the size of `u64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:71:40
+ |
+LL | assert::is_transmutable::< i8, i64>();
+ | ^^^ The size of `i8` is smaller than the size of `i64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:72:40
+ |
+LL | assert::is_transmutable::< i8, f64>();
+ | ^^^ The size of `i8` is smaller than the size of `f64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:73:39
+ |
+LL | assert::is_transmutable::< i8, u128>();
+ | ^^^^ The size of `i8` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:74:39
+ |
+LL | assert::is_transmutable::< i8, i128>();
+ | ^^^^ The size of `i8` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:76:40
+ |
+LL | assert::is_transmutable::< u8, i16>();
+ | ^^^ The size of `u8` is smaller than the size of `i16`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:77:40
+ |
+LL | assert::is_transmutable::< u8, u16>();
+ | ^^^ The size of `u8` is smaller than the size of `u16`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:78:40
+ |
+LL | assert::is_transmutable::< u8, i32>();
+ | ^^^ The size of `u8` is smaller than the size of `i32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:79:40
+ |
+LL | assert::is_transmutable::< u8, f32>();
+ | ^^^ The size of `u8` is smaller than the size of `f32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:80:40
+ |
+LL | assert::is_transmutable::< u8, u32>();
+ | ^^^ The size of `u8` is smaller than the size of `u32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:81:40
+ |
+LL | assert::is_transmutable::< u8, u64>();
+ | ^^^ The size of `u8` is smaller than the size of `u64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:82:40
+ |
+LL | assert::is_transmutable::< u8, i64>();
+ | ^^^ The size of `u8` is smaller than the size of `i64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:83:40
+ |
+LL | assert::is_transmutable::< u8, f64>();
+ | ^^^ The size of `u8` is smaller than the size of `f64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:84:39
+ |
+LL | assert::is_transmutable::< u8, u128>();
+ | ^^^^ The size of `u8` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:85:39
+ |
+LL | assert::is_transmutable::< u8, i128>();
+ | ^^^^ The size of `u8` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:87:40
+ |
+LL | assert::is_transmutable::< i16, i32>();
+ | ^^^ The size of `i16` is smaller than the size of `i32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:88:40
+ |
+LL | assert::is_transmutable::< i16, f32>();
+ | ^^^ The size of `i16` is smaller than the size of `f32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:89:40
+ |
+LL | assert::is_transmutable::< i16, u32>();
+ | ^^^ The size of `i16` is smaller than the size of `u32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:90:40
+ |
+LL | assert::is_transmutable::< i16, u64>();
+ | ^^^ The size of `i16` is smaller than the size of `u64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:91:40
+ |
+LL | assert::is_transmutable::< i16, i64>();
+ | ^^^ The size of `i16` is smaller than the size of `i64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:92:40
+ |
+LL | assert::is_transmutable::< i16, f64>();
+ | ^^^ The size of `i16` is smaller than the size of `f64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:93:39
+ |
+LL | assert::is_transmutable::< i16, u128>();
+ | ^^^^ The size of `i16` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:94:39
+ |
+LL | assert::is_transmutable::< i16, i128>();
+ | ^^^^ The size of `i16` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:96:40
+ |
+LL | assert::is_transmutable::< u16, i32>();
+ | ^^^ The size of `u16` is smaller than the size of `i32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:97:40
+ |
+LL | assert::is_transmutable::< u16, f32>();
+ | ^^^ The size of `u16` is smaller than the size of `f32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:98:40
+ |
+LL | assert::is_transmutable::< u16, u32>();
+ | ^^^ The size of `u16` is smaller than the size of `u32`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:99:40
+ |
+LL | assert::is_transmutable::< u16, u64>();
+ | ^^^ The size of `u16` is smaller than the size of `u64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:100:40
+ |
+LL | assert::is_transmutable::< u16, i64>();
+ | ^^^ The size of `u16` is smaller than the size of `i64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:101:40
+ |
+LL | assert::is_transmutable::< u16, f64>();
+ | ^^^ The size of `u16` is smaller than the size of `f64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:102:39
+ |
+LL | assert::is_transmutable::< u16, u128>();
+ | ^^^^ The size of `u16` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:103:39
+ |
+LL | assert::is_transmutable::< u16, i128>();
+ | ^^^^ The size of `u16` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:105:40
+ |
+LL | assert::is_transmutable::< i32, u64>();
+ | ^^^ The size of `i32` is smaller than the size of `u64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:106:40
+ |
+LL | assert::is_transmutable::< i32, i64>();
+ | ^^^ The size of `i32` is smaller than the size of `i64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:107:40
+ |
+LL | assert::is_transmutable::< i32, f64>();
+ | ^^^ The size of `i32` is smaller than the size of `f64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:108:39
+ |
+LL | assert::is_transmutable::< i32, u128>();
+ | ^^^^ The size of `i32` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:109:39
+ |
+LL | assert::is_transmutable::< i32, i128>();
+ | ^^^^ The size of `i32` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:111:40
+ |
+LL | assert::is_transmutable::< f32, u64>();
+ | ^^^ The size of `f32` is smaller than the size of `u64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:112:40
+ |
+LL | assert::is_transmutable::< f32, i64>();
+ | ^^^ The size of `f32` is smaller than the size of `i64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:113:40
+ |
+LL | assert::is_transmutable::< f32, f64>();
+ | ^^^ The size of `f32` is smaller than the size of `f64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:114:39
+ |
+LL | assert::is_transmutable::< f32, u128>();
+ | ^^^^ The size of `f32` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:115:39
+ |
+LL | assert::is_transmutable::< f32, i128>();
+ | ^^^^ The size of `f32` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:117:40
+ |
+LL | assert::is_transmutable::< u32, u64>();
+ | ^^^ The size of `u32` is smaller than the size of `u64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:118:40
+ |
+LL | assert::is_transmutable::< u32, i64>();
+ | ^^^ The size of `u32` is smaller than the size of `i64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:119:40
+ |
+LL | assert::is_transmutable::< u32, f64>();
+ | ^^^ The size of `u32` is smaller than the size of `f64`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:120:39
+ |
+LL | assert::is_transmutable::< u32, u128>();
+ | ^^^^ The size of `u32` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:121:39
+ |
+LL | assert::is_transmutable::< u32, i128>();
+ | ^^^^ The size of `u32` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:123:39
+ |
+LL | assert::is_transmutable::< u64, u128>();
+ | ^^^^ The size of `u64` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:124:39
+ |
+LL | assert::is_transmutable::< u64, i128>();
+ | ^^^^ The size of `u64` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:126:39
+ |
+LL | assert::is_transmutable::< i64, u128>();
+ | ^^^^ The size of `i64` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:127:39
+ |
+LL | assert::is_transmutable::< i64, i128>();
+ | ^^^^ The size of `i64` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:129:39
+ |
+LL | assert::is_transmutable::< f64, u128>();
+ | ^^^^ The size of `f64` is smaller than the size of `u128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+
+error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`
+ --> $DIR/numbers.rs:130:39
+ |
+LL | assert::is_transmutable::< f64, i128>();
+ | ^^^^ The size of `f64` is smaller than the size of `i128`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/numbers.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- 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 57 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/transmutability/primitives/numbers.rs b/tests/ui/transmutability/primitives/numbers.rs
index 0df43d204..e980e91ed 100644
--- a/tests/ui/transmutability/primitives/numbers.rs
+++ b/tests/ui/transmutability/primitives/numbers.rs
@@ -1,3 +1,6 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
#![crate_type = "lib"]
#![feature(transmutability)]
#![allow(dead_code)]
diff --git a/tests/ui/transmutability/primitives/unit.stderr b/tests/ui/transmutability/primitives/unit.current.stderr
index 988cd33b3..c49eb6097 100644
--- a/tests/ui/transmutability/primitives/unit.stderr
+++ b/tests/ui/transmutability/primitives/unit.current.stderr
@@ -1,12 +1,11 @@
-error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
- --> $DIR/unit.rs:28:35
+error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`
+ --> $DIR/unit.rs:31:35
|
LL | assert::is_transmutable::<(), u8, Context>();
- | ^^ `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
+ | ^^ The size of `()` is smaller than the size of `u8`
|
- = help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u8`
note: required by a bound in `is_transmutable`
- --> $DIR/unit.rs:12:14
+ --> $DIR/unit.rs:15:14
|
LL | pub fn is_transmutable<Src, Dst, Context>()
| --------------- required by a bound in this function
diff --git a/tests/ui/transmutability/primitives/unit.next.stderr b/tests/ui/transmutability/primitives/unit.next.stderr
new file mode 100644
index 000000000..c49eb6097
--- /dev/null
+++ b/tests/ui/transmutability/primitives/unit.next.stderr
@@ -0,0 +1,24 @@
+error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`
+ --> $DIR/unit.rs:31:35
+ |
+LL | assert::is_transmutable::<(), u8, Context>();
+ | ^^ The size of `()` is smaller than the size of `u8`
+ |
+note: required by a bound in `is_transmutable`
+ --> $DIR/unit.rs:15:14
+ |
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this function
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume::ALIGNMENT
+LL | | .and(Assume::LIFETIMES)
+LL | | .and(Assume::SAFETY)
+LL | | .and(Assume::VALIDITY)
+LL | | }>
+ | |__________^ 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/unit.rs b/tests/ui/transmutability/primitives/unit.rs
index 1975a61de..12eac1751 100644
--- a/tests/ui/transmutability/primitives/unit.rs
+++ b/tests/ui/transmutability/primitives/unit.rs
@@ -1,3 +1,6 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
//! The unit type, `()`, should be one byte.
#![crate_type = "lib"]
diff --git a/tests/ui/transmutability/references.stderr b/tests/ui/transmutability/references.current.stderr
index eb3bd03fd..ecb095354 100644
--- a/tests/ui/transmutability/references.stderr
+++ b/tests/ui/transmutability/references.current.stderr
@@ -1,12 +1,11 @@
-error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
- --> $DIR/references.rs:26:52
+error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`
+ --> $DIR/references.rs:29:52
|
LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
- | ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^^^^^ `&'static Unit` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `&'static Unit`
note: required by a bound in `is_maybe_transmutable`
- --> $DIR/references.rs:13:14
+ --> $DIR/references.rs:16:14
|
LL | pub fn is_maybe_transmutable<Src, Dst>()
| --------------------- required by a bound in this function
diff --git a/tests/ui/transmutability/references.next.stderr b/tests/ui/transmutability/references.next.stderr
new file mode 100644
index 000000000..ecb095354
--- /dev/null
+++ b/tests/ui/transmutability/references.next.stderr
@@ -0,0 +1,25 @@
+error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`
+ --> $DIR/references.rs:29:52
+ |
+LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
+ | ^^^^^^^^^^^^^ `&'static Unit` does not have a well-specified layout
+ |
+note: required by a bound in `is_maybe_transmutable`
+ --> $DIR/references.rs:16: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: true,
+... |
+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.rs b/tests/ui/transmutability/references.rs
index af3ff0ec1..8c2b25ebb 100644
--- a/tests/ui/transmutability/references.rs
+++ b/tests/ui/transmutability/references.rs
@@ -1,3 +1,6 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
//! Transmutations involving references are not yet supported.
#![crate_type = "lib"]
diff --git a/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr
index d9aebac64..4c5062cd3 100644
--- a/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr
+++ b/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `should_reject_repr_rust::unit::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `should_reject_repr_rust::unit::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:28:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `should_reject_repr_rust::unit::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `should_reject_repr_rust::unit::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::unit::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -21,13 +20,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::unit::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::unit::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:29:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::unit::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `should_reject_repr_rust::unit::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `should_reject_repr_rust::unit::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -44,13 +42,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `should_reject_repr_rust::tuple::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `should_reject_repr_rust::tuple::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:34:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `should_reject_repr_rust::tuple::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `should_reject_repr_rust::tuple::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::tuple::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -67,13 +64,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::tuple::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::tuple::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:35:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::tuple::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `should_reject_repr_rust::tuple::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `should_reject_repr_rust::tuple::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -90,13 +86,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `should_reject_repr_rust::braces::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `should_reject_repr_rust::braces::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:40:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `should_reject_repr_rust::braces::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `should_reject_repr_rust::braces::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::braces::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -113,13 +108,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::braces::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::braces::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:41:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::braces::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `should_reject_repr_rust::braces::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `should_reject_repr_rust::braces::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -136,13 +130,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `aligned::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `aligned::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:46:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `aligned::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `aligned::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<aligned::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -159,13 +152,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `aligned::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `aligned::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:47:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `aligned::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `aligned::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `aligned::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -182,13 +174,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `packed::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `packed::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:52:52
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `packed::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `packed::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<packed::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -205,13 +196,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `packed::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `packed::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:53:47
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `packed::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `packed::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `packed::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -228,13 +218,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `nested::repr_c` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `nested::repr_c` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:59:49
|
LL | assert::is_maybe_transmutable::<repr_c, ()>();
- | ^^ `nested::repr_c` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `nested::repr_c` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<nested::repr_c, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -251,13 +240,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `nested::repr_c` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `nested::repr_c` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:60:47
|
LL | assert::is_maybe_transmutable::<u128, repr_c>();
- | ^^^^^^ `u128` cannot be safely transmuted into `nested::repr_c` in the defining scope of `assert::Context`.
+ | ^^^^^^ `nested::repr_c` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `nested::repr_c`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
diff --git a/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr
index aa0cbc51b..4293d34f4 100644
--- a/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr
+++ b/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `should_reject_repr_rust::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+error[E0277]: `should_reject_repr_rust::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:30:48
|
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
- | ^^ `should_reject_repr_rust::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
+ | ^^ `should_reject_repr_rust::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
@@ -21,13 +20,12 @@ LL | | }
LL | | }>
| |__________^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::repr_rust` in the defining scope of `assert::Context`.
+error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::repr_rust` in the defining scope of `assert::Context`
--> $DIR/should_require_well_defined_layout.rs:31:43
|
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
- | ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::repr_rust` in the defining scope of `assert::Context`.
+ | ^^^^^^^^^ `should_reject_repr_rust::repr_rust` does not have a well-specified layout
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `should_reject_repr_rust::repr_rust`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_require_well_defined_layout.rs:13:14
|
diff --git a/tests/ui/transmutability/unions/should_pad_variants.stderr b/tests/ui/transmutability/unions/should_pad_variants.stderr
index f4988239d..bfbef8b25 100644
--- a/tests/ui/transmutability/unions/should_pad_variants.stderr
+++ b/tests/ui/transmutability/unions/should_pad_variants.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
+error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`
--> $DIR/should_pad_variants.rs:44:36
|
LL | assert::is_transmutable::<Src, Dst, Context>();
- | ^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
+ | ^^^ The size of `Src` is smaller than the size of `Dst`
|
- = help: the trait `BikeshedIntrinsicFrom<Src, should_pad_variants::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `Dst`
note: required by a bound in `is_transmutable`
--> $DIR/should_pad_variants.rs:13:14
|
diff --git a/tests/ui/transmutability/unions/should_reject_contraction.stderr b/tests/ui/transmutability/unions/should_reject_contraction.stderr
index fa7dcc3d2..553f655a1 100644
--- a/tests/ui/transmutability/unions/should_reject_contraction.stderr
+++ b/tests/ui/transmutability/unions/should_reject_contraction.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `Superset` cannot be safely transmuted into `Subset` in the defining scope of `assert::Context`.
+error[E0277]: `Superset` cannot be safely transmuted into `Subset` in the defining scope of `assert::Context`
--> $DIR/should_reject_contraction.rs:35:41
|
LL | assert::is_transmutable::<Superset, Subset>();
- | ^^^^^^ `Superset` cannot be safely transmuted into `Subset` in the defining scope of `assert::Context`.
+ | ^^^^^^ At least one value of `Superset` isn't a bit-valid value of `Subset`
|
- = help: the trait `BikeshedIntrinsicFrom<Superset, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `Subset`
note: required by a bound in `is_transmutable`
--> $DIR/should_reject_contraction.rs:13:14
|
diff --git a/tests/ui/transmutability/unions/should_reject_disjoint.stderr b/tests/ui/transmutability/unions/should_reject_disjoint.stderr
index 880e4cd89..178ae6f08 100644
--- a/tests/ui/transmutability/unions/should_reject_disjoint.stderr
+++ b/tests/ui/transmutability/unions/should_reject_disjoint.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
+error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`
--> $DIR/should_reject_disjoint.rs:33:40
|
LL | assert::is_maybe_transmutable::<A, B>();
- | ^ `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
+ | ^ At least one value of `A` isn't a bit-valid value of `B`
|
- = help: the trait `BikeshedIntrinsicFrom<A, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: true }>` is not implemented for `B`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_reject_disjoint.rs:13:14
|
@@ -14,13 +13,12 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
-error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
+error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`
--> $DIR/should_reject_disjoint.rs:34:40
|
LL | assert::is_maybe_transmutable::<B, A>();
- | ^ `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
+ | ^ At least one value of `B` isn't a bit-valid value of `A`
|
- = help: the trait `BikeshedIntrinsicFrom<B, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: true }>` is not implemented for `A`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/should_reject_disjoint.rs:13:14
|
diff --git a/tests/ui/transmutability/unions/should_reject_intersecting.stderr b/tests/ui/transmutability/unions/should_reject_intersecting.stderr
index 501760b08..73c29ab1c 100644
--- a/tests/ui/transmutability/unions/should_reject_intersecting.stderr
+++ b/tests/ui/transmutability/unions/should_reject_intersecting.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
+error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`
--> $DIR/should_reject_intersecting.rs:36:34
|
LL | assert::is_transmutable::<A, B>();
- | ^ `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
+ | ^ At least one value of `A` isn't a bit-valid value of `B`
|
- = help: the trait `BikeshedIntrinsicFrom<A, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `B`
note: required by a bound in `is_transmutable`
--> $DIR/should_reject_intersecting.rs:14:14
|
@@ -14,13 +13,12 @@ LL | where
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
-error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
+error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`
--> $DIR/should_reject_intersecting.rs:37:34
|
LL | assert::is_transmutable::<B, A>();
- | ^ `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
+ | ^ At least one value of `B` isn't a bit-valid value of `A`
|
- = help: the trait `BikeshedIntrinsicFrom<B, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `A`
note: required by a bound in `is_transmutable`
--> $DIR/should_reject_intersecting.rs:14:14
|
diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr b/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr
index afbba653b..863ada3c2 100644
--- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr
+++ b/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
+error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`
--> $DIR/should_reject_if_dst_has_private_field.rs:35:41
|
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
- | ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
+ | ^^^^^^^^ `Dst` is or contains a type or field that is not visible in that scope
|
- = help: the trait `BikeshedIntrinsicFrom<Src, test::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `Dst`
note: required by a bound in `is_transmutable`
--> $DIR/should_reject_if_dst_has_private_field.rs:13:14
|
diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr b/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr
index f14b5d8b2..7b0f1b4d5 100644
--- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr
+++ b/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
+error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`
--> $DIR/should_reject_if_dst_has_private_variant.rs:36:41
|
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
- | ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
+ | ^^^^^^^^ `Dst` is or contains a type or field that is not visible in that scope
|
- = help: the trait `BikeshedIntrinsicFrom<Src, test::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `Dst`
note: required by a bound in `is_transmutable`
--> $DIR/should_reject_if_dst_has_private_variant.rs:13:14
|
diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr b/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr
index 01ae8bea2..df19477ef 100644
--- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr
+++ b/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
+error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`
--> $DIR/should_reject_if_dst_has_unreachable_field.rs:37:41
|
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
- | ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
+ | ^^^^^^^^ `Dst` is or contains a type or field that is not visible in that scope
|
- = help: the trait `BikeshedIntrinsicFrom<Src, test::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `Dst`
note: required by a bound in `is_transmutable`
--> $DIR/should_reject_if_dst_has_unreachable_field.rs:15:14
|
diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr b/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr
index 20a680a74..ea488980c 100644
--- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr
+++ b/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr
@@ -10,13 +10,12 @@ note: the struct `Dst` is defined here
LL | #[repr(C)] pub(self) struct Dst {
| ^^^^^^^^^^^^^^^^^^^^
-error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
+error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:38:41
|
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
- | ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
+ | ^^^^^^^^ `Dst` is or contains a type or field that is not visible in that scope
|
- = help: the trait `BikeshedIntrinsicFrom<Src, test::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `Dst`
note: required by a bound in `is_transmutable`
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:15:14
|
diff --git a/tests/ui/transmute/transmute-padding-ice.stderr b/tests/ui/transmute/transmute-padding-ice.stderr
index 87fd4fb66..f5480e0b9 100644
--- a/tests/ui/transmute/transmute-padding-ice.stderr
+++ b/tests/ui/transmute/transmute-padding-ice.stderr
@@ -1,10 +1,9 @@
-error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
+error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`
--> $DIR/transmute-padding-ice.rs:27:40
|
LL | assert::is_maybe_transmutable::<B, A>();
- | ^ `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
+ | ^ The size of `B` is smaller than the size of `A`
|
- = help: the trait `BikeshedIntrinsicFrom<B, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `A`
note: required by a bound in `is_maybe_transmutable`
--> $DIR/transmute-padding-ice.rs:11:14
|
diff --git a/tests/ui/tuple-index.rs b/tests/ui/tuple/tuple-index.rs
index 3e1d92b42..3e1d92b42 100644
--- a/tests/ui/tuple-index.rs
+++ b/tests/ui/tuple/tuple-index.rs
diff --git a/tests/ui/type-alias-impl-trait/assoc-type-const.rs b/tests/ui/type-alias-impl-trait/assoc-type-const.rs
index 0ade36daf..62f66914e 100644
--- a/tests/ui/type-alias-impl-trait/assoc-type-const.rs
+++ b/tests/ui/type-alias-impl-trait/assoc-type-const.rs
@@ -2,7 +2,7 @@
// const generics in an associated opaque type
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait UnwrapItemsExt<'a, const C: usize> {
type Iter;
diff --git a/tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs b/tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs
index 3f34b00ec..7c7c68ad6 100644
--- a/tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs
+++ b/tests/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs
@@ -1,7 +1,7 @@
// Tests that we don't allow unconstrained lifetime parameters in impls when
// the lifetime is used in an associated opaque type.
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait UnwrapItemsExt {
type Iter;
diff --git a/tests/ui/type-alias-impl-trait/assoc-type-lifetime.rs b/tests/ui/type-alias-impl-trait/assoc-type-lifetime.rs
index 39f785d8c..81dacbcfb 100644
--- a/tests/ui/type-alias-impl-trait/assoc-type-lifetime.rs
+++ b/tests/ui/type-alias-impl-trait/assoc-type-lifetime.rs
@@ -2,7 +2,7 @@
// lifetimes are used in an associated opaque type
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait UnwrapItemsExt<'a> {
type Iter;
diff --git a/tests/ui/type-alias-impl-trait/associated-type-impl-trait-lifetime.rs b/tests/ui/type-alias-impl-trait/associated-type-impl-trait-lifetime.rs
index 962606508..551815d02 100644
--- a/tests/ui/type-alias-impl-trait/associated-type-impl-trait-lifetime.rs
+++ b/tests/ui/type-alias-impl-trait/associated-type-impl-trait-lifetime.rs
@@ -1,6 +1,6 @@
//check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Trait {
type Opaque1;
diff --git a/tests/ui/type-alias-impl-trait/auxiliary/collect_hidden_types.rs b/tests/ui/type-alias-impl-trait/auxiliary/collect_hidden_types.rs
index 75d20a6fe..444a4e695 100644
--- a/tests/ui/type-alias-impl-trait/auxiliary/collect_hidden_types.rs
+++ b/tests/ui/type-alias-impl-trait/auxiliary/collect_hidden_types.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
// edition:2018
diff --git a/tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs b/tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
index 119f7df1f..98c961503 100644
--- a/tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
+++ b/tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
@@ -1,7 +1,7 @@
// Crate that exports an opaque `impl Trait` type. Used for testing cross-crate.
#![crate_type = "rlib"]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait View {
type Tmp: Iterator<Item = u32>;
diff --git a/tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs b/tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs
index 851c2f66c..1824ff5e2 100644
--- a/tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs
+++ b/tests/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs
@@ -1,7 +1,7 @@
// Ensure that we don't ICE if associated type impl trait is used in an impl
// with an unconstrained type parameter.
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait X {
type I;
diff --git a/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds.rs b/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds.rs
index ee9bce15d..4f99236f4 100644
--- a/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds.rs
+++ b/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Callable {
type Output;
diff --git a/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.rs b/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.rs
index ae21a9134..5d5645077 100644
--- a/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.rs
+++ b/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Callable {
type Output;
@@ -17,7 +17,9 @@ impl<'a> PlusOne for &'a mut i32 {
impl<T: PlusOne> Callable for T {
type Output = impl PlusOne;
- fn call(t: T) -> Self::Output { t }
+ fn call(t: T) -> Self::Output {
+ t
+ }
}
fn test<'a>(y: &'a mut i32) -> impl PlusOne {
diff --git a/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr b/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr
index e52d5f9de..66e478315 100644
--- a/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr
+++ b/tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr
@@ -1,5 +1,5 @@
error[E0700]: hidden type for `impl PlusOne` captures lifetime that does not appear in bounds
- --> $DIR/imply_bounds_from_bounds_param.rs:24:5
+ --> $DIR/imply_bounds_from_bounds_param.rs:26:5
|
LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne {
| -- ------------ opaque type defined here
diff --git a/tests/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs b/tests/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs
index 685d76ee3..8df59c68f 100644
--- a/tests/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs
+++ b/tests/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs
@@ -1,7 +1,7 @@
// Regression test for issue 67856
#![feature(unboxed_closures)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
#![feature(fn_traits)]
trait MyTrait {}
diff --git a/tests/ui/type-alias-impl-trait/issue-53598.rs b/tests/ui/type-alias-impl-trait/issue-53598.rs
index 9c1cbf926..e3e2787b6 100644
--- a/tests/ui/type-alias-impl-trait/issue-53598.rs
+++ b/tests/ui/type-alias-impl-trait/issue-53598.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
use std::fmt::Debug;
diff --git a/tests/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs b/tests/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
index 3a7a5da07..3bdb3bf1d 100644
--- a/tests/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
+++ b/tests/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
@@ -2,7 +2,7 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
struct Baz<'a> {
source: &'a str,
diff --git a/tests/ui/type-alias-impl-trait/issue-57611-trait-alias.rs b/tests/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
index cad3e0f66..3917bb3b6 100644
--- a/tests/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
+++ b/tests/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
@@ -3,7 +3,7 @@
// Ensures that we don't ICE
#![feature(trait_alias)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Foo {
type Bar: Baz<Self, Self>;
diff --git a/tests/ui/type-alias-impl-trait/issue-57700.rs b/tests/ui/type-alias-impl-trait/issue-57700.rs
index 484589387..8746545ec 100644
--- a/tests/ui/type-alias-impl-trait/issue-57700.rs
+++ b/tests/ui/type-alias-impl-trait/issue-57700.rs
@@ -1,5 +1,5 @@
#![feature(arbitrary_self_types)]
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
use std::ops::Deref;
diff --git a/tests/ui/type-alias-impl-trait/issue-57807-associated-type.rs b/tests/ui/type-alias-impl-trait/issue-57807-associated-type.rs
index fcab2c7db..841bac5f6 100644
--- a/tests/ui/type-alias-impl-trait/issue-57807-associated-type.rs
+++ b/tests/ui/type-alias-impl-trait/issue-57807-associated-type.rs
@@ -2,7 +2,7 @@
// that we properly unify associated types within
// a type alias impl trait
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Bar {
type A;
diff --git a/tests/ui/type-alias-impl-trait/issue-58887.rs b/tests/ui/type-alias-impl-trait/issue-58887.rs
index 96ac78602..967586765 100644
--- a/tests/ui/type-alias-impl-trait/issue-58887.rs
+++ b/tests/ui/type-alias-impl-trait/issue-58887.rs
@@ -1,6 +1,6 @@
// run-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait UnwrapItemsExt {
type Iter;
diff --git a/tests/ui/type-alias-impl-trait/issue-60371.rs b/tests/ui/type-alias-impl-trait/issue-60371.rs
index 9a40f3d9b..a61739673 100644
--- a/tests/ui/type-alias-impl-trait/issue-60371.rs
+++ b/tests/ui/type-alias-impl-trait/issue-60371.rs
@@ -5,7 +5,7 @@ trait Bug {
}
impl Bug for &() {
- type Item = impl Bug; //~ ERROR `impl Trait` in type aliases is unstable
+ type Item = impl Bug; //~ ERROR `impl Trait` in associated types is unstable
const FUN: fn() -> Self::Item = || ();
//~^ ERROR the trait bound `(): Bug` is not satisfied
diff --git a/tests/ui/type-alias-impl-trait/issue-60371.stderr b/tests/ui/type-alias-impl-trait/issue-60371.stderr
index d0c04371b..ffc664736 100644
--- a/tests/ui/type-alias-impl-trait/issue-60371.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-60371.stderr
@@ -1,11 +1,11 @@
-error[E0658]: `impl Trait` in type aliases is unstable
+error[E0658]: `impl Trait` in associated types is unstable
--> $DIR/issue-60371.rs:8:17
|
LL | type Item = impl Bug;
| ^^^^^^^^
|
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
+ = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
error[E0277]: the trait bound `(): Bug` is not satisfied
--> $DIR/issue-60371.rs:10:40
diff --git a/tests/ui/type-alias-impl-trait/issue-60564-working.rs b/tests/ui/type-alias-impl-trait/issue-60564-working.rs
index 38accc824..c4687c29d 100644
--- a/tests/ui/type-alias-impl-trait/issue-60564-working.rs
+++ b/tests/ui/type-alias-impl-trait/issue-60564-working.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
// check-pass
diff --git a/tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs b/tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs
index 36779a0ce..0245eab79 100644
--- a/tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs
+++ b/tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs
@@ -2,7 +2,7 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait MyTrait {
type AssocType: Send;
diff --git a/tests/ui/type-alias-impl-trait/issue-74761-2.rs b/tests/ui/type-alias-impl-trait/issue-74761-2.rs
index d26ca5c3e..f582592e9 100644
--- a/tests/ui/type-alias-impl-trait/issue-74761-2.rs
+++ b/tests/ui/type-alias-impl-trait/issue-74761-2.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait A {
type B;
diff --git a/tests/ui/type-alias-impl-trait/issue-74761.rs b/tests/ui/type-alias-impl-trait/issue-74761.rs
index d26ca5c3e..f582592e9 100644
--- a/tests/ui/type-alias-impl-trait/issue-74761.rs
+++ b/tests/ui/type-alias-impl-trait/issue-74761.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait A {
type B;
diff --git a/tests/ui/type-alias-impl-trait/issue-78450.rs b/tests/ui/type-alias-impl-trait/issue-78450.rs
index fccbfb74f..2a984c1ed 100644
--- a/tests/ui/type-alias-impl-trait/issue-78450.rs
+++ b/tests/ui/type-alias-impl-trait/issue-78450.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait AssociatedImpl {
type ImplTrait;
diff --git a/tests/ui/type-alias-impl-trait/issue-89952.rs b/tests/ui/type-alias-impl-trait/issue-89952.rs
index dc0f19c04..f0ba9fa7c 100644
--- a/tests/ui/type-alias-impl-trait/issue-89952.rs
+++ b/tests/ui/type-alias-impl-trait/issue-89952.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait SomeTrait {}
impl SomeTrait for () {}
diff --git a/tests/ui/type-alias-impl-trait/issue-90400-1.rs b/tests/ui/type-alias-impl-trait/issue-90400-1.rs
index 15aead2f6..502076057 100644
--- a/tests/ui/type-alias-impl-trait/issue-90400-1.rs
+++ b/tests/ui/type-alias-impl-trait/issue-90400-1.rs
@@ -1,7 +1,7 @@
// Regression test for #90400,
// taken from https://github.com/rust-lang/rust/issues/90400#issuecomment-954927836
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Bar {
fn bar(&self);
diff --git a/tests/ui/type-alias-impl-trait/issue-90400-2.rs b/tests/ui/type-alias-impl-trait/issue-90400-2.rs
index 4c6e893c1..60ff962ea 100644
--- a/tests/ui/type-alias-impl-trait/issue-90400-2.rs
+++ b/tests/ui/type-alias-impl-trait/issue-90400-2.rs
@@ -1,7 +1,7 @@
// Regression test for #90400,
// taken from https://github.com/rust-lang/rust/issues/90400#issuecomment-954927836
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Bar {
fn bar(&self);
diff --git a/tests/ui/type-alias-impl-trait/issue-94429.rs b/tests/ui/type-alias-impl-trait/issue-94429.rs
index 2c965b875..d764545f9 100644
--- a/tests/ui/type-alias-impl-trait/issue-94429.rs
+++ b/tests/ui/type-alias-impl-trait/issue-94429.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait, generator_trait, generators)]
+#![feature(impl_trait_in_assoc_type, generator_trait, generators)]
use std::ops::Generator;
trait Runnable {
@@ -13,7 +13,7 @@ impl Runnable for Implementor {
type Gen = impl Generator<Yield = (), Return = ()>;
fn run(&mut self) -> Self::Gen {
- //~^ ERROR: type mismatch resolving
+ //~^ ERROR: type mismatch resolving
move || {
yield 1;
}
diff --git a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs
index efbf4f1e3..296a3f3e3 100644
--- a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs
+++ b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs
@@ -1,6 +1,6 @@
// regression test for #74018
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
trait Trait {
type Associated;
diff --git a/tests/ui/type/type-check/assignment-in-if.stderr b/tests/ui/type/type-check/assignment-in-if.stderr
index de133e559..9f4558ada 100644
--- a/tests/ui/type/type-check/assignment-in-if.stderr
+++ b/tests/ui/type/type-check/assignment-in-if.stderr
@@ -67,9 +67,6 @@ LL | x == 5
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:44:18
|
-LL | if y = (Foo { foo: x }) {
- | - here the type of `x` is inferred to be `usize`
-...
LL | if x == x && x = x && x == x {
| ------ ^ expected `bool`, found `usize`
| |
@@ -78,9 +75,6 @@ LL | if x == x && x = x && x == x {
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:44:22
|
-LL | if y = (Foo { foo: x }) {
- | - here the type of `x` is inferred to be `usize`
-...
LL | if x == x && x = x && x == x {
| ^ expected `bool`, found `usize`
@@ -98,9 +92,6 @@ LL | if x == x && x == x && x == x {
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:51:28
|
-LL | if y = (Foo { foo: x }) {
- | - here the type of `x` is inferred to be `usize`
-...
LL | if x == x && x == x && x = x {
| ---------------- ^ expected `bool`, found `usize`
| |
diff --git a/tests/ui/type/type-check/point-at-inference-3.fixed b/tests/ui/type/type-check/point-at-inference-3.fixed
index edd4adf8b..15a3b5805 100644
--- a/tests/ui/type/type-check/point-at-inference-3.fixed
+++ b/tests/ui/type/type-check/point-at-inference-3.fixed
@@ -2,7 +2,8 @@
fn main() {
let mut v = Vec::new();
v.push(0i32);
- //~^ NOTE this is of type `i32`, which causes `v` to be inferred as `Vec<i32>`
+ //~^ NOTE this argument has type `i32`...
+ //~| NOTE ... which causes `v` to have type `Vec<i32>`
v.push(0);
v.push(1i32); //~ ERROR mismatched types
//~^ NOTE expected `i32`, found `u32`
diff --git a/tests/ui/type/type-check/point-at-inference-3.rs b/tests/ui/type/type-check/point-at-inference-3.rs
index 49d7b5007..a48c4f986 100644
--- a/tests/ui/type/type-check/point-at-inference-3.rs
+++ b/tests/ui/type/type-check/point-at-inference-3.rs
@@ -2,7 +2,8 @@
fn main() {
let mut v = Vec::new();
v.push(0i32);
- //~^ NOTE this is of type `i32`, which causes `v` to be inferred as `Vec<i32>`
+ //~^ NOTE this argument has type `i32`...
+ //~| NOTE ... which causes `v` to have type `Vec<i32>`
v.push(0);
v.push(1u32); //~ ERROR mismatched types
//~^ NOTE expected `i32`, found `u32`
diff --git a/tests/ui/type/type-check/point-at-inference-3.stderr b/tests/ui/type/type-check/point-at-inference-3.stderr
index 2c4907ed2..238764812 100644
--- a/tests/ui/type/type-check/point-at-inference-3.stderr
+++ b/tests/ui/type/type-check/point-at-inference-3.stderr
@@ -1,8 +1,10 @@
error[E0308]: mismatched types
- --> $DIR/point-at-inference-3.rs:7:12
+ --> $DIR/point-at-inference-3.rs:8:12
|
LL | v.push(0i32);
- | ---- this is of type `i32`, which causes `v` to be inferred as `Vec<i32>`
+ | - ---- this argument has type `i32`...
+ | |
+ | ... which causes `v` to have type `Vec<i32>`
...
LL | v.push(1u32);
| ---- ^^^^ expected `i32`, found `u32`
diff --git a/tests/ui/type/type-check/point-at-inference-4.rs b/tests/ui/type/type-check/point-at-inference-4.rs
index aea9b2c6c..3deb234c2 100644
--- a/tests/ui/type/type-check/point-at-inference-4.rs
+++ b/tests/ui/type/type-check/point-at-inference-4.rs
@@ -11,8 +11,11 @@ fn main() {
let s = S(None);
s.infer(0i32);
//~^ ERROR this method takes 2 arguments but 1 argument was supplied
+ //~| NOTE this argument has type `i32`...
+ //~| NOTE ... which causes `s` to have type `S<i32, _>`
//~| NOTE an argument is missing
//~| HELP provide the argument
+ //~| HELP change the type of the numeric literal from `i32` to `u32`
let t: S<u32, _> = s;
//~^ ERROR mismatched types
//~| NOTE expected `S<u32, _>`, found `S<i32, _>`
diff --git a/tests/ui/type/type-check/point-at-inference-4.stderr b/tests/ui/type/type-check/point-at-inference-4.stderr
index 28833d2ed..5f7bb8b93 100644
--- a/tests/ui/type/type-check/point-at-inference-4.stderr
+++ b/tests/ui/type/type-check/point-at-inference-4.stderr
@@ -15,8 +15,13 @@ LL | s.infer(0i32, /* b */);
| ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
- --> $DIR/point-at-inference-4.rs:16:24
+ --> $DIR/point-at-inference-4.rs:19:24
|
+LL | s.infer(0i32);
+ | - ---- this argument has type `i32`...
+ | |
+ | ... which causes `s` to have type `S<i32, _>`
+...
LL | let t: S<u32, _> = s;
| --------- ^ expected `S<u32, _>`, found `S<i32, _>`
| |
@@ -24,6 +29,10 @@ LL | let t: S<u32, _> = s;
|
= note: expected struct `S<u32, _>`
found struct `S<i32, _>`
+help: change the type of the numeric literal from `i32` to `u32`
+ |
+LL | s.infer(0u32);
+ | ~~~
error: aborting due to 2 previous errors
diff --git a/tests/ui/type/type-check/point-at-inference.stderr b/tests/ui/type/type-check/point-at-inference.stderr
index a76b4f90c..5fc94d4d1 100644
--- a/tests/ui/type/type-check/point-at-inference.stderr
+++ b/tests/ui/type/type-check/point-at-inference.stderr
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
--> $DIR/point-at-inference.rs:12:9
|
LL | foo.push(i);
- | - this is of type `&{integer}`, which causes `foo` to be inferred as `Vec<&{integer}>`
+ | --- - this argument has type `&{integer}`...
+ | |
+ | ... which causes `foo` to have type `Vec<&{integer}>`
...
LL | bar(foo);
| --- ^^^ expected `Vec<i32>`, found `Vec<&{integer}>`
diff --git a/tests/ui/typeck/bad-type-in-vec-contains.stderr b/tests/ui/typeck/bad-type-in-vec-contains.stderr
index 0e03388d2..72533ab1f 100644
--- a/tests/ui/typeck/bad-type-in-vec-contains.stderr
+++ b/tests/ui/typeck/bad-type-in-vec-contains.stderr
@@ -7,7 +7,6 @@ LL | primes.contains(3);
| | expected `&_`, found integer
| | help: consider borrowing here: `&3`
| arguments to this method are incorrect
- | here the type of `primes` is inferred to be `[_]`
|
= note: expected reference `&_`
found type `{integer}`
diff --git a/tests/ui/typeck/bad-type-in-vec-push.stderr b/tests/ui/typeck/bad-type-in-vec-push.stderr
index ae46050c9..1d5337260 100644
--- a/tests/ui/typeck/bad-type-in-vec-push.stderr
+++ b/tests/ui/typeck/bad-type-in-vec-push.stderr
@@ -1,8 +1,6 @@
error[E0308]: mismatched types
--> $DIR/bad-type-in-vec-push.rs:11:17
|
-LL | vector.sort();
- | ------ here the type of `vector` is inferred to be `Vec<_>`
LL | result.push(vector);
| ---- ^^^^^^ expected integer, found `Vec<_>`
| |
diff --git a/tests/ui/typeck/explain_clone_autoref.stderr b/tests/ui/typeck/explain_clone_autoref.stderr
index 4539da438..38cb7fe55 100644
--- a/tests/ui/typeck/explain_clone_autoref.stderr
+++ b/tests/ui/typeck/explain_clone_autoref.stderr
@@ -14,7 +14,8 @@ LL | nc.clone()
| ^^
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NotClone;
|
error: aborting due to previous error
diff --git a/tests/ui/typeck/issue-105946.rs b/tests/ui/typeck/issue-105946.rs
index bf01751d5..f53f31138 100644
--- a/tests/ui/typeck/issue-105946.rs
+++ b/tests/ui/typeck/issue-105946.rs
@@ -1,12 +1,10 @@
fn digit() -> str {
- return {};
- //~^ ERROR: mismatched types [E0308]
+ return {};
+ //~^ ERROR: mismatched types [E0308]
}
fn main() {
- let [_y..] = [box 1, box 2];
+ let [_y..] = [Box::new(1), Box::new(2)];
//~^ ERROR: cannot find value `_y` in this scope [E0425]
//~| ERROR: `X..` patterns in slices are experimental [E0658]
- //~| ERROR: box expression syntax is experimental; you can call `Box::new` instead [E0658]
- //~| ERROR: box expression syntax is experimental; you can call `Box::new` instead [E0658]
//~| ERROR: pattern requires 1 element but array has 2 [E0527]
}
diff --git a/tests/ui/typeck/issue-105946.stderr b/tests/ui/typeck/issue-105946.stderr
index d803de4df..26c3b7fbc 100644
--- a/tests/ui/typeck/issue-105946.stderr
+++ b/tests/ui/typeck/issue-105946.stderr
@@ -1,49 +1,31 @@
error[E0425]: cannot find value `_y` in this scope
--> $DIR/issue-105946.rs:6:10
|
-LL | let [_y..] = [box 1, box 2];
+LL | let [_y..] = [Box::new(1), Box::new(2)];
| ^^ not found in this scope
error[E0658]: `X..` patterns in slices are experimental
--> $DIR/issue-105946.rs:6:10
|
-LL | let [_y..] = [box 1, box 2];
+LL | let [_y..] = [Box::new(1), Box::new(2)];
| ^^^^
|
= note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
= help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
-error[E0658]: box expression syntax is experimental; you can call `Box::new` instead
- --> $DIR/issue-105946.rs:6:19
- |
-LL | let [_y..] = [box 1, box 2];
- | ^^^^^
- |
- = note: see issue #49733 <https://github.com/rust-lang/rust/issues/49733> for more information
- = help: add `#![feature(box_syntax)]` to the crate attributes to enable
-
-error[E0658]: box expression syntax is experimental; you can call `Box::new` instead
- --> $DIR/issue-105946.rs:6:26
- |
-LL | let [_y..] = [box 1, box 2];
- | ^^^^^
- |
- = note: see issue #49733 <https://github.com/rust-lang/rust/issues/49733> for more information
- = help: add `#![feature(box_syntax)]` to the crate attributes to enable
-
error[E0308]: mismatched types
- --> $DIR/issue-105946.rs:2:10
+ --> $DIR/issue-105946.rs:2:12
|
-LL | return {};
- | ^^ expected `str`, found `()`
+LL | return {};
+ | ^^ expected `str`, found `()`
error[E0527]: pattern requires 1 element but array has 2
--> $DIR/issue-105946.rs:6:9
|
-LL | let [_y..] = [box 1, box 2];
+LL | let [_y..] = [Box::new(1), Box::new(2)];
| ^^^^^^ expected 2 elements
-error: aborting due to 6 previous errors
+error: aborting due to 4 previous errors
Some errors have detailed explanations: E0308, E0425, E0527, E0658.
For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/typeck/issue-107775.stderr b/tests/ui/typeck/issue-107775.stderr
index 9ee9c022c..b97e74b7e 100644
--- a/tests/ui/typeck/issue-107775.stderr
+++ b/tests/ui/typeck/issue-107775.stderr
@@ -2,9 +2,9 @@ error[E0308]: mismatched types
--> $DIR/issue-107775.rs:35:16
|
LL | map.insert(1, Struct::do_something);
- | - -------------------- this is of type `fn(u8) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}`, which causes `map` to be inferred as `HashMap<{integer}, fn(u8) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}>`
- | |
- | this is of type `{integer}`, which causes `map` to be inferred as `HashMap<{integer}, fn(u8) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}>`
+ | --- -------------------- this argument has type `fn(u8) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}`...
+ | |
+ | ... which causes `map` to have type `HashMap<{integer}, fn(u8) -> Pin<Box<dyn Future<Output = ()> + Send>> {<Struct as Trait>::do_something::<'_>}>`
LL | Self { map }
| ^^^ expected `HashMap<u16, fn(u8) -> Pin<...>>`, found `HashMap<{integer}, ...>`
|
diff --git a/tests/ui/typeck/issue-110052.rs b/tests/ui/typeck/issue-110052.rs
new file mode 100644
index 000000000..f124b58b5
--- /dev/null
+++ b/tests/ui/typeck/issue-110052.rs
@@ -0,0 +1,12 @@
+// Makes sure we deal with escaping lifetimes *above* INNERMOST when
+// suggesting trait for ambiguous associated type.
+
+impl<I, V> Validator<I> for ()
+where
+ for<'iter> dyn Validator<<&'iter I>::Item>:,
+ //~^ ERROR ambiguous associated type
+{}
+
+pub trait Validator<T> {}
+
+fn main() {}
diff --git a/tests/ui/typeck/issue-110052.stderr b/tests/ui/typeck/issue-110052.stderr
new file mode 100644
index 000000000..0c15c03a7
--- /dev/null
+++ b/tests/ui/typeck/issue-110052.stderr
@@ -0,0 +1,9 @@
+error[E0223]: ambiguous associated type
+ --> $DIR/issue-110052.rs:6:30
+ |
+LL | for<'iter> dyn Validator<<&'iter I>::Item>:,
+ | ^^^^^^^^^^^^^^^^ help: use the fully-qualified path: `<&'iter I as IntoIterator>::Item`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0223`.
diff --git a/tests/ui/typeck/issue-43189.stderr b/tests/ui/typeck/issue-43189.stderr
index caf7530b8..c072e6a08 100644
--- a/tests/ui/typeck/issue-43189.stderr
+++ b/tests/ui/typeck/issue-43189.stderr
@@ -12,7 +12,7 @@ LL | fn a(&self) {}
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use xcrate_issue_43189_b::xcrate_issue_43189_a::A;
+LL + use xcrate_issue_43189_b::xcrate_issue_43189_a::A;
|
error: aborting due to previous error
diff --git a/tests/ui/typeck/issue-87935-unsized-box-expr.rs b/tests/ui/typeck/issue-87935-unsized-box-expr.rs
deleted file mode 100644
index cd2a82074..000000000
--- a/tests/ui/typeck/issue-87935-unsized-box-expr.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#![feature(box_syntax)]
-// Box expression needs to be movable, and hence has to be of a Sized type.
-fn main() {
- let _x: Box<[u32]> = box { loop {} };
- //~^ ERROR: the size for values of type `[u32]` cannot be known at compilation time
-
- // Check that a deduced size does not cause issues.
- let _y: Box<[u32]> = box [];
- let _z: Box<[u32; 0]> = box { loop {} };
-}
diff --git a/tests/ui/typeck/issue-87935-unsized-box-expr.stderr b/tests/ui/typeck/issue-87935-unsized-box-expr.stderr
deleted file mode 100644
index 9ff822352..000000000
--- a/tests/ui/typeck/issue-87935-unsized-box-expr.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0277]: the size for values of type `[u32]` cannot be known at compilation time
- --> $DIR/issue-87935-unsized-box-expr.rs:4:30
- |
-LL | let _x: Box<[u32]> = box { loop {} };
- | ^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `[u32]`
- = note: the type of a box expression 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/typeck/issue-90164.stderr b/tests/ui/typeck/issue-90164.stderr
index 1e2f1bae3..8586f5222 100644
--- a/tests/ui/typeck/issue-90164.stderr
+++ b/tests/ui/typeck/issue-90164.stderr
@@ -6,7 +6,8 @@ LL | copy(r, w);
| |
| required by a bound introduced by this call
|
- = note: consider using `Box::pin`
+ = note: consider using the `pin!` macro
+ consider using `Box::pin` if you need to access the pinned value outside of the current scope
note: required by a bound in `copy`
--> $DIR/issue-90164.rs:1:12
|
diff --git a/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.stderr b/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.stderr
deleted file mode 100644
index 6b09ccd52..000000000
--- a/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0271]: type mismatch resolving `char == <u8 as Add>::Output`
- --> $DIR/cast-checks-handling-projections.rs:5:5
- |
-LL | (0u8 + 0u8) as char;
- | ^^^^^^^^^^^ types differ
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/tests/ui/output-type-mismatch.rs b/tests/ui/typeck/output-type-mismatch.rs
index 35097aa9e..35097aa9e 100644
--- a/tests/ui/output-type-mismatch.rs
+++ b/tests/ui/typeck/output-type-mismatch.rs
diff --git a/tests/ui/output-type-mismatch.stderr b/tests/ui/typeck/output-type-mismatch.stderr
index 4507a4df6..4507a4df6 100644
--- a/tests/ui/output-type-mismatch.stderr
+++ b/tests/ui/typeck/output-type-mismatch.stderr
diff --git a/tests/ui/suppressed-error.rs b/tests/ui/typeck/suppressed-error.rs
index 1e39be460..1e39be460 100644
--- a/tests/ui/suppressed-error.rs
+++ b/tests/ui/typeck/suppressed-error.rs
diff --git a/tests/ui/suppressed-error.stderr b/tests/ui/typeck/suppressed-error.stderr
index 11d70f8a4..11d70f8a4 100644
--- a/tests/ui/suppressed-error.stderr
+++ b/tests/ui/typeck/suppressed-error.stderr
diff --git a/tests/ui/tag-that-dare-not-speak-its-name.rs b/tests/ui/typeck/tag-that-dare-not-speak-its-name.rs
index 0e76ec246..0e76ec246 100644
--- a/tests/ui/tag-that-dare-not-speak-its-name.rs
+++ b/tests/ui/typeck/tag-that-dare-not-speak-its-name.rs
diff --git a/tests/ui/tag-that-dare-not-speak-its-name.stderr b/tests/ui/typeck/tag-that-dare-not-speak-its-name.stderr
index f53abe53b..f53abe53b 100644
--- a/tests/ui/tag-that-dare-not-speak-its-name.stderr
+++ b/tests/ui/typeck/tag-that-dare-not-speak-its-name.stderr
diff --git a/tests/ui/terr-in-field.rs b/tests/ui/typeck/terr-in-field.rs
index cfe350ef8..cfe350ef8 100644
--- a/tests/ui/terr-in-field.rs
+++ b/tests/ui/typeck/terr-in-field.rs
diff --git a/tests/ui/terr-in-field.stderr b/tests/ui/typeck/terr-in-field.stderr
index 09df4b34b..09df4b34b 100644
--- a/tests/ui/terr-in-field.stderr
+++ b/tests/ui/typeck/terr-in-field.stderr
diff --git a/tests/ui/terr-sorts.rs b/tests/ui/typeck/terr-sorts.rs
index c1e2f7dae..c1e2f7dae 100644
--- a/tests/ui/terr-sorts.rs
+++ b/tests/ui/typeck/terr-sorts.rs
diff --git a/tests/ui/terr-sorts.stderr b/tests/ui/typeck/terr-sorts.stderr
index 8f1975374..8f1975374 100644
--- a/tests/ui/terr-sorts.stderr
+++ b/tests/ui/typeck/terr-sorts.stderr
diff --git a/tests/ui/while-type-error.rs b/tests/ui/typeck/while-type-error.rs
index 8098bfcd8..8098bfcd8 100644
--- a/tests/ui/while-type-error.rs
+++ b/tests/ui/typeck/while-type-error.rs
diff --git a/tests/ui/while-type-error.stderr b/tests/ui/typeck/while-type-error.stderr
index 529cbff05..529cbff05 100644
--- a/tests/ui/while-type-error.stderr
+++ b/tests/ui/typeck/while-type-error.stderr
diff --git a/tests/ui/wrong-ret-type.rs b/tests/ui/typeck/wrong-ret-type.rs
index cbff8dbae..cbff8dbae 100644
--- a/tests/ui/wrong-ret-type.rs
+++ b/tests/ui/typeck/wrong-ret-type.rs
diff --git a/tests/ui/wrong-ret-type.stderr b/tests/ui/typeck/wrong-ret-type.stderr
index c686a0b2f..c686a0b2f 100644
--- a/tests/ui/wrong-ret-type.stderr
+++ b/tests/ui/typeck/wrong-ret-type.stderr
diff --git a/tests/ui/ufcs/ufcs-partially-resolved.rs b/tests/ui/ufcs/ufcs-partially-resolved.rs
index e6470aa6d..712668728 100644
--- a/tests/ui/ufcs/ufcs-partially-resolved.rs
+++ b/tests/ui/ufcs/ufcs-partially-resolved.rs
@@ -17,37 +17,37 @@ type A = u32;
fn main() {
let _: <u8 as Tr>::N; //~ ERROR cannot find associated type `N` in trait `Tr`
- let _: <u8 as E>::N; //~ ERROR cannot find associated type `N` in enum `E`
- let _: <u8 as A>::N; //~ ERROR cannot find associated type `N` in `A`
+ let _: <u8 as E>::N; //~ ERROR expected trait, found enum `E`
+ let _: <u8 as A>::N; //~ ERROR expected trait, found type alias `A`
<u8 as Tr>::N; //~ ERROR cannot find method or associated constant `N` in trait `Tr`
- <u8 as E>::N; //~ ERROR cannot find method or associated constant `N` in enum `E`
- <u8 as A>::N; //~ ERROR cannot find method or associated constant `N` in `A`
+ <u8 as E>::N; //~ ERROR expected trait, found enum `E`
+ <u8 as A>::N; //~ ERROR expected trait, found type alias `A`
let _: <u8 as Tr>::Y; // OK
- let _: <u8 as E>::Y; //~ ERROR expected associated type, found variant `E::Y`
+ let _: <u8 as E>::Y; //~ ERROR expected trait, found enum `E`
<u8 as Tr>::Y; // OK
- <u8 as E>::Y; //~ ERROR expected method or associated constant, found unit variant `E::Y`
+ <u8 as E>::Y; //~ ERROR expected trait, found enum `E`
let _: <u8 as Tr>::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr`
- let _: <u8 as E>::N::NN; //~ ERROR cannot find associated type `N` in enum `E`
- let _: <u8 as A>::N::NN; //~ ERROR cannot find associated type `N` in `A`
+ let _: <u8 as E>::N::NN; //~ ERROR expected trait, found enum `E`
+ let _: <u8 as A>::N::NN; //~ ERROR expected trait, found type alias `A`
<u8 as Tr>::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr`
- <u8 as E>::N::NN; //~ ERROR cannot find associated type `N` in enum `E`
- <u8 as A>::N::NN; //~ ERROR cannot find associated type `N` in `A`
+ <u8 as E>::N::NN; //~ ERROR expected trait, found enum `E`
+ <u8 as A>::N::NN; //~ ERROR expected trait, found type alias `A`
let _: <u8 as Tr>::Y::NN; //~ ERROR ambiguous associated type
- let _: <u8 as E>::Y::NN; //~ ERROR expected associated type, found variant `E::Y`
+ let _: <u8 as E>::Y::NN; //~ ERROR expected trait, found enum `E`
<u8 as Tr>::Y::NN; //~ ERROR no associated item named `NN` found for type `u16`
- <u8 as E>::Y::NN; //~ ERROR expected associated type, found variant `E::Y`
+ <u8 as E>::Y::NN; //~ ERROR expected trait, found enum `E`
- let _: <u8 as Tr::N>::NN; //~ ERROR cannot find associated type `NN` in `Tr::N`
- let _: <u8 as E::N>::NN; //~ ERROR cannot find associated type `NN` in `E::N`
- let _: <u8 as A::N>::NN; //~ ERROR cannot find associated type `NN` in `A::N`
- <u8 as Tr::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::N`
- <u8 as E::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `E::N`
- <u8 as A::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `A::N`
- let _: <u8 as Tr::Y>::NN; //~ ERROR cannot find associated type `NN` in `Tr::Y`
- let _: <u8 as E::Y>::NN; //~ ERROR failed to resolve: `Y` is a variant, not a module
- <u8 as Tr::Y>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::Y`
- <u8 as E::Y>::NN; //~ ERROR failed to resolve: `Y` is a variant, not a module
+ let _: <u8 as Tr::N>::NN; //~ ERROR cannot find trait `N` in trait `Tr`
+ let _: <u8 as E::N>::NN; //~ ERROR cannot find trait `N` in enum `E`
+ let _: <u8 as A::N>::NN; //~ ERROR cannot find trait `N` in `A`
+ <u8 as Tr::N>::NN; //~ ERROR cannot find trait `N` in trait `Tr`
+ <u8 as E::N>::NN; //~ ERROR cannot find trait `N` in enum `E`
+ <u8 as A::N>::NN; //~ ERROR cannot find trait `N` in `A`
+ let _: <u8 as Tr::Y>::NN; //~ ERROR expected trait, found associated type `Tr::Y
+ let _: <u8 as E::Y>::NN; //~ ERROR expected trait, found variant `E::Y`
+ <u8 as Tr::Y>::NN; //~ ERROR expected trait, found associated type `Tr::Y`
+ <u8 as E::Y>::NN; //~ ERROR expected trait, found variant `E::Y`
let _: <u8 as Dr>::Z; //~ ERROR expected associated type, found associated function `Dr::Z`
<u8 as Dr>::X; //~ ERROR expected method or associated constant, found associated type `Dr::X`
diff --git a/tests/ui/ufcs/ufcs-partially-resolved.stderr b/tests/ui/ufcs/ufcs-partially-resolved.stderr
index 72fccea8a..eef55c8dc 100644
--- a/tests/ui/ufcs/ufcs-partially-resolved.stderr
+++ b/tests/ui/ufcs/ufcs-partially-resolved.stderr
@@ -1,15 +1,3 @@
-error[E0433]: failed to resolve: `Y` is a variant, not a module
- --> $DIR/ufcs-partially-resolved.rs:48:22
- |
-LL | let _: <u8 as E::Y>::NN;
- | ^ `Y` is a variant, not a module
-
-error[E0433]: failed to resolve: `Y` is a variant, not a module
- --> $DIR/ufcs-partially-resolved.rs:50:15
- |
-LL | <u8 as E::Y>::NN;
- | ^ `Y` is a variant, not a module
-
error[E0576]: cannot find associated type `N` in trait `Tr`
--> $DIR/ufcs-partially-resolved.rs:19:24
|
@@ -19,17 +7,25 @@ LL | type Y = u16;
LL | let _: <u8 as Tr>::N;
| ^ help: an associated type with a similar name exists: `Y`
-error[E0576]: cannot find associated type `N` in enum `E`
- --> $DIR/ufcs-partially-resolved.rs:20:23
+error[E0404]: expected trait, found enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:20:19
|
LL | let _: <u8 as E>::N;
- | ^ not found in `E`
+ | ^ help: a trait with a similar name exists: `Eq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+ = note: similarly named trait `Eq` defined here
-error[E0576]: cannot find associated type `N` in `A`
- --> $DIR/ufcs-partially-resolved.rs:21:23
+error[E0404]: expected trait, found type alias `A`
+ --> $DIR/ufcs-partially-resolved.rs:21:19
|
LL | let _: <u8 as A>::N;
- | ^ not found in `A`
+ | ^ type aliases cannot be used as traits
+ |
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+ |
+LL | trait A = u32;
+ |
error[E0576]: cannot find method or associated constant `N` in trait `Tr`
--> $DIR/ufcs-partially-resolved.rs:22:17
@@ -40,29 +36,43 @@ LL | fn Y() {}
LL | <u8 as Tr>::N;
| ^ help: an associated function with a similar name exists: `Y`
-error[E0576]: cannot find method or associated constant `N` in enum `E`
- --> $DIR/ufcs-partially-resolved.rs:23:16
+error[E0404]: expected trait, found enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:23:12
|
LL | <u8 as E>::N;
- | ^ not found in `E`
+ | ^ help: a trait with a similar name exists: `Eq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+ = note: similarly named trait `Eq` defined here
-error[E0576]: cannot find method or associated constant `N` in `A`
- --> $DIR/ufcs-partially-resolved.rs:24:16
+error[E0404]: expected trait, found type alias `A`
+ --> $DIR/ufcs-partially-resolved.rs:24:12
|
LL | <u8 as A>::N;
- | ^ not found in `A`
+ | ^ type aliases cannot be used as traits
+ |
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+ |
+LL | trait A = u32;
+ |
-error[E0575]: expected associated type, found variant `E::Y`
- --> $DIR/ufcs-partially-resolved.rs:26:12
+error[E0404]: expected trait, found enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:26:19
|
LL | let _: <u8 as E>::Y;
- | ^^^^^^^^^^^^ not a associated type
+ | ^ help: a trait with a similar name exists: `Eq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+ = note: similarly named trait `Eq` defined here
-error[E0575]: expected method or associated constant, found unit variant `E::Y`
- --> $DIR/ufcs-partially-resolved.rs:28:5
+error[E0404]: expected trait, found enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:28:12
|
LL | <u8 as E>::Y;
- | ^^^^^^^^^^^^ not a method or associated constant
+ | ^ help: a trait with a similar name exists: `Eq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+ = note: similarly named trait `Eq` defined here
error[E0576]: cannot find associated type `N` in trait `Tr`
--> $DIR/ufcs-partially-resolved.rs:30:24
@@ -73,17 +83,25 @@ LL | type Y = u16;
LL | let _: <u8 as Tr>::N::NN;
| ^ help: an associated type with a similar name exists: `Y`
-error[E0576]: cannot find associated type `N` in enum `E`
- --> $DIR/ufcs-partially-resolved.rs:31:23
+error[E0404]: expected trait, found enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:31:19
|
LL | let _: <u8 as E>::N::NN;
- | ^ not found in `E`
+ | ^ help: a trait with a similar name exists: `Eq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+ = note: similarly named trait `Eq` defined here
-error[E0576]: cannot find associated type `N` in `A`
- --> $DIR/ufcs-partially-resolved.rs:32:23
+error[E0404]: expected trait, found type alias `A`
+ --> $DIR/ufcs-partially-resolved.rs:32:19
|
LL | let _: <u8 as A>::N::NN;
- | ^ not found in `A`
+ | ^ type aliases cannot be used as traits
+ |
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+ |
+LL | trait A = u32;
+ |
error[E0576]: cannot find associated type `N` in trait `Tr`
--> $DIR/ufcs-partially-resolved.rs:33:17
@@ -94,77 +112,103 @@ LL | type Y = u16;
LL | <u8 as Tr>::N::NN;
| ^ help: an associated type with a similar name exists: `Y`
-error[E0576]: cannot find associated type `N` in enum `E`
- --> $DIR/ufcs-partially-resolved.rs:34:16
+error[E0404]: expected trait, found enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:34:12
|
LL | <u8 as E>::N::NN;
- | ^ not found in `E`
+ | ^ help: a trait with a similar name exists: `Eq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+ = note: similarly named trait `Eq` defined here
-error[E0576]: cannot find associated type `N` in `A`
- --> $DIR/ufcs-partially-resolved.rs:35:16
+error[E0404]: expected trait, found type alias `A`
+ --> $DIR/ufcs-partially-resolved.rs:35:12
|
LL | <u8 as A>::N::NN;
- | ^ not found in `A`
+ | ^ type aliases cannot be used as traits
+ |
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+ |
+LL | trait A = u32;
+ |
-error[E0575]: expected associated type, found variant `E::Y`
- --> $DIR/ufcs-partially-resolved.rs:37:12
+error[E0404]: expected trait, found enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:37:19
|
LL | let _: <u8 as E>::Y::NN;
- | ^^^^^^^^^^^^^^^^ not a associated type
+ | ^ help: a trait with a similar name exists: `Eq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+ = note: similarly named trait `Eq` defined here
-error[E0575]: expected associated type, found variant `E::Y`
- --> $DIR/ufcs-partially-resolved.rs:39:5
+error[E0404]: expected trait, found enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:39:12
|
LL | <u8 as E>::Y::NN;
- | ^^^^^^^^^^^^^^^^ not a associated type
+ | ^ help: a trait with a similar name exists: `Eq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+ = note: similarly named trait `Eq` defined here
-error[E0576]: cannot find associated type `NN` in `Tr::N`
- --> $DIR/ufcs-partially-resolved.rs:41:27
+error[E0405]: cannot find trait `N` in trait `Tr`
+ --> $DIR/ufcs-partially-resolved.rs:41:23
|
LL | let _: <u8 as Tr::N>::NN;
- | ^^ not found in `Tr::N`
+ | ^ not found in `Tr`
-error[E0576]: cannot find associated type `NN` in `E::N`
- --> $DIR/ufcs-partially-resolved.rs:42:26
+error[E0405]: cannot find trait `N` in enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:42:22
|
LL | let _: <u8 as E::N>::NN;
- | ^^ not found in `E::N`
+ | ^ not found in `E`
-error[E0576]: cannot find associated type `NN` in `A::N`
- --> $DIR/ufcs-partially-resolved.rs:43:26
+error[E0405]: cannot find trait `N` in `A`
+ --> $DIR/ufcs-partially-resolved.rs:43:22
|
LL | let _: <u8 as A::N>::NN;
- | ^^ not found in `A::N`
+ | ^ not found in `A`
-error[E0576]: cannot find method or associated constant `NN` in `Tr::N`
- --> $DIR/ufcs-partially-resolved.rs:44:20
+error[E0405]: cannot find trait `N` in trait `Tr`
+ --> $DIR/ufcs-partially-resolved.rs:44:16
|
LL | <u8 as Tr::N>::NN;
- | ^^ not found in `Tr::N`
+ | ^ not found in `Tr`
-error[E0576]: cannot find method or associated constant `NN` in `E::N`
- --> $DIR/ufcs-partially-resolved.rs:45:19
+error[E0405]: cannot find trait `N` in enum `E`
+ --> $DIR/ufcs-partially-resolved.rs:45:15
|
LL | <u8 as E::N>::NN;
- | ^^ not found in `E::N`
+ | ^ not found in `E`
-error[E0576]: cannot find method or associated constant `NN` in `A::N`
- --> $DIR/ufcs-partially-resolved.rs:46:19
+error[E0405]: cannot find trait `N` in `A`
+ --> $DIR/ufcs-partially-resolved.rs:46:15
|
LL | <u8 as A::N>::NN;
- | ^^ not found in `A::N`
+ | ^ not found in `A`
-error[E0576]: cannot find associated type `NN` in `Tr::Y`
- --> $DIR/ufcs-partially-resolved.rs:47:27
+error[E0404]: expected trait, found associated type `Tr::Y`
+ --> $DIR/ufcs-partially-resolved.rs:47:19
|
LL | let _: <u8 as Tr::Y>::NN;
- | ^^ not found in `Tr::Y`
+ | ^^^^^ not a trait
+
+error[E0404]: expected trait, found variant `E::Y`
+ --> $DIR/ufcs-partially-resolved.rs:48:19
+ |
+LL | let _: <u8 as E::Y>::NN;
+ | ^^^^ not a trait
-error[E0576]: cannot find method or associated constant `NN` in `Tr::Y`
- --> $DIR/ufcs-partially-resolved.rs:49:20
+error[E0404]: expected trait, found associated type `Tr::Y`
+ --> $DIR/ufcs-partially-resolved.rs:49:12
|
LL | <u8 as Tr::Y>::NN;
- | ^^ not found in `Tr::Y`
+ | ^^^^^ not a trait
+
+error[E0404]: expected trait, found variant `E::Y`
+ --> $DIR/ufcs-partially-resolved.rs:50:12
+ |
+LL | <u8 as E::Y>::NN;
+ | ^^^^ not a trait
error[E0575]: expected associated type, found associated function `Dr::Z`
--> $DIR/ufcs-partially-resolved.rs:52:12
@@ -226,5 +270,5 @@ LL | <u8 as Dr>::X::N;
error: aborting due to 32 previous errors
-Some errors have detailed explanations: E0223, E0433, E0575, E0576, E0599.
+Some errors have detailed explanations: E0223, E0404, E0405, E0575, E0576, E0599.
For more information about an error, try `rustc --explain E0223`.
diff --git a/tests/ui/ufcs-polymorphic-paths.rs b/tests/ui/ufcs/ufcs-polymorphic-paths.rs
index a14ebd6a4..a14ebd6a4 100644
--- a/tests/ui/ufcs-polymorphic-paths.rs
+++ b/tests/ui/ufcs/ufcs-polymorphic-paths.rs
diff --git a/tests/ui/underscore-imports/shadow.stderr b/tests/ui/underscore-imports/shadow.stderr
index 7faede4e6..f2c19405b 100644
--- a/tests/ui/underscore-imports/shadow.stderr
+++ b/tests/ui/underscore-imports/shadow.stderr
@@ -7,7 +7,7 @@ LL | x.deref();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
-LL | use std::ops::Deref;
+LL + use std::ops::Deref;
|
error: aborting due to previous error
diff --git a/tests/ui/union/field_checks.rs b/tests/ui/union/field_checks.rs
index d5d1e44ac..bb4eccb4c 100644
--- a/tests/ui/union/field_checks.rs
+++ b/tests/ui/union/field_checks.rs
@@ -21,15 +21,15 @@ union U24<T> { // OK
}
union U3 {
- a: String, //~ ERROR unions cannot contain fields that may need dropping
+ a: String, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union U32 { // field that does not drop but is not `Copy`, either
- a: std::cell::RefCell<i32>, //~ ERROR unions cannot contain fields that may need dropping
+ a: std::cell::RefCell<i32>, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union U4<T> {
- a: T, //~ ERROR unions cannot contain fields that may need dropping
+ a: T, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union U5 { // Having a drop impl is OK
@@ -41,11 +41,11 @@ impl Drop for U5 {
}
union U5Nested { // a nested union that drops is NOT OK
- nest: U5, //~ ERROR unions cannot contain fields that may need dropping
+ nest: U5, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union U5Nested2 { // for now we don't special-case empty arrays
- nest: [U5; 0], //~ ERROR unions cannot contain fields that may need dropping
+ nest: [U5; 0], //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union U6 { // OK
diff --git a/tests/ui/union/field_checks.stderr b/tests/ui/union/field_checks.stderr
index 1f97e97ac..32407a749 100644
--- a/tests/ui/union/field_checks.stderr
+++ b/tests/ui/union/field_checks.stderr
@@ -1,59 +1,59 @@
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/field_checks.rs:24:5
|
LL | a: String,
| ^^^^^^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<String>,
| +++++++++++++++++++++++ +
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/field_checks.rs:28:5
|
LL | a: std::cell::RefCell<i32>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<std::cell::RefCell<i32>>,
| +++++++++++++++++++++++ +
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/field_checks.rs:32:5
|
LL | a: T,
| ^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<T>,
| +++++++++++++++++++++++ +
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/field_checks.rs:44:5
|
LL | nest: U5,
| ^^^^^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | nest: std::mem::ManuallyDrop<U5>,
| +++++++++++++++++++++++ +
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/field_checks.rs:48:5
|
LL | nest: [U5; 0],
| ^^^^^^^^^^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | nest: std::mem::ManuallyDrop<[U5; 0]>,
| +++++++++++++++++++++++ +
diff --git a/tests/ui/union/issue-41073.rs b/tests/ui/union/issue-41073.rs
index 4dfdc606b..f7a82b4e7 100644
--- a/tests/ui/union/issue-41073.rs
+++ b/tests/ui/union/issue-41073.rs
@@ -1,5 +1,5 @@
union Test {
- a: A, //~ ERROR unions cannot contain fields that may need dropping
+ a: A, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
b: B
}
diff --git a/tests/ui/union/issue-41073.stderr b/tests/ui/union/issue-41073.stderr
index b3887fa0f..ae1c4dfed 100644
--- a/tests/ui/union/issue-41073.stderr
+++ b/tests/ui/union/issue-41073.stderr
@@ -1,11 +1,11 @@
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/issue-41073.rs:2:5
|
LL | a: A,
| ^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<A>,
| +++++++++++++++++++++++ +
diff --git a/tests/ui/union/union-copy.rs b/tests/ui/union/union-copy.rs
index 5c3f8d908..7ad0a11c6 100644
--- a/tests/ui/union/union-copy.rs
+++ b/tests/ui/union/union-copy.rs
@@ -9,6 +9,6 @@ union W {
}
impl Copy for U {} // OK
-impl Copy for W {} //~ ERROR the trait `Copy` may not be implemented for this type
+impl Copy for W {} //~ ERROR the trait `Copy` cannot be implemented for this type
fn main() {}
diff --git a/tests/ui/union/union-copy.stderr b/tests/ui/union/union-copy.stderr
index 53ee4dd2e..ff6fa48db 100644
--- a/tests/ui/union/union-copy.stderr
+++ b/tests/ui/union/union-copy.stderr
@@ -1,4 +1,4 @@
-error[E0204]: the trait `Copy` may not be implemented for this type
+error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/union-copy.rs:12:15
|
LL | a: std::mem::ManuallyDrop<String>
diff --git a/tests/ui/union/union-derive-clone.mirunsafeck.stderr b/tests/ui/union/union-derive-clone.mirunsafeck.stderr
index b80e8b988..4d23d230f 100644
--- a/tests/ui/union/union-derive-clone.mirunsafeck.stderr
+++ b/tests/ui/union/union-derive-clone.mirunsafeck.stderr
@@ -9,7 +9,8 @@ note: required by a bound in `AssertParamIsCopy`
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `U1` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | union U1 {
|
error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied
@@ -34,7 +35,8 @@ LL | #[derive(Clone, Copy)]
| ^^^^^ unsatisfied trait bound introduced in this `derive` macro
help: consider annotating `CloneNoCopy` with `#[derive(Clone, Copy)]`
|
-LL | #[derive(Clone, Copy)]
+LL + #[derive(Clone, Copy)]
+LL | struct CloneNoCopy;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/union/union-derive-clone.thirunsafeck.stderr b/tests/ui/union/union-derive-clone.thirunsafeck.stderr
index b80e8b988..4d23d230f 100644
--- a/tests/ui/union/union-derive-clone.thirunsafeck.stderr
+++ b/tests/ui/union/union-derive-clone.thirunsafeck.stderr
@@ -9,7 +9,8 @@ note: required by a bound in `AssertParamIsCopy`
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `U1` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | union U1 {
|
error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied
@@ -34,7 +35,8 @@ LL | #[derive(Clone, Copy)]
| ^^^^^ unsatisfied trait bound introduced in this `derive` macro
help: consider annotating `CloneNoCopy` with `#[derive(Clone, Copy)]`
|
-LL | #[derive(Clone, Copy)]
+LL + #[derive(Clone, Copy)]
+LL | struct CloneNoCopy;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/union/union-derive-eq.mirunsafeck.stderr b/tests/ui/union/union-derive-eq.mirunsafeck.stderr
index 9e55390b5..136cd883e 100644
--- a/tests/ui/union/union-derive-eq.mirunsafeck.stderr
+++ b/tests/ui/union/union-derive-eq.mirunsafeck.stderr
@@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `PartialEqNotEq` with `#[derive(Eq)]`
|
-LL | #[derive(Eq)]
+LL + #[derive(Eq)]
+LL | struct PartialEqNotEq;
|
error: aborting due to previous error
diff --git a/tests/ui/union/union-derive-eq.thirunsafeck.stderr b/tests/ui/union/union-derive-eq.thirunsafeck.stderr
index 9e55390b5..136cd883e 100644
--- a/tests/ui/union/union-derive-eq.thirunsafeck.stderr
+++ b/tests/ui/union/union-derive-eq.thirunsafeck.stderr
@@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `PartialEqNotEq` with `#[derive(Eq)]`
|
-LL | #[derive(Eq)]
+LL + #[derive(Eq)]
+LL | struct PartialEqNotEq;
|
error: aborting due to previous error
diff --git a/tests/ui/union/union-with-drop-fields.mirunsafeck.stderr b/tests/ui/union/union-with-drop-fields.mirunsafeck.stderr
index 93fe996d2..9861a21cb 100644
--- a/tests/ui/union/union-with-drop-fields.mirunsafeck.stderr
+++ b/tests/ui/union/union-with-drop-fields.mirunsafeck.stderr
@@ -1,35 +1,35 @@
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:11:5
|
LL | a: String,
| ^^^^^^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<String>,
| +++++++++++++++++++++++ +
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:19:5
|
LL | a: S,
| ^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<S>,
| +++++++++++++++++++++++ +
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:24:5
|
LL | a: T,
| ^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<T>,
| +++++++++++++++++++++++ +
diff --git a/tests/ui/union/union-with-drop-fields.rs b/tests/ui/union/union-with-drop-fields.rs
index a7a8b69e7..9720830fb 100644
--- a/tests/ui/union/union-with-drop-fields.rs
+++ b/tests/ui/union/union-with-drop-fields.rs
@@ -8,7 +8,7 @@ union U {
}
union W {
- a: String, //~ ERROR unions cannot contain fields that may need dropping
+ a: String, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
b: String, // OK, only one field is reported
}
@@ -16,12 +16,12 @@ struct S(String);
// `S` doesn't implement `Drop` trait, but still has non-trivial destructor
union Y {
- a: S, //~ ERROR unions cannot contain fields that may need dropping
+ a: S, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
// We don't know if `T` is trivially-destructable or not until trans
union J<T> {
- a: T, //~ ERROR unions cannot contain fields that may need dropping
+ a: T, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union H<T: Copy> {
diff --git a/tests/ui/union/union-with-drop-fields.thirunsafeck.stderr b/tests/ui/union/union-with-drop-fields.thirunsafeck.stderr
index 93fe996d2..9861a21cb 100644
--- a/tests/ui/union/union-with-drop-fields.thirunsafeck.stderr
+++ b/tests/ui/union/union-with-drop-fields.thirunsafeck.stderr
@@ -1,35 +1,35 @@
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:11:5
|
LL | a: String,
| ^^^^^^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<String>,
| +++++++++++++++++++++++ +
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:19:5
|
LL | a: S,
| ^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<S>,
| +++++++++++++++++++++++ +
-error[E0740]: unions cannot contain fields that may need dropping
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/union-with-drop-fields.rs:24:5
|
LL | a: T,
| ^^^^
|
- = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
-help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
+ = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<T>,
| +++++++++++++++++++++++ +
diff --git a/tests/ui/union/unresolved-field-isnt-copy.rs b/tests/ui/union/unresolved-field-isnt-copy.rs
new file mode 100644
index 000000000..7a6d79b2f
--- /dev/null
+++ b/tests/ui/union/unresolved-field-isnt-copy.rs
@@ -0,0 +1,8 @@
+// Unresolved fields are not copy, but also shouldn't report an extra E0740.
+
+pub union Foo {
+ x: *const Missing,
+ //~^ ERROR cannot find type `Missing` in this scope
+}
+
+fn main() {}
diff --git a/tests/ui/union/unresolved-field-isnt-copy.stderr b/tests/ui/union/unresolved-field-isnt-copy.stderr
new file mode 100644
index 000000000..22301582e
--- /dev/null
+++ b/tests/ui/union/unresolved-field-isnt-copy.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Missing` in this scope
+ --> $DIR/unresolved-field-isnt-copy.rs:4:15
+ |
+LL | x: *const Missing,
+ | ^^^^^^^ 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/unpretty/box.rs b/tests/ui/unpretty/box.rs
new file mode 100644
index 000000000..81f5c88d7
--- /dev/null
+++ b/tests/ui/unpretty/box.rs
@@ -0,0 +1,9 @@
+// compile-flags: -Zunpretty=hir
+// check-pass
+
+#![feature(stmt_expr_attributes, rustc_attrs)]
+
+fn main() {
+ let _ = #[rustc_box]
+ Box::new(1);
+}
diff --git a/tests/ui/unpretty/box.stdout b/tests/ui/unpretty/box.stdout
new file mode 100644
index 000000000..0c6e012e6
--- /dev/null
+++ b/tests/ui/unpretty/box.stdout
@@ -0,0 +1,14 @@
+// compile-flags: -Zunpretty=hir
+// check-pass
+
+#![feature(stmt_expr_attributes, rustc_attrs)]
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+
+fn main() {
+ let _ =
+ #[rustc_box]
+ Box::new(1);
+ }
diff --git a/tests/ui/unpretty/flattened-format-args.rs b/tests/ui/unpretty/flattened-format-args.rs
new file mode 100644
index 000000000..705dded16
--- /dev/null
+++ b/tests/ui/unpretty/flattened-format-args.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Zunpretty=hir -Zflatten-format-args=yes
+// check-pass
+
+fn main() {
+ let x = 1;
+ // Should flatten to println!("a 123 b {x} xyz\n"):
+ println!("a {} {}", format_args!("{} b {x}", 123), "xyz");
+}
diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout
new file mode 100644
index 000000000..a8fe8da00
--- /dev/null
+++ b/tests/ui/unpretty/flattened-format-args.stdout
@@ -0,0 +1,16 @@
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+// compile-flags: -Zunpretty=hir -Zflatten-format-args=yes
+// check-pass
+
+fn main() {
+ let x = 1;
+ // Should flatten to println!("a 123 b {x} xyz\n"):
+ {
+ ::std::io::_print(<#[lang = "format_arguments"]>::new_v1(&["a 123 b ",
+ " xyz\n"],
+ &[<#[lang = "format_argument"]>::new_display(&x)]));
+ };
+ }
diff --git a/tests/ui/mir-unpretty.rs b/tests/ui/unpretty/mir-unpretty.rs
index 30620c69f..30620c69f 100644
--- a/tests/ui/mir-unpretty.rs
+++ b/tests/ui/unpretty/mir-unpretty.rs
diff --git a/tests/ui/mir-unpretty.stderr b/tests/ui/unpretty/mir-unpretty.stderr
index 3808f8583..3808f8583 100644
--- a/tests/ui/mir-unpretty.stderr
+++ b/tests/ui/unpretty/mir-unpretty.stderr
diff --git a/tests/ui/unpretty-expr-fn-arg.rs b/tests/ui/unpretty/unpretty-expr-fn-arg.rs
index 6e1132a33..6e1132a33 100644
--- a/tests/ui/unpretty-expr-fn-arg.rs
+++ b/tests/ui/unpretty/unpretty-expr-fn-arg.rs
diff --git a/tests/ui/unpretty-expr-fn-arg.stdout b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout
index b745b9886..b745b9886 100644
--- a/tests/ui/unpretty-expr-fn-arg.stdout
+++ b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout
diff --git a/tests/ui/unresolved/unresolved-candidates.stderr b/tests/ui/unresolved/unresolved-candidates.stderr
index ea737c567..7ef2f6b1a 100644
--- a/tests/ui/unresolved/unresolved-candidates.stderr
+++ b/tests/ui/unresolved/unresolved-candidates.stderr
@@ -17,7 +17,7 @@ LL | impl Trait for () {}
|
help: consider importing this trait
|
-LL | use a::Trait;
+LL + use a::Trait;
|
error: aborting due to 2 previous errors
diff --git a/tests/ui/foreign-unsafe-fn-called.mir.stderr b/tests/ui/unsafe/foreign-unsafe-fn-called.mir.stderr
index d3cf5d84f..d3cf5d84f 100644
--- a/tests/ui/foreign-unsafe-fn-called.mir.stderr
+++ b/tests/ui/unsafe/foreign-unsafe-fn-called.mir.stderr
diff --git a/tests/ui/foreign-unsafe-fn-called.rs b/tests/ui/unsafe/foreign-unsafe-fn-called.rs
index 67302ea1b..67302ea1b 100644
--- a/tests/ui/foreign-unsafe-fn-called.rs
+++ b/tests/ui/unsafe/foreign-unsafe-fn-called.rs
diff --git a/tests/ui/foreign-unsafe-fn-called.thir.stderr b/tests/ui/unsafe/foreign-unsafe-fn-called.thir.stderr
index 00ba0f7a6..00ba0f7a6 100644
--- a/tests/ui/foreign-unsafe-fn-called.thir.stderr
+++ b/tests/ui/unsafe/foreign-unsafe-fn-called.thir.stderr
diff --git a/tests/ui/new-unsafe-pointers.rs b/tests/ui/unsafe/new-unsafe-pointers.rs
index d99eb4cbd..d99eb4cbd 100644
--- a/tests/ui/new-unsafe-pointers.rs
+++ b/tests/ui/unsafe/new-unsafe-pointers.rs
diff --git a/tests/ui/unsafe-fn-called-from-unsafe-blk.rs b/tests/ui/unsafe/unsafe-fn-called-from-unsafe-blk.rs
index 3713a7065..3713a7065 100644
--- a/tests/ui/unsafe-fn-called-from-unsafe-blk.rs
+++ b/tests/ui/unsafe/unsafe-fn-called-from-unsafe-blk.rs
diff --git a/tests/ui/unsafe-fn-called-from-unsafe-fn.rs b/tests/ui/unsafe/unsafe-fn-called-from-unsafe-fn.rs
index 5e9531076..5e9531076 100644
--- a/tests/ui/unsafe-fn-called-from-unsafe-fn.rs
+++ b/tests/ui/unsafe/unsafe-fn-called-from-unsafe-fn.rs
diff --git a/tests/ui/unsafe/unsafe-fn-deref-ptr.mir.stderr b/tests/ui/unsafe/unsafe-fn-deref-ptr.mir.stderr
index a26149924..7f1e7c890 100644
--- a/tests/ui/unsafe/unsafe-fn-deref-ptr.mir.stderr
+++ b/tests/ui/unsafe/unsafe-fn-deref-ptr.mir.stderr
@@ -1,11 +1,35 @@
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
- --> $DIR/unsafe-fn-deref-ptr.rs:5:12
+ --> $DIR/unsafe-fn-deref-ptr.rs:5:13
+ |
+LL | let _ = *p;
+ | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
+ --> $DIR/unsafe-fn-deref-ptr.rs:6:17
+ |
+LL | let _: u8 = *p;
+ | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
+ --> $DIR/unsafe-fn-deref-ptr.rs:7:9
+ |
+LL | _ = *p;
+ | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
+ --> $DIR/unsafe-fn-deref-ptr.rs:8:12
|
LL | return *p;
| ^^ 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: aborting due to previous error
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/unsafe/unsafe-fn-deref-ptr.rs b/tests/ui/unsafe/unsafe-fn-deref-ptr.rs
index dc989535b..4b7c6bf69 100644
--- a/tests/ui/unsafe/unsafe-fn-deref-ptr.rs
+++ b/tests/ui/unsafe/unsafe-fn-deref-ptr.rs
@@ -2,6 +2,9 @@
// [thir]compile-flags: -Z thir-unsafeck
fn f(p: *const u8) -> u8 {
+ let _ = *p; //~ ERROR dereference of raw pointer is unsafe
+ let _: u8 = *p; //~ ERROR dereference of raw pointer is unsafe
+ _ = *p; //~ ERROR dereference of raw pointer is unsafe
return *p; //~ ERROR dereference of raw pointer is unsafe
}
diff --git a/tests/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr b/tests/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr
index a26149924..7f1e7c890 100644
--- a/tests/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr
+++ b/tests/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr
@@ -1,11 +1,35 @@
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
- --> $DIR/unsafe-fn-deref-ptr.rs:5:12
+ --> $DIR/unsafe-fn-deref-ptr.rs:5:13
+ |
+LL | let _ = *p;
+ | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
+ --> $DIR/unsafe-fn-deref-ptr.rs:6:17
+ |
+LL | let _: u8 = *p;
+ | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
+ --> $DIR/unsafe-fn-deref-ptr.rs:7:9
+ |
+LL | _ = *p;
+ | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
+ --> $DIR/unsafe-fn-deref-ptr.rs:8:12
|
LL | return *p;
| ^^ 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: aborting due to previous error
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/unsafe-pointer-assignability.rs b/tests/ui/unsafe/unsafe-pointer-assignability.rs
index db822bb6a..db822bb6a 100644
--- a/tests/ui/unsafe-pointer-assignability.rs
+++ b/tests/ui/unsafe/unsafe-pointer-assignability.rs
diff --git a/tests/ui/use/use-mod.rs b/tests/ui/use/use-mod/use-mod.rs
index 87064c6a4..87064c6a4 100644
--- a/tests/ui/use/use-mod.rs
+++ b/tests/ui/use/use-mod/use-mod.rs
diff --git a/tests/ui/use/use-mod.stderr b/tests/ui/use/use-mod/use-mod.stderr
index 0cae5eb14..0cae5eb14 100644
--- a/tests/ui/use/use-mod.stderr
+++ b/tests/ui/use/use-mod/use-mod.stderr
diff --git a/tests/ui/use.rs b/tests/ui/use/use.rs
index 1beee4a51..1beee4a51 100644
--- a/tests/ui/use.rs
+++ b/tests/ui/use/use.rs
diff --git a/tests/ui/variance-intersection-of-ref-and-opt-ref.rs b/tests/ui/variance/variance-intersection-of-ref-and-opt-ref.rs
index 74707a98d..74707a98d 100644
--- a/tests/ui/variance-intersection-of-ref-and-opt-ref.rs
+++ b/tests/ui/variance/variance-intersection-of-ref-and-opt-ref.rs
diff --git a/tests/ui/variance-iterators-in-libcore.rs b/tests/ui/variance/variance-iterators-in-libcore.rs
index a542e44d5..a542e44d5 100644
--- a/tests/ui/variance-iterators-in-libcore.rs
+++ b/tests/ui/variance/variance-iterators-in-libcore.rs
diff --git a/tests/ui/wasm-custom-section-relocations.rs b/tests/ui/wasm/wasm-custom-section-relocations.rs
index c3cca3a35..c3cca3a35 100644
--- a/tests/ui/wasm-custom-section-relocations.rs
+++ b/tests/ui/wasm/wasm-custom-section-relocations.rs
diff --git a/tests/ui/wasm-custom-section-relocations.stderr b/tests/ui/wasm/wasm-custom-section-relocations.stderr
index a37edc51d..a37edc51d 100644
--- a/tests/ui/wasm-custom-section-relocations.stderr
+++ b/tests/ui/wasm/wasm-custom-section-relocations.stderr
diff --git a/tests/ui/wf/hir-wf-check-erase-regions.rs b/tests/ui/wf/hir-wf-check-erase-regions.rs
index 2b4b480df..3855f2c35 100644
--- a/tests/ui/wf/hir-wf-check-erase-regions.rs
+++ b/tests/ui/wf/hir-wf-check-erase-regions.rs
@@ -4,10 +4,10 @@
pub struct Table<T, const N: usize>([Option<T>; N]);
impl<'a, T, const N: usize> IntoIterator for &'a Table<T, N> {
- type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; //~ ERROR `&T` is not an iterator
+ type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; //~ ERROR `&'a T` is not an iterator
type Item = &'a T;
- fn into_iter(self) -> Self::IntoIter { //~ ERROR `&T` is not an iterator
+ fn into_iter(self) -> Self::IntoIter { //~ ERROR `&'a T` is not an iterator
unimplemented!()
}
}
diff --git a/tests/ui/wf/hir-wf-check-erase-regions.stderr b/tests/ui/wf/hir-wf-check-erase-regions.stderr
index 7bc19dd2e..2843983c7 100644
--- a/tests/ui/wf/hir-wf-check-erase-regions.stderr
+++ b/tests/ui/wf/hir-wf-check-erase-regions.stderr
@@ -1,24 +1,24 @@
-error[E0277]: `&T` is not an iterator
+error[E0277]: `&'a T` is not an iterator
--> $DIR/hir-wf-check-erase-regions.rs:7:21
|
LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&T` is not an iterator
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'a T` is not an iterator
|
- = help: the trait `Iterator` is not implemented for `&T`
+ = help: the trait `Iterator` is not implemented for `&'a T`
= help: the trait `Iterator` is implemented for `&mut I`
- = note: required for `&T` to implement `IntoIterator`
+ = note: required for `&'a T` to implement `IntoIterator`
note: required by a bound in `Flatten`
--> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
-error[E0277]: `&T` is not an iterator
+error[E0277]: `&'a T` is not an iterator
--> $DIR/hir-wf-check-erase-regions.rs:10:27
|
LL | fn into_iter(self) -> Self::IntoIter {
- | ^^^^^^^^^^^^^^ `&T` is not an iterator
+ | ^^^^^^^^^^^^^^ `&'a T` is not an iterator
|
- = help: the trait `Iterator` is not implemented for `&T`
+ = help: the trait `Iterator` is not implemented for `&'a T`
= help: the trait `Iterator` is implemented for `&mut I`
- = note: required for `&T` to implement `IntoIterator`
+ = note: required for `&'a T` to implement `IntoIterator`
note: required by a bound in `Flatten`
--> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
diff --git a/tests/ui/wf/issue-110157.rs b/tests/ui/wf/issue-110157.rs
new file mode 100644
index 000000000..43a8ce72f
--- /dev/null
+++ b/tests/ui/wf/issue-110157.rs
@@ -0,0 +1,12 @@
+struct NeedsDropTypes<'tcx, F>(std::marker::PhantomData<&'tcx F>);
+
+impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
+//~^ ERROR type annotations needed
+where
+ F: Fn(&Missing) -> Result<I, ()>,
+ //~^ ERROR cannot find type `Missing` in this scope
+ I: Iterator<Item = Missing>,
+ //~^ ERROR cannot find type `Missing` in this scope
+{}
+
+fn main() {}
diff --git a/tests/ui/wf/issue-110157.stderr b/tests/ui/wf/issue-110157.stderr
new file mode 100644
index 000000000..91d801e94
--- /dev/null
+++ b/tests/ui/wf/issue-110157.stderr
@@ -0,0 +1,32 @@
+error[E0412]: cannot find type `Missing` in this scope
+ --> $DIR/issue-110157.rs:6:12
+ |
+LL | F: Fn(&Missing) -> Result<I, ()>,
+ | ^^^^^^^ not found in this scope
+
+error[E0412]: cannot find type `Missing` in this scope
+ --> $DIR/issue-110157.rs:8:24
+ |
+LL | I: Iterator<Item = Missing>,
+ | ^^^^^^^ not found in this scope
+
+error[E0283]: type annotations needed
+ --> $DIR/issue-110157.rs:3:31
+ |
+LL | impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
+ | ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `I`
+ |
+ = note: cannot satisfy `_: Iterator`
+note: required for `NeedsDropTypes<'tcx, F>` to implement `Iterator`
+ --> $DIR/issue-110157.rs:3:18
+ |
+LL | impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
+ | ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | I: Iterator<Item = Missing>,
+ | ------------------------ unsatisfied trait bound introduced here
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0283, E0412.
+For more information about an error, try `rustc --explain E0283`.
diff --git a/tests/ui/wf/wf-const-type.stderr b/tests/ui/wf/wf-const-type.stderr
index 85938364e..617969720 100644
--- a/tests/ui/wf/wf-const-type.stderr
+++ b/tests/ui/wf/wf-const-type.stderr
@@ -12,7 +12,8 @@ LL | struct IsCopy<T:Copy> { t: T }
| ^^^^ required by this bound in `IsCopy`
help: consider annotating `NotCopy` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct NotCopy;
|
error: aborting due to previous error
diff --git a/tests/ui/wf/wf-static-type.stderr b/tests/ui/wf/wf-static-type.stderr
index 16c6124b6..bb5a57834 100644
--- a/tests/ui/wf/wf-static-type.stderr
+++ b/tests/ui/wf/wf-static-type.stderr
@@ -12,7 +12,8 @@ LL | struct IsCopy<T:Copy> { t: T }
| ^^^^ required by this bound in `IsCopy`
help: consider annotating `NotCopy` with `#[derive(Copy)]`
|
-LL | #[derive(Copy)]
+LL + #[derive(Copy)]
+LL | struct NotCopy;
|
error: aborting due to previous error
diff --git a/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr b/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr
index f4c7acd5c..ce409f627 100644
--- a/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr
+++ b/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr
@@ -1,8 +1,8 @@
-error[E0277]: the trait bound `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[1209]::called::'b), 'b))> fn(&ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[1209]::called::'b), 'b) }) ()): Foo` is not satisfied
+error[E0277]: the trait bound `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> fn(&ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b) }) ()): Foo` is not satisfied
--> $DIR/higher-ranked-fn-type.rs:20:5
|
LL | called()
- | ^^^^^^ the trait `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[1209]::called::'b), 'b))> Foo` is not implemented for `fn(&ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[1209]::called::'b), 'b) }) ())`
+ | ^^^^^^ the trait `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> Foo` is not implemented for `fn(&ReLateBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b) }) ())`
|
note: required by a bound in `called`
--> $DIR/higher-ranked-fn-type.rs:12:25
diff --git a/tests/ui/where-clauses/where-clauses-method-unsatisfied.stderr b/tests/ui/where-clauses/where-clauses-method-unsatisfied.stderr
index e90502977..6cf717295 100644
--- a/tests/ui/where-clauses/where-clauses-method-unsatisfied.stderr
+++ b/tests/ui/where-clauses/where-clauses-method-unsatisfied.stderr
@@ -11,7 +11,8 @@ LL | fn equals(&self, u: &Foo<T>) -> bool where T : Eq {
| ^^ required by this bound in `Foo::<T>::equals`
help: consider annotating `Bar` with `#[derive(Eq)]`
|
-LL | #[derive(Eq)]
+LL + #[derive(Eq)]
+LL | struct Bar; // does not implement Eq
|
error: aborting due to previous error
diff --git a/tests/ui/where-clauses/where-clauses-unsatisfied.stderr b/tests/ui/where-clauses/where-clauses-unsatisfied.stderr
index b1805a452..4d239bf43 100644
--- a/tests/ui/where-clauses/where-clauses-unsatisfied.stderr
+++ b/tests/ui/where-clauses/where-clauses-unsatisfied.stderr
@@ -11,7 +11,8 @@ LL | fn equal<T>(a: &T, b: &T) -> bool where T : Eq { a == b }
| ^^ required by this bound in `equal`
help: consider annotating `Struct` with `#[derive(Eq)]`
|
-LL | #[derive(Eq)]
+LL + #[derive(Eq)]
+LL | struct Struct;
|
error: aborting due to previous error